[115893] trunk/dports/python

devans at macports.org devans at macports.org
Mon Jan 13 11:43:03 PST 2014


Revision: 115893
          https://trac.macports.org/changeset/115893
Author:   devans at macports.org
Date:     2014-01-13 11:43:03 -0800 (Mon, 13 Jan 2014)
Log Message:
-----------
py2[67]-exiv2: replace with new unified port py-exiv2, use active_variants port group (#33153).

Modified Paths:
--------------
    trunk/dports/python/py-exiv2/Portfile

Added Paths:
-----------
    trunk/dports/python/py-exiv2/

Removed Paths:
-------------
    trunk/dports/python/py26-exiv2/
    trunk/dports/python/py27-exiv2/

Modified: trunk/dports/python/py-exiv2/Portfile
===================================================================
--- trunk/dports/python/py27-exiv2/Portfile	2014-01-13 17:02:37 UTC (rev 115890)
+++ trunk/dports/python/py-exiv2/Portfile	2014-01-13 19:43:03 UTC (rev 115893)
@@ -2,17 +2,14 @@
 # $Id$
 
 PortSystem      1.0
+PortGroup       python 1.0
+PortGroup       active_variants 1.1
 
-name            py27-exiv2
-#
-# conflict due to dependency on 
-# Python version specific variant of boost
-#
-conflicts       py26-exiv2
+name            py-exiv2
 platforms       darwin
 set my_name     pyexiv2
 version         0.3.2
-revision        1
+revision        2
 set branch      [join [lrange [split ${version} .] 0 1] .]
 categories      python graphics
 license         GPL-2
@@ -31,38 +28,31 @@
 checksums       rmd160  cbc53e6f45b0f4251b90bfb6ffab8c659463ac5d \
                 sha256  0abc117c6afa71f54266cb91979a5227f60361db1fcfdb68ae9615398d7a2127
 
-depends_build   port:scons
+python.versions 26 27
+python.default_version  27
 
-depends_lib     port:boost \
-                port:exiv2 \
-                port:python27
+if {$subport != $name} {
+    depends_build-append    port:scons
 
+    depends_lib-append      port:boost \
+                            port:exiv2
+
+    patchfiles              patch-src-SConscript.diff
+
 #
-# Make sure that boost is installed with the correct Python variant
+# conflict due to dependency on
+# Python version specific variant of boost
 #
-
-pre-build {
-    set boost_python_lib ${prefix}/lib/libboost_python-mt.dylib
-    set boost_python_version "0"
-    if {[file exists ${boost_python_lib}]} {
-        set boost_python_version [exec /usr/bin/otool -L ${boost_python_lib} | /usr/bin/grep Python | /usr/bin/sed -e "s|^.*Versions/||" -e "s|/.*||"]
+    if {${python.version} == 26} {
+        conflicts   py27-exiv2
+    } else {
+        conflicts   py26-exiv2
     }
-    if {${boost_python_version} != "2.7"} {
-            ui_error "This port requires 'boost +python27'. Please install as follows:"
-            ui_error "    sudo port install boost +python27."
-            return -code error
-    }
-}
- 
-patchfiles      patch-src-SConscript.diff
-
-use_configure   no
-
 #
-# universal_variant is not set by default if configure is disabled
+# Make sure that boost is installed with the correct Python variant
 #
 
-universal_variant yes
+    require_active_variants boost python${python.version}
 
 #
 # scons (a python script) uses python builtin procedures
@@ -70,43 +60,49 @@
 # depends on the version of python used to run scons
 #
 
-build.cmd       ${prefix}/bin/python2.7 ${prefix}/bin/scons
-build.target
-build.args-append \
-                BOOSTLIB=boost_python-mt \
-                PYTHONLIB=python2.7
-build.env-append \
-                PREFIX=${prefix} \
-                CXX=${configure.cxx} \
-
-if {[variant_isset universal]} {
+    build.cmd       ${python.bin} ${prefix}/bin/scons
+    build.target
+    build.args-append \
+        BOOSTLIB=boost_python-mt \
+        PYTHONLIB=python${python.branch}
     build.env-append \
+        PREFIX=${prefix} \
+        CXX=${configure.cxx} \
+
+    pre-build {
+        if {[variant_isset universal]} {
+            build.env-append \
                 CXXFLAGS="${configure.universal_cxxflags} -I${prefix}/include" \
                 LDFLAGS="${configure.universal_ldflags} -L${prefix}/lib"
-} else {
-    build.env-append \
+        } else {
+            build.env-append \
                 CXXFLAGS="-I${prefix}/include" \
                 LDFLAGS="-L${prefix}/lib"
-}
+        }
+    }
 
-destroot.cmd    ${prefix}/bin/python2.7 ${prefix}/bin/scons
-destroot.args-append \
-                BOOSTLIB=boost_python-mt \
-                PYTHONLIB=python2.7
-destroot.env-append \
-                PREFIX=${prefix}\
-                CXX=${configure.cxx} \
-
-if {[variant_isset universal]} {
+    destroot.cmd        ${python.bin} ${prefix}/bin/scons
+    destroot.destdir    DESTDIR=${destroot}
+    destroot.args-append \
+        BOOSTLIB=boost_python-mt \
+        PYTHONLIB=python${python.branch}
     destroot.env-append \
-                CXXFLAGS="${configure.universal_cxxflags} -I${prefix}/include" \
-                LDFLAGS="${configure.universal_ldflags} -L${prefix}/lib"
+        PREFIX=${prefix}\
+        CXX=${configure.cxx} \
+
+    if {[variant_isset universal]} {
+        destroot.env-append \
+            CXXFLAGS="${configure.universal_cxxflags} -I${prefix}/include" \
+            LDFLAGS="${configure.universal_ldflags} -L${prefix}/lib"
+    } else {
+        destroot.env-append \
+            CXXFLAGS="-I${prefix}/include" \
+            LDFLAGS="-L${prefix}/lib"
+    }
+
+    livecheck.type  regex
+    livecheck.url   http://tilloy.net/dev/pyexiv2/download.html
+    livecheck.regex "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
 } else {
-    destroot.env-append \
-                CXXFLAGS="-I${prefix}/include" \
-                LDFLAGS="-L${prefix}/lib"
+    livecheck.type  none
 }
-
-livecheck.type  regex
-livecheck.url   http://tilloy.net/dev/pyexiv2/download.html
-livecheck.regex "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140113/34343716/attachment.html>


More information about the macports-changes mailing list