[45056] trunk/dports/x11/gtk2/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Wed Jan 7 12:32:58 PST 2009


Revision: 45056
          http://trac.macports.org/changeset/45056
Author:   jeremyhu at macports.org
Date:     2009-01-07 12:32:58 -0800 (Wed, 07 Jan 2009)
Log Message:
-----------
gtk2: Build better with system_x11 variant and nonstandard x11prefix with pc-less X11

Modified Paths:
--------------
    trunk/dports/x11/gtk2/Portfile

Modified: trunk/dports/x11/gtk2/Portfile
===================================================================
--- trunk/dports/x11/gtk2/Portfile	2009-01-07 20:25:28 UTC (rev 45055)
+++ trunk/dports/x11/gtk2/Portfile	2009-01-07 20:32:58 UTC (rev 45056)
@@ -141,8 +141,25 @@
         #lib:libXcomposite.1:xorg-libXcomposite \
         #lib:libXfixes.3:xorg-libXfixes \
 
+    configure.args-append      --with-xinput --enable-xinerama
 
-    configure.args-append      --with-xinput --enable-xinerama
+    # This block helps us link correctly and setup our pc files correctly when we are
+    # +system_x11 and x11prefix is somewhere non-standard
+    if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
+        # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
+        # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
+        # and LDFLAGS without interference
+        configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
+        configure.cppflags-append -I${x11prefix}/include
+        configure.ldflags-append  -L${x11prefix}/lib
+ 
+        # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
+        post-destroot {
+            foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
+                reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
+            }
+        }
+    }
 }
 
 livecheck.check regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090107/def0529e/attachment.html>


More information about the macports-changes mailing list