[gimp/gimp-2-8] Bug 737779 - Poppler-data not installed or not working in OSX release



commit 3d5ef9d26601f0e35d77fe1b550b917af3e8fea0
Author: Kristian Rietveld <kris loopnest org>
Date:   Sun Dec 13 21:47:42 2015 +0100

    Bug 737779 - Poppler-data not installed or not working in OSX release
    
    The main problem is that poppler-data is not relocatable on OS X (it is
    on Windows for example). Apply a tiny patch to poppler that accepts a
    POPPLER_DATADIR environment variable, which we set in the .app launcher
    script. Also include poppler-data in the resulting app bundle.

 build/osx/README                                   |    1 +
 build/osx/gimp-2.8-python.bundle                   |    3 +++
 build/osx/gimp.modules                             |    5 ++++-
 build/osx/launcher-2.8-python.sh                   |    6 ++++--
 ...t-overriding-datadir-through-env-variable.patch |   14 ++++++++++++++
 5 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/build/osx/README b/build/osx/README
index d80b60e..9257946 100644
--- a/build/osx/README
+++ b/build/osx/README
@@ -81,6 +81,7 @@ curl -o $HOME/gimp/directory/patches/gtk2-add-missing-information-to-po-translat
 curl -o $HOME/gimp/directory/patches/libffi-fix-wrong-variable-substitution-in-configure.patch 
https://git.gnome.org/browse/gimp/plain/build/osx/patches/libffi-fix-wrong-variable-substitution-in-configure.patch?h=gimp-2-8
 curl -o $HOME/gimp/directory/patches/libgcrypt-build-without-docs.patch 
https://git.gnome.org/browse/gimp/plain/build/osx/patches/libgcrypt-build-without-docs.patch?h=gimp-2-8
 curl -o $HOME/gimp/directory/patches/libsecret-fix-secret-dbus-generation.c.patch 
https://git.gnome.org/browse/gimp/plain/build/osx/patches/libsecret-fix-secret-dbus-generation.c.patch?h=gimp-2-8
+curl -o $HOME/gimp/directory/patches/poppler-support-overriding-datadir-through-env-variable.patch 
https://git.gnome.org/browse/gimp/plain/build/osx/patches/poppler-support-overriding-datadir-through-env-variable.patch?h=gimp-2-8
 
 Check https://git.gnome.org/browse/gimp/tree/build/osx/patches?h=gimp-2-8:
 If there are less patches than listed above, then you don't need to try to
diff --git a/build/osx/gimp-2.8-python.bundle b/build/osx/gimp-2.8-python.bundle
index d4a2069..015d8ff 100644
--- a/build/osx/gimp-2.8-python.bundle
+++ b/build/osx/gimp-2.8-python.bundle
@@ -198,6 +198,9 @@
        <data>${prefix}/etc/fonts/conf.d/*</data>
        <data>${prefix}/etc/fonts/fonts.conf</data>
 
+       <!-- Copy in poppler data -->
+       <data>${prefix}/share/poppler</data>
+
        <!-- GIMP data -->
        <data dest="${bundle}/Contents/Resources/share/gimp">
                ${prefix}/share/gimp
diff --git a/build/osx/gimp.modules b/build/osx/gimp.modules
index 9d1dd0c..bf1bd8e 100755
--- a/build/osx/gimp.modules
+++ b/build/osx/gimp.modules
@@ -679,7 +679,10 @@
 
        <autotools id="poppler" autogen-sh="configure"
                autogenargs="--enable-compile-warnings=no">
-               <branch module="poppler-0.26.3.tar.xz" version="0.26.3" repo="poppler" />
+               <branch module="poppler-0.26.3.tar.xz" version="0.26.3" repo="poppler">
+                       <patch file="poppler-support-overriding-datadir-through-env-variable.patch"
+                               strip="1" />
+               </branch>
                <dependencies>
                        <dep package="lcms" />
                        <dep package="lcms2" />
diff --git a/build/osx/launcher-2.8-python.sh b/build/osx/launcher-2.8-python.sh
index 622d068..d6d7488 100755
--- a/build/osx/launcher-2.8-python.sh
+++ b/build/osx/launcher-2.8-python.sh
@@ -65,9 +65,11 @@ PYTHONPATH="$bundle_lib/pygtk/2.0:$PYTHONPATH"
 
 # Include gimp python modules
 PYTHONPATH="$bundle_lib/gimp/2.0/python:$PYTHONPATH"
-
 export PYTHONPATH
 
+# Set custom Poppler Data Directory
+export POPPLER_DATADIR="$bundle_data/poppler"
+
 # Specify Ghostscript directories
 # export GS_RESOURCE_DIR="$bundle_res/share/ghostscript/9.06/Resource"
 # export GS_ICC_PROFILES="$bundle_res/share/ghostscript/9.06/iccprofiles/"
@@ -91,4 +93,4 @@ if /bin/expr "x$1" : '^x-psn_' > /dev/null; then
 fi
 
 echo "Launching GIMP..."
-$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
\ No newline at end of file
+$EXEC "$bundle_contents/MacOS/$name-bin" "$@" $EXTRA_ARGS
diff --git a/build/osx/patches/poppler-support-overriding-datadir-through-env-variable.patch 
b/build/osx/patches/poppler-support-overriding-datadir-through-env-variable.patch
new file mode 100644
index 0000000..db41f22
--- /dev/null
+++ b/build/osx/patches/poppler-support-overriding-datadir-through-env-variable.patch
@@ -0,0 +1,14 @@
+diff -upr poppler-0.26.3.orig/poppler/GlobalParams.cc poppler-0.26.3/poppler/GlobalParams.cc
+--- poppler-0.26.3.orig/poppler/GlobalParams.cc        2014-04-26 17:37:22.000000000 +0200
++++ poppler-0.26.3/poppler/GlobalParams.cc     2015-12-13 21:09:47.000000000 +0100
+@@ -683,7 +683,9 @@ GlobalParams::GlobalParams(const char *c
+ void GlobalParams::scanEncodingDirs() {
+   GDir *dir;
+   GDirEntry *entry;
+-  const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
++  char *dataRootEnv = getenv("POPPLER_DATADIR");
++  const char *dataRoot = popplerDataDir ? popplerDataDir :
++                             (dataRootEnv ? dataRootEnv : POPPLER_DATADIR);
+   
+   // allocate buffer large enough to append "/nameToUnicode"
+   size_t bufSize = strlen(dataRoot) + strlen("/nameToUnicode") + 1;


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