[79508] trunk/dports/graphics/freeimage

mcalhoun at macports.org mcalhoun at macports.org
Wed Jun 15 21:31:51 PDT 2011


Revision: 79508
          http://trac.macports.org/changeset/79508
Author:   mcalhoun at macports.org
Date:     2011-06-15 21:31:50 -0700 (Wed, 15 Jun 2011)
Log Message:
-----------
freeimage: Update Version 3.14.1 -> 3.15.0. Add support for build_arch.

Modified Paths:
--------------
    trunk/dports/graphics/freeimage/Portfile

Removed Paths:
-------------
    trunk/dports/graphics/freeimage/files/

Modified: trunk/dports/graphics/freeimage/Portfile
===================================================================
--- trunk/dports/graphics/freeimage/Portfile	2011-06-16 04:19:17 UTC (rev 79507)
+++ trunk/dports/graphics/freeimage/Portfile	2011-06-16 04:31:50 UTC (rev 79508)
@@ -4,7 +4,7 @@
 PortSystem          1.0
 
 name                freeimage
-version             3.14.1
+version             3.15.0
 license             FreeImage-1.0 GPL-2
 categories          graphics
 platforms           macosx
@@ -23,12 +23,10 @@
 use_zip             yes
 worksrcdir          FreeImage
 
-checksums           md5     4b43112aa199d8a439e0535b9c25d8a4 \
-                    sha1    cc09671e16460c27242280c2b6100f39974c89e1 \
-                    rmd160  5432f0aa922992ac74e5fefc115c1442bb48ce76
+checksums           md5     3b4f08e4985b269beb29a2fced1ef888 \
+                    sha1    ec2faa01d1b312aab68d77afe62861759c790100 \
+                    rmd160  5d309d0d8335129d00d6b5455613c89a419ebcac
 
-patchfiles          patch-Makefile.gnu.diff
-
 post-patch {
     # Libraries extension is ".dylib" on Darwin, not ".so"
     reinplace {s/\.so/.dylib/} ${worksrcpath}/Makefile.gnu
@@ -41,27 +39,37 @@
 
     # Do not force installation as root
     reinplace {s/-o root -g root//} ${worksrcpath}/Makefile.gnu
+    
+    # Darwin requires different arguments to build dynamic libraries
+    reinplace "s|-Wl,-soname,\$(VERLIBNAME)|-dynamiclib -install_name \$(PREFIX)/lib/\$(VERLIBNAME) -compatibility_version \$(VER_MAJOR) -current_version \$(VER_MAJOR).\$(VER_MINOR)|g" ${worksrcpath}/Makefile.gnu
+
+    # Darwin does not have a command ldconfig
+    reinplace "s|ldconfig||g" ${worksrcpath}/Makefile.gnu
 }
 
+if { [variant_isset universal] } {
+    post-patch {
+        reinplace "s|CFLAGS ?= |CFLAGS ?= ${configure.universal_cflags} |g" ${worksrcpath}/Makefile.gnu
+        reinplace "s|CXXFLAGS ?= |CXXFLAGS ?= ${configure.universal_cxxflags} |g" ${worksrcpath}/Makefile.gnu
+    }
+} else {
+    post-patch {
+        reinplace "s|CFLAGS ?= |CFLAGS ?= -arch ${build_arch} |g" ${worksrcpath}/Makefile.gnu
+        reinplace "s|CXXFLAGS ?= |CXXFLAGS ?= -arch ${build_arch} |g" ${worksrcpath}/Makefile.gnu
+    }
+}
+
 use_configure       no
 
-set CC "${configure.cc} ${configure.cflags}"
-set CXX "${configure.cxx} ${configure.cxxflags}"
-set LDFLAGS ${configure.ldflags}
 set VERLIBNAME libfreeimage.[lindex [split ${version} .] 0].dylib
 
-build.target        FreeImage
 build.args          -f Makefile.gnu \
                     PREFIX=${prefix} \
-                    VERLIBNAME=${VERLIBNAME}
+                    VERLIBNAME=${VERLIBNAME} \
+                    CC="${configure.cc}" \
+                    CXX="${configure.cxx}" \
+                    LDFLAGS="${configure.ldflags}"
 
-pre-build {
-    build.args-append \
-        CC="${CC}" \
-        CXX="${CXX}" \
-        LDFLAGS="${LDFLAGS}"
-}
-
 destroot.args       -f Makefile.gnu \
                     INCDIR=${destroot}${prefix}/include \
                     INSTALLDIR=${destroot}${prefix}/lib \
@@ -83,21 +91,11 @@
 
 pre-test {
     # Use correct compiler and flags when compiling test
-    reinplace s:g++:${CXX}: ${test.dir}/Makefile
+    reinplace s:g++:${configure.cxx}: ${test.dir}/Makefile
 
-    # Use headers and libraries in source directories as Dist is not used
-    reinplace s:-I../Dist/:-I../Source/: ${test.dir}/Makefile
-    reinplace s:Dist/:: ${test.dir}/Makefile
-
     # Build the test
     system "make -C ${test.dir}"
 }
 
-variant universal {
-    append CC " ${configure.universal_cflags}"
-    append CXX " ${configure.universal_cxxflags}"
-    append LDFLAGS " ${configure.universal_ldflags}"
-}
-
 livecheck.type      regex
 livecheck.regex     {FreeImage (\d+(?:\.\d+)*) released}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110615/7602e4fb/attachment.html>


More information about the macports-changes mailing list