[153748] trunk/dports/gnome/gnucash

dports at macports.org dports at macports.org
Mon Oct 10 02:38:16 CEST 2016


Revision: 153748
          https://trac.macports.org/changeset/153748
Author:   dports at macports.org
Date:     2016-10-09 17:38:15 -0700 (Sun, 09 Oct 2016)
Log Message:
-----------
gnucash: fix bugs involving DYLD_LIBRARY_PATH (#52494)

Install gnucash libraries into a separate subdir of $prefix/lib, and
add these as well as the guile18 library directory to
DYLD_LIBRARY_PATH at runtime instead of $prefix/lib. This prevents
errors caused by unintentionally including all of MacPorts's libraries
in DYLD_LIBRARY_PATH.

Modified Paths:
--------------
    trunk/dports/gnome/gnucash/Portfile

Added Paths:
-----------
    trunk/dports/gnome/gnucash/files/patch-src_bin_environment.in.diff
    trunk/dports/gnome/gnucash/files/patch-src_core-utils_gnc-path.c.diff

Modified: trunk/dports/gnome/gnucash/Portfile
===================================================================
--- trunk/dports/gnome/gnucash/Portfile	2016-10-10 00:35:36 UTC (rev 153747)
+++ trunk/dports/gnome/gnucash/Portfile	2016-10-10 00:38:15 UTC (rev 153748)
@@ -6,6 +6,7 @@
 
 name              gnucash
 version           2.6.14
+revision          1
 perl5.branches    5.22
 conflicts         gnucash-devel
 categories        gnome x11
@@ -32,9 +33,23 @@
 checksums           rmd160  3e7eb1da511efe7b1a91224d1ca2a53b3fd42052 \
                     sha256  3b144f2ca5025df5eb1977b11e6f93208f3e90d840285ae952fa9b3da8158e75
 
-patchfiles        patch-configure.ac.diff
+# We'll install gnucash's libraries in a separate subdir of
+# ${prefix}/lib, because gnucash sets DYLD_LIBRARY_PATH at runtime in
+# order to dynamically load these directories, and including all
+# MacPorts libraries in DYLD_LIBRARY_PATH can cause problems.
+# guile18 modules are also installed in a separate subdirectory.
+# See https://trac.macports.org/ticket/52494.
+set gnclibdir     ${prefix}/lib/gnucash
 
+patchfiles        patch-configure.ac.diff \
+                  patch-src_bin_environment.in.diff \
+                  patch-src_core-utils_gnc-path.c.diff
+
 post-patch {
+    reinplace "s|@@GUILEPATH@@|${prefix}/lib/guile18|" ${worksrcpath}/src/bin/environment.in
+    reinplace "s|@@LIBDIR@@|${gnclibdir}|" ${worksrcpath}/src/bin/environment.in
+    reinplace "s|@@LIBDIR@@|${gnclibdir}|" ${worksrcpath}/src/core-utils/gnc-path.c
+    
     # gnc-fq-dump needs to be patched to use MacPorts perl.
     # (autoconf takes care of the other perl scripts.)
     reinplace "s|^#!/usr/bin/perl|#!${perl5.bin}|" ${worksrcpath}/src/quotes/gnc-fq-dump
@@ -103,6 +118,9 @@
                   --disable-ofx \
                   --disable-dbi \
                   --with-html-engine=webkit
+
+configure.args-append   --libdir=${gnclibdir}
+
 configure.perl    ${perl5.bin}
 configure.env \
     GUILE=${prefix}/bin/guile18 \

Added: trunk/dports/gnome/gnucash/files/patch-src_bin_environment.in.diff
===================================================================
--- trunk/dports/gnome/gnucash/files/patch-src_bin_environment.in.diff	                        (rev 0)
+++ trunk/dports/gnome/gnucash/files/patch-src_bin_environment.in.diff	2016-10-10 00:38:15 UTC (rev 153748)
@@ -0,0 +1,11 @@
+--- src/bin/environment.in.orig	2016-10-04 23:47:24.000000000 -0700
++++ src/bin/environment.in	2016-10-04 23:46:34.000000000 -0700
+@@ -56,7 +56,7 @@
+ GUILE_LOAD_COMPILED_PATH={GNC_LIB}/scm/ccache/@-GUILE_EFFECTIVE_VERSION-@;{GUILE_COMPILED_LIBS};{GUILE_LOAD_COMPILED_PATH}
+ 
+ # Tell Guile where to find GnuCash specific shared libraries
+-GNC_LIBRARY_PATH={SYS_LIB};{GNC_LIB}
++GNC_LIBRARY_PATH={GNC_LIB};@@GUILEPATH@@;@@LIBDIR@@
+ LD_LIBRARY_PATH={GNC_LIBRARY_PATH};{LD_LIBRARY_PATH}
+ # The same, but for GnuCash on OS X
+ DYLD_LIBRARY_PATH={GNC_LIBRARY_PATH};{DYLD_LIBRARY_PATH}

Added: trunk/dports/gnome/gnucash/files/patch-src_core-utils_gnc-path.c.diff
===================================================================
--- trunk/dports/gnome/gnucash/files/patch-src_core-utils_gnc-path.c.diff	                        (rev 0)
+++ trunk/dports/gnome/gnucash/files/patch-src_core-utils_gnc-path.c.diff	2016-10-10 00:38:15 UTC (rev 153748)
@@ -0,0 +1,11 @@
+--- src/core-utils/gnc-path.c.orig	2016-10-09 12:42:19.000000000 -0700
++++ src/core-utils/gnc-path.c	2016-10-09 12:44:04.000000000 -0700
+@@ -48,7 +48,7 @@
+ gchar *gnc_path_get_libdir()
+ {
+     //printf("Returning libdir %s\n", gnc_gbr_find_lib_dir (LIBDIR));
+-    return gnc_gbr_find_lib_dir (LIBDIR);
++    return g_strdup("@@LIBDIR@@");
+ }
+ 
+ /** Returns the datadir path, usually
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161009/8f2c87e2/attachment-0002.html>


More information about the macports-changes mailing list