[122242] trunk/dports/graphics/ipe-tools/Portfile

petr at macports.org petr at macports.org
Fri Jul 18 04:12:17 PDT 2014


Revision: 122242
          https://trac.macports.org/changeset/122242
Author:   petr at macports.org
Date:     2014-07-18 04:12:17 -0700 (Fri, 18 Jul 2014)
Log Message:
-----------
ipe-tools @20140303_1: switch from py*-pil to path-based dependency (ticket #44284), pythen part rewriten to avoid code replication, minor reformating

Modified Paths:
--------------
    trunk/dports/graphics/ipe-tools/Portfile

Modified: trunk/dports/graphics/ipe-tools/Portfile
===================================================================
--- trunk/dports/graphics/ipe-tools/Portfile	2014-07-18 08:17:35 UTC (rev 122241)
+++ trunk/dports/graphics/ipe-tools/Portfile	2014-07-18 11:12:17 UTC (rev 122242)
@@ -7,19 +7,21 @@
 version                 20140303
 revision                1
 categories              graphics
-maintainers             jacobs-university.de:m.thon gmx.de:Torsten.Maehne openmaintainer
+maintainers             jacobs-university.de:m.thon \
+                        gmx.de:Torsten.Maehne \
+                        openmaintainer
+platforms               darwin
+license                 {GPL-2 GPL-3}
+
 description             Tools for the Ipe extensible drawing editor
-long_description        \
-                        The following tools for the Ipe extensible drawing \
+
+long_description        The following tools for the Ipe extensible drawing \
                         editor are provided: \
-                        - svgtoipe \
-                        - pdftoipe \
-                        - figtoipe \
-                        - ipe5toxml
-license                 {GPL-2 GPL-3}
+                        svgtoipe, pdftoipe, figtoipe, ipe5toxml
+
 homepage                http://ipe7.sourceforge.net/
 master_sites            sourceforge:project/ipe7/tools
-platforms               darwin
+
 set svgtoipe-vers       20131107
 set pdftoipe-vers       20140303
 set figtoipe-vers       20091205
@@ -74,36 +76,52 @@
         xinstall -m 755 ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py ${destroot}${prefix}/bin
 }
 
-variant python24 conflicts python25 python26 python27 description {Use PIL from MacPorts Python 2.4} {
-    depends_lib-append port:py24-pil
-    post-patch {
-        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.4|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
+set python.versions         {24 25 26 27}
+set python.default_version  27
+
+# create python variants
+foreach ver ${python.versions} {
+
+    set variant_line {variant python${ver} description "Use python${ver} and packages from MacPorts"}
+
+    foreach over ${python.versions} {
+        if {${ver} == ${over}} {
+            continue
+        }
+        append variant_line " conflicts python${over}"
     }
+    append variant_line { {}}
+    eval $variant_line
 }
 
-variant python25 conflicts python24 python26 python27 description {Use PIL from MacPorts Python 2.5} {
-    depends_lib-append port:py25-pil
-    post-patch {
-        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.5|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
+# set default python variant
+set variant_none true
+foreach ver ${python.versions} {
+    if {[variant_isset python${ver}]} {
+        set variant_none [expr $variant_none && ![variant_isset python${ver}]]
     }
 }
+if {${variant_none}} {
+    default_variants-append "+python${python.default_version}"
+}
 
-variant python26 conflicts python24 python25 python27 description {Use PIL from MacPorts Python 2.6} {
-    depends_lib-append port:py26-pil
-    post-patch {
-        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.6|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
-    }
+# python variant settings
+foreach ver ${python.versions} {
+    if {[variant_isset python${ver}]} {set python.version ${ver}}
 }
 
-variant python27 conflicts python24 python25 python26 description {Use PIL from MacPorts Python 2.7} {
-    depends_lib-append port:py27-pil
-    post-patch {
-        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.7|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
-    }
+# set derived python variables
+set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
+set python.pkgd     ${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages
+
+if { ${python.version} <= 25 } {
+    depends_lib-append  port:py${python.version}-pil
+} else {
+    depends_lib-append  path:${python.pkgd}/PIL:py${python.version}-Pillow
 }
 
-if {![variant_isset python24] && ![variant_isset python25] && ![variant_isset python26] && ![variant_isset python27]} {
-    default_variants +python27
+post-patch {
+    reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python${python.branch}|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
 }
 
 livecheck.type  regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140718/49bc4e4a/attachment-0001.html>


More information about the macports-changes mailing list