[95227] trunk/dports/gnome/gobject-introspection
cal at macports.org
cal at macports.org
Sat Jul 7 05:58:45 PDT 2012
Revision: 95227
https://trac.macports.org/changeset/95227
Author: cal at macports.org
Date: 2012-07-07 05:58:45 -0700 (Sat, 07 Jul 2012)
Log Message:
-----------
gobject-introspection: Use absolute paths in generated typelib files, openmaintainer, see also #33877 comment 14,15
Using absolute paths doesn't require the user to specify
DYLD_LIBRARY_PATH=$prefix/lib or DYLD_FALLBACK_LIBRARY_PATH=$prefix/lib.
This requires a revbump of every port that installs a .gir file, i.e. atk,
gdk-pixbuf2, gtk3, pango(-devel). Since that revbump will be required by #33877
anyway, I'm not commiting it right now.
Modified Paths:
--------------
trunk/dports/gnome/gobject-introspection/Portfile
Added Paths:
-----------
trunk/dports/gnome/gobject-introspection/files/patch-giscanner-shlib.py-use-absolute-linkage-paths.patch
trunk/dports/gnome/gobject-introspection/files/patch-giscanner-utils.py-use-absolute-linkage-paths.patch
Modified: trunk/dports/gnome/gobject-introspection/Portfile
===================================================================
--- trunk/dports/gnome/gobject-introspection/Portfile 2012-07-07 12:57:45 UTC (rev 95226)
+++ trunk/dports/gnome/gobject-introspection/Portfile 2012-07-07 12:58:45 UTC (rev 95227)
@@ -5,7 +5,7 @@
name gobject-introspection
version 1.32.1
-revision 2
+revision 3
set branch [join [lrange [split ${version} .] 0 1] .]
categories gnome
platforms darwin
@@ -37,10 +37,13 @@
#path:lib/pkgconfig/glib-2.0.pc:glib2 \
-patchfiles patch-giscanner-scannerlexer.l-support-__inline__.patch
+patchfiles patch-giscanner-scannerlexer.l-support-__inline__.patch \
+ patch-giscanner-shlib.py-use-absolute-linkage-paths.patch \
+ patch-giscanner-utils.py-use-absolute-linkage-paths.patch
post-patch {
reinplace "s|'cc'|'${configure.cc}'|g" ${worksrcpath}/giscanner/sourcescanner.py
+ reinplace "s|libcairo-gobject.2.dylib|${prefix}/lib/libcairo-gobject.2.dylib|g" ${worksrcpath}/configure
}
configure.python ${prefix}/bin/python2.7
Added: trunk/dports/gnome/gobject-introspection/files/patch-giscanner-shlib.py-use-absolute-linkage-paths.patch
===================================================================
--- trunk/dports/gnome/gobject-introspection/files/patch-giscanner-shlib.py-use-absolute-linkage-paths.patch (rev 0)
+++ trunk/dports/gnome/gobject-introspection/files/patch-giscanner-shlib.py-use-absolute-linkage-paths.patch 2012-07-07 12:58:45 UTC (rev 95227)
@@ -0,0 +1,11 @@
+--- giscanner/shlibs.py.orig 2012-05-19 04:01:42.000000000 +0200
++++ giscanner/shlibs.py 2012-05-19 04:03:23.000000000 +0200
+@@ -49,7 +49,7 @@
+ # is crazy enough to name a library liblib<foo> when lib<foo> exists.
+ #
+ def _ldd_library_pattern(library_name):
+- return re.compile("(?<![A-Za-z0-9_-])(lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
++ return re.compile("([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)"
+ % re.escape(library_name))
+
+ # This is a what we do for non-la files. We assume that we are on an
Added: trunk/dports/gnome/gobject-introspection/files/patch-giscanner-utils.py-use-absolute-linkage-paths.patch
===================================================================
--- trunk/dports/gnome/gobject-introspection/files/patch-giscanner-utils.py-use-absolute-linkage-paths.patch (rev 0)
+++ trunk/dports/gnome/gobject-introspection/files/patch-giscanner-utils.py-use-absolute-linkage-paths.patch 2012-07-07 12:58:45 UTC (rev 95227)
@@ -0,0 +1,44 @@
+--- giscanner/utils.py.orig 2012-07-07 12:41:26.000000000 +0200
++++ giscanner/utils.py 2012-07-07 12:49:08.000000000 +0200
+@@ -21,6 +21,7 @@
+ import re
+ import os
+ import subprocess
++import platform
+
+ _debugflags = None
+ def have_debug_flag(flag):
+@@ -78,6 +79,18 @@
+ else:
+ return None
+
++_libtool_libdir_pat = re.compile("libdir='([^']+)'")
++
++def _extract_libdir_field(la_file):
++ f = open(la_file)
++ data = f.read()
++ f.close()
++ m = _libtool_libdir_pat.search(data)
++ if m:
++ return m.groups()[0]
++ else:
++ return None
++
+ # Returns the name that we would pass to dlopen() the library
+ # corresponding to this .la file
+ def extract_libtool_shlib(la_file):
+@@ -85,6 +98,14 @@
+ if dlname is None:
+ return None
+
++ # Darwin uses absolute paths where possible; since the libtool files never
++ # contain absolute paths, use the libdir field
++ if platform.system() == 'Darwin':
++ dlbasename = os.path.basename(dlname)
++ libdir = _extract_libdir_field(la_file)
++ if libdir is None:
++ return dlbasename
++ return libdir + '/' + dlbasename
+ # From the comments in extract_libtool(), older libtools had
+ # a path rather than the raw dlname
+ return os.path.basename(dlname)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120707/0db63aac/attachment-0001.html>
More information about the macports-changes
mailing list