diff --git a/Makefile.am b/Makefile.am index 778413578..47d8c3fbc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,7 @@ EXTRA_DIST = \ src/modules/bluetooth/meson.build \ src/modules/echo-cancel/meson.build \ src/modules/gsettings/meson.build \ - src/modules/gsettings/post-install.sh \ + src/modules/gsettings/meson_post_install.py \ src/modules/meson.build \ src/modules/oss/meson.build \ src/modules/raop/meson.build \ diff --git a/src/modules/gsettings/meson.build b/src/modules/gsettings/meson.build index f39fb65ee..68a72c3ff 100644 --- a/src/modules/gsettings/meson.build +++ b/src/modules/gsettings/meson.build @@ -29,7 +29,7 @@ install_data('org.freedesktop.pulseaudio.gschema.xml', install_dir : join_paths(datadir, 'glib-2.0', 'schemas') ) -meson.add_install_script('post-install.sh', datadir) +meson.add_install_script('meson_post_install.py', datadir) # Conversion from GConf to GSettings diff --git a/src/modules/gsettings/meson_post_install.py b/src/modules/gsettings/meson_post_install.py new file mode 100644 index 000000000..0ddb70ded --- /dev/null +++ b/src/modules/gsettings/meson_post_install.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import os +import subprocess +import sys + +datadir = sys.argv[1] + +# Package managers set this so we don't need to run +if not os.environ.get('DESTDIR'): + schemadir = os.path.join(datadir, 'glib-2.0', 'schemas') + print('Compiling gsettings schemas...') + subprocess.call(['glib-compile-schemas', schemadir]) + diff --git a/src/modules/gsettings/post-install.sh b/src/modules/gsettings/post-install.sh deleted file mode 100755 index cec8b9349..000000000 --- a/src/modules/gsettings/post-install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -set -e -set -u - -DATADIR="$1" - -# Package managers set this so we don't need to run -if [ "${DESTDIR:-}" ]; then exit 0; fi - -echo "Compiling GSettings schemas..." -glib-compile-schemas "$DATADIR/glib-2.0/schemas"