From 62ed82a49535a891acb85a2e7b9d861433db1670 Mon Sep 17 00:00:00 2001 From: hrxi Date: Thu, 22 Jun 2023 00:04:39 +0200 Subject: [PATCH] meson: Install more stuff Install .vapi, .deps, .h files for the Vala libraries. Also install the data files. .deps files have to be manually generated, there's a feature request for automated generation at https://github.com/mesonbuild/meson/issues/9756. Import the gnome module globally. Install dependencies on Meson CI. --- .github/workflows/build.yml | 2 +- libdino/dino.deps | 6 ++++++ libdino/meson.build | 5 ++++- main/meson.build | 16 +++++++++++++--- main/po/meson.build | 1 + meson.build | 2 ++ meson_options.txt | 2 +- qlite/meson.build | 7 ++++++- qlite/qlite.deps | 3 +++ xmpp-vala/meson.build | 7 ++++++- xmpp-vala/xmpp-vala.deps | 5 +++++ 11 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 libdino/dino.deps create mode 100644 main/po/meson.build create mode 100644 qlite/qlite.deps create mode 100644 xmpp-vala/xmpp-vala.deps diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 590035e0..8408c28a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - run: sudo apt-get update - run: sudo apt-get remove libunwind-14-dev - - run: sudo apt-get install -y build-essential gettext libadwaita-1-dev libgee-0.8-dev libgtk-4-dev libsqlite3-dev meson valac + - run: sudo apt-get install -y build-essential gettext libadwaita-1-dev libcanberra-dev libgcrypt20-dev libgee-0.8-dev libgpgme-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgtk-4-dev libnice-dev libnotify-dev libqrencode-dev libsignal-protocol-c-dev libsoup-3.0-dev libsqlite3-dev libsrtp2-dev libwebrtc-audio-processing-dev meson valac - run: meson setup build - run: meson compile -C build build-flatpak: diff --git a/libdino/dino.deps b/libdino/dino.deps new file mode 100644 index 00000000..c1146392 --- /dev/null +++ b/libdino/dino.deps @@ -0,0 +1,6 @@ +gdk-pixbuf-2.0 +gee-0.8 +glib-2.0 +gmodule-2.0 +qlite +xmpp-vala diff --git a/libdino/meson.build b/libdino/meson.build index 611e8ca7..356c15d3 100644 --- a/libdino/meson.build +++ b/libdino/meson.build @@ -83,5 +83,8 @@ c_args = [ '-DDINO_SYSTEM_PLUGIN_DIR="@0@"'.format(get_option('prefix') / get_option('plugindir')), '-DG_LOG_DOMAIN="libdino"', ] -lib_dino = library('dino', sources, c_args: c_args, include_directories: include_directories('src'), dependencies: dependencies) +lib_dino = library('dino', sources, c_args: c_args, include_directories: include_directories('src'), dependencies: dependencies, version: '0.0', install: true, install_dir: [true, true, true]) dep_dino = declare_dependency(link_with: lib_dino, include_directories: include_directories('.', 'src')) + +install_data('dino.deps', install_dir: get_option('datadir') / 'vala/vapi') # TODO: workaround for https://github.com/mesonbuild/meson/issues/9756 +install_headers('src/dino_i18n.h') diff --git a/main/meson.build b/main/meson.build index 0326cc7c..f6d212f8 100644 --- a/main/meson.build +++ b/main/meson.build @@ -1,3 +1,4 @@ +subdir('po') dependencies = [ dep_dino, dep_gee, @@ -91,8 +92,8 @@ sources = files( 'src/view_model/preferences_row.vala', 'src/windows/conversation_details.vala', ) -sources += import('gnome').compile_resources( - 'dino-resources', +sources += gnome.compile_resources( + 'resources', 'data/gresource.xml', source_dir: 'data', ) @@ -102,4 +103,13 @@ c_args = [ '-DGETTEXT_PACKAGE="dino"', '-DLOCALE_INSTALL_DIR="@0@"'.format(get_option('prefix') / get_option('localedir')), ] -exe_dino = executable('dino', sources, c_args: c_args, vala_args: ['--vapidir', meson.current_source_dir() / 'vapi'], dependencies: dependencies) +vala_args = [ + '--vapidir', meson.current_source_dir() / 'vapi', +] +exe_dino = executable('dino', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, install: true) + +install_data('data/icons/scalable/apps/im.dino.Dino-symbolic.svg', install_dir: get_option('datadir') / 'hicolor/symbolic/apps') +install_data('data/icons/scalable/apps/im.dino.Dino.svg', install_dir: get_option('datadir') / 'hicolor/scalable/apps') +install_data('data/im.dino.Dino.appdata.xml', install_dir: get_option('datadir') / 'metainfo') +install_data('data/im.dino.Dino.desktop', install_dir: get_option('datadir') / 'applications') +install_data('data/im.dino.Dino.service', install_dir: get_option('datadir') / 'dbus-1/servces') diff --git a/main/po/meson.build b/main/po/meson.build new file mode 100644 index 00000000..ea0d12d4 --- /dev/null +++ b/main/po/meson.build @@ -0,0 +1 @@ +i18n.gettext('dino') diff --git a/meson.build b/meson.build index aea22d57..c4b7fecf 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,8 @@ project('xmpp-vala', 'vala') fs = import('fs') +gnome = import('gnome') +i18n = import('i18n') python = import('python') dep_gdk_pixbuf = dependency('gdk-pixbuf-2.0') diff --git a/meson_options.txt b/meson_options.txt index 6e47b7c8..a1dcd3c2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1 @@ -option('plugindir', type: 'string', value: 'lib/dino/plugins', description: 'Plugin directory for Dino plugins') +option('plugindir', type: 'string', value: 'lib/dino/plugins', description: 'Dino plugin directory') diff --git a/qlite/meson.build b/qlite/meson.build index 714a4224..9523b618 100644 --- a/qlite/meson.build +++ b/qlite/meson.build @@ -18,5 +18,10 @@ sources = files( c_args = [ '-DG_LOG_DOMAIN="qlite"', ] -lib_qlite = library('qlite', sources, c_args: c_args, vala_args: ['--vapidir', meson.current_source_dir() / 'vapi'], dependencies: dependencies) +vala_args = [ + '--vapidir', meson.current_source_dir() / 'vapi', +] +lib_qlite = library('qlite', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, version: '0.1', install: true, install_dir: [true, true, true]) dep_qlite = declare_dependency(link_with: lib_qlite, include_directories: include_directories('.')) + +install_data('qlite.deps', install_dir: get_option('datadir') / 'vala/vapi') # TODO: workaround for https://github.com/mesonbuild/meson/issues/9756 diff --git a/qlite/qlite.deps b/qlite/qlite.deps new file mode 100644 index 00000000..d9b15e78 --- /dev/null +++ b/qlite/qlite.deps @@ -0,0 +1,3 @@ +gee-0.8 +glib-2.0 +sqlite3 diff --git a/xmpp-vala/meson.build b/xmpp-vala/meson.build index 3064339a..be5e96a8 100644 --- a/xmpp-vala/meson.build +++ b/xmpp-vala/meson.build @@ -129,5 +129,10 @@ sources = files( c_args = [ '-DG_LOG_DOMAIN="xmpp-vala"', ] -lib_xmpp_vala = library('xmpp-vala', sources, c_args: c_args, vala_args: ['--vapidir', meson.current_source_dir() / 'vapi'], dependencies: dependencies) +vala_args = [ + '--vapidir', meson.current_source_dir() / 'vapi', +] +lib_xmpp_vala = library('xmpp-vala', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, version: '0.1', install: true, install_dir: [true, true, true]) dep_xmpp_vala = declare_dependency(link_with: lib_xmpp_vala, include_directories: include_directories('.')) + +install_data('xmpp-vala.deps', install_dir: get_option('datadir') / 'vala/vapi') # TODO: workaround for https://github.com/mesonbuild/meson/issues/9756 diff --git a/xmpp-vala/xmpp-vala.deps b/xmpp-vala/xmpp-vala.deps new file mode 100644 index 00000000..97323d51 --- /dev/null +++ b/xmpp-vala/xmpp-vala.deps @@ -0,0 +1,5 @@ +gdk-pixbuf-2.0 +gee-0.8 +gio-2.0 +glib-2.0 +icu-uc