about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlakoliu <99976966+lakoliu@users.noreply.github.com>2022-07-24 10:09:08 +0300
committerGitHub <noreply@github.com>2022-07-24 10:09:08 +0300
commit0aeda0ca3607d84e29e4e60a845cca721f748610 (patch)
tree347f45dca0e617722a335953571b572baad3795b
parent996f669796e83f08fd92506441e0340c0f393f61 (diff)
parent1889c11e0dcd995372e6f7876be701ad65b1c64a (diff)
downloadFurtherance-0aeda0ca3607d84e29e4e60a845cca721f748610.tar.zst
Merge pull request #80 from winterqt/gnome-post-install
Switch to gnome.post_install
-rwxr-xr-xbuild-aux/meson/postinstall.py21
-rwxr-xr-xmeson.build10
-rwxr-xr-xsrc/meson.build11
3 files changed, 13 insertions, 29 deletions
diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py
deleted file mode 100755
index 6a3ea97..0000000
--- a/build-aux/meson/postinstall.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python3
-
-from os import environ, path
-from subprocess import call
-
-prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
-datadir = path.join(prefix, 'share')
-destdir = environ.get('DESTDIR', '')
-
-# Package managers set this so we don't need to run
-if not destdir:
-    print('Updating icon cache...')
-    call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
-
-    print('Updating desktop database...')
-    call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
-
-    print('Compiling GSettings schemas...')
-    call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])
-
-
diff --git a/meson.build b/meson.build
index fd87fd4..4957ebc 100755
--- a/meson.build
+++ b/meson.build
@@ -1,10 +1,12 @@
 project('furtherance', 'rust',
           version: '1.5.3',
-    meson_version: '>= 0.50.0',
+    meson_version: '>= 0.59.0',
   default_options: [ 'warning_level=2',
                    ],
 )
 
+gnome = import('gnome')
+
 # Dependencies
 dependency('sqlite3', version: '>= 3.20')
 dependency('dbus-1')
@@ -35,4 +37,8 @@ subdir('data')
 subdir('src')
 subdir('po')
 
-meson.add_install_script('build-aux/meson/postinstall.py')
+gnome.post_install(
+  glib_compile_schemas: true,
+  gtk_update_icon_cache: true,
+  update_desktop_database: true,
+)
diff --git a/src/meson.build b/src/meson.build
index 3afd404..b2bde7b 100755
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,4 @@
 pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
-gnome = import('gnome')
 
 gnome.compile_resources('furtherance',
   'furtherance.gresource.xml',
@@ -25,8 +24,8 @@ configure_file(
 # Copy the config.rs output to the source directory.
 run_command(
   'cp',
-  join_paths(meson.build_root(), 'src', 'config.rs'),
-  join_paths(meson.source_root(), 'src', 'config.rs'),
+  join_paths(meson.project_build_root(), 'src', 'config.rs'),
+  join_paths(meson.project_source_root(), 'src', 'config.rs'),
   check: true
 )
 
@@ -50,7 +49,7 @@ rust_sources = files(
 
 sources = [cargo_sources, rust_sources]
 
-cargo_script = find_program(join_paths(meson.source_root(), 'build-aux/cargo.sh'))
+cargo_script = find_program(join_paths(meson.project_source_root(), 'build-aux/cargo.sh'))
 cargo_release = custom_target(
   'cargo-build',
   build_by_default: true,
@@ -61,8 +60,8 @@ cargo_release = custom_target(
   install_dir: get_option('bindir'),
   command: [
     cargo_script,
-    meson.build_root(),
-    meson.source_root(),
+    meson.project_build_root(),
+    meson.project_source_root(),
     '@OUTPUT@',
     get_option('buildtype'),
     meson.project_name(),