summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2017-10-19 17:32:33 +0200
committerAvatar Heiko Becker <heirecka@exherbo.org> 2017-10-19 18:13:40 +0200
commitf0ebcaa855a82e64f5e1a0f401958ce0c09229e1 (patch)
tree04b1abf493517b81a4802aac65dc48d1e1ef3c35
parent4775211c75cf7677374d2c7ee535ead28937af68 (diff)
downloadarbor-master.tar.gz
arbor-master.tar.xz
glib: Backport upstream patch to fix issue with gdbus-codegenHEADmaster
-rw-r--r--packages/dev-libs/glib/files/glib-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch70
-rw-r--r--packages/dev-libs/glib/glib-2.54.1-r2.exheres-0 (renamed from packages/dev-libs/glib/glib-2.54.1-r1.exheres-0)4
2 files changed, 74 insertions, 0 deletions
diff --git a/packages/dev-libs/glib/files/glib-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch b/packages/dev-libs/glib/files/glib-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
new file mode 100644
index 0000000..5d98853
--- /dev/null
+++ b/packages/dev-libs/glib/files/glib-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
@@ -0,0 +1,70 @@
+Upstream: yes, cherry-picked from master
+
+From b9f2ea423526735f7fe7371fb1339eae91a618c2 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Tue, 12 Sep 2017 15:46:57 +0530
+Subject: [PATCH] gdbus-codegen: Don't assume bindir and datadir share prefix
+
+This assumption breaks when, for instance:
+
+* Called as /bin/gdbus-codegen
+* Installed on Windows in a directory that is not `bin/`
+
+For such cases, we cannot make any assumptions about the directory
+structure, and must hard-code the datadir.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=786785
+---
+ gio/gdbus-2.0/codegen/Makefile.am | 2 +-
+ gio/gdbus-2.0/codegen/gdbus-codegen.in | 9 +++++++++
+ gio/gdbus-2.0/codegen/meson.build | 1 +
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gio/gdbus-2.0/codegen/Makefile.am b/gio/gdbus-2.0/codegen/Makefile.am
+index b3fb2c292..b4e500cb0 100644
+--- a/gio/gdbus-2.0/codegen/Makefile.am
++++ b/gio/gdbus-2.0/codegen/Makefile.am
+@@ -21,7 +21,7 @@ CLEANFILES += gdbus-codegen
+ EXTRA_DIST += gdbus-codegen.in
+
+ gdbus-codegen: gdbus-codegen.in Makefile $(codegen_PYTHON)
+- $(AM_V_GEN) sed -e 's,@datadir\@,$(datadir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
++ $(AM_V_GEN) sed -e 's,@DATADIR\@,$(datadir),' -e 's,@PYTHON\@,$(PYTHON),' $< > $@.tmp && mv $@.tmp $@
+ @chmod a+x $@
+
+ clean-local:
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+index 805098188..e3f4f00f8 100644
+--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+@@ -37,6 +37,15 @@ else:
+ # parent directory to the python path.
+ path = os.path.join(filedir, '..')
+
++# If the above path detection failed, use the hard-coded datadir. This can
++# happen when, for instance, bindir and datadir are not in the same prefix or
++# on Windows where we cannot make any guarantees about the directory structure.
++#
++# In these cases our installation cannot be relocatable, but at least we should
++# be able to find the codegen module.
++if not os.path.isfile(os.path.join(path, 'codegen', 'codegen_main.py')):
++ path = os.path.join('@DATADIR@', 'glib-2.0')
++
+ sys.path.insert(0, os.path.abspath(path))
+ from codegen import codegen_main
+
+diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
+index 0e9ffbdfa..aacaac182 100644
+--- a/gio/gdbus-2.0/codegen/meson.build
++++ b/gio/gdbus-2.0/codegen/meson.build
+@@ -11,6 +11,7 @@ gdbus_codegen_files = [
+ gdbus_codegen_conf = configuration_data()
+ gdbus_codegen_conf.set('VERSION', glib_version)
+ gdbus_codegen_conf.set('PYTHON', python.path())
++gdbus_codegen_conf.set('DATADIR', glib_datadir)
+
+ # Install gdbus-codegen executable
+ # FIXME: Set permissions
+--
+2.14.2
+
diff --git a/packages/dev-libs/glib/glib-2.54.1-r1.exheres-0 b/packages/dev-libs/glib/glib-2.54.1-r2.exheres-0
index 90772b1..efffac1 100644
--- a/packages/dev-libs/glib/glib-2.54.1-r1.exheres-0
+++ b/packages/dev-libs/glib/glib-2.54.1-r2.exheres-0
@@ -42,6 +42,10 @@ DEPENDENCIES="
gnome-desktop/gvfs [[ description = [ Provides utilities and support for GIO ] ]]
"
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}"/${PN}-gdbus-codegen-Don-t-assume-bindir-and-datadir-share-.patch
+)
+
# NOTE: glib:2 is used by sydbox, and thus in system. For this reason it shouldn't hard depend on
# anything not in ::arbor, that means no recommendations, just suggestions