[gnome-dictionary] Add helper scripts for Meson builds



commit 09ecf4ca47d865107fc022ad8af0889038894df4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 11 23:09:42 2017 +0100

    Add helper scripts for Meson builds
    
    We need a post-install trigger for builds that do not go through a
    packaging tool, or jhbuild.
    
    We also need a small script to make a release out of the Git repository.

 build-aux/make_release.sh |   17 +++++++++++++++++
 build-aux/post-install.sh |   14 ++++++++++++++
 meson.build               |    3 +++
 3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/build-aux/make_release.sh b/build-aux/make_release.sh
new file mode 100755
index 0000000..9b35917
--- /dev/null
+++ b/build-aux/make_release.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+test -n "$srcdir" || srcdir=$1
+test -n "$srcdir" || srcdir=.
+
+cd $srcdir
+
+PROJECT=gnome-dictionary
+VERSION=$(git describe --abbrev=0)
+NAME="${PROJECT}-${VERSION}"
+
+echo "Creating git tree archiveā€¦"
+git archive --prefix="${NAME}/" --format=tar HEAD > ${NAME}.tar
+
+rm -f "${NAME}.tar"
+
+echo "Compressing archiveā€¦"
+xz -f "${NAME}.tar"
diff --git a/build-aux/post-install.sh b/build-aux/post-install.sh
new file mode 100755
index 0000000..8a33de2
--- /dev/null
+++ b/build-aux/post-install.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Package managers set this so we don't need to run
+if [ -z "$DESTDIR" ]; then
+  echo Compiling GSettings schemas...
+  glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas
+
+  echo Updating desktop database...
+  update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications
+
+  # We don't have any installed icon
+  #echo Updating icon cache...
+  #gtk-update-icon-cache -q -t -f ${MESON_INSTALL_PREFIX}/share/icons/hicolor
+fi
diff --git a/meson.build b/meson.build
index 2c12a4a..db57020 100644
--- a/meson.build
+++ b/meson.build
@@ -135,3 +135,6 @@ subdir('src')
 subdir('po')
 subdir('data')
 subdir('help')
+
+# Post-installation trigger
+meson.add_install_script ('build-aux/post-install.sh')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]