[125904] trunk/dports/security/botan/Portfile

cal at macports.org cal at macports.org
Sun Sep 28 22:46:16 PDT 2014


Revision: 125904
          https://trac.macports.org/changeset/125904
Author:   cal at macports.org
Date:     2014-09-28 22:46:16 -0700 (Sun, 28 Sep 2014)
Log Message:
-----------
botan: add python2.7 dependency and universal variant, closes #39635

Without the python2.7 dependency the port might fail to build if somebody
selected python3 as his "python". I know that's discouraged, but people do it
anyway.

Modified Paths:
--------------
    trunk/dports/security/botan/Portfile

Modified: trunk/dports/security/botan/Portfile
===================================================================
--- trunk/dports/security/botan/Portfile	2014-09-29 04:57:16 UTC (rev 125903)
+++ trunk/dports/security/botan/Portfile	2014-09-29 05:46:16 UTC (rev 125904)
@@ -1,9 +1,11 @@
 # $Id$
 
-PortSystem 1.0
+PortSystem          1.0
+PortGroup           muniversal 1.0
 
 name                botan
 version             1.10.8
+revision            1
 categories          security devel
 platforms           darwin
 maintainers         mww
@@ -22,11 +24,12 @@
                     sha256  bc2fd5fe904bba7cd688df021689f53a2d2f87ae728b647196a6b5954d184ea0
 use_bzip2           yes
 
+depends_build       port:python27
 depends_lib         port:openssl port:zlib port:bzip2
 
 worksrcdir          Botan-${version}
 
-configure.cmd       ./configure.py
+configure.cmd       ${prefix}/bin/python2.7 ./configure.py
 configure.args      --docdir=share/doc --with-openssl --with-zlib --with-bzip2
 
 if {[string match *clang* ${configure.compiler}]} {
@@ -39,25 +42,39 @@
 
 platform darwin { configure.args-append --os=darwin }
 
-if {[info exists build_arch] && ${os.platform} eq "darwin"} {
-    if {(${build_arch} eq "i386")} {
-        configure.args-append --cpu=ia32
-        build.args CXX="${configure.cxx} -m32"
-    } elseif {(${build_arch} eq "x86_64")} {
-        configure.args-append --cpu=amd64
-        build.args CXX="${configure.cxx} -m64"
-    } elseif {(${build_arch} eq "ppc")} {
-        configure.args-append --cpu=ppc
-        build.args CXX="${configure.cxx} -m32"
-    } elseif {(${build_arch} eq "ppc64")} {
-        configure.args-append --cpu=ppc64
-        build.args CXX="${configure.cxx} -m64"
+# botan way of setting cpu type in build phase
+array set merger_configure_args {
+    ppc     --cpu=ppc
+    i386    --cpu=ia32
+    ppc64   --cpu=ppc64
+    x86_64  --cpu=amd64
+}
+
+if {![variant_isset universal]} {
+    if {[info exists build_arch] && ${os.platform} eq "darwin"} {
+        switch ${build_arch} {
+            ppc -
+            i386 {
+                build.args CXX="${configure.cxx} -m32"
+            }
+            ppc64 -
+            x86_64 {
+                build.args CXX="${configure.cxx} -m64"
+            }
+        }
+        configure.args-append $merger_configure_args(${build_arch})
+    } else {
+        build.args CXX="${configure.cxx}"
     }
 } else {
-    build.args CXX="${configure.cxx}"
+    # the arch flag is lost in the build phase, so put it back
+    foreach arch ${configure.universal_archs} {
+        lappend merger_build_args(${arch}) CXX='${configure.cxx} -arch ${arch}'
+    }
 }
 
-universal_variant   no
+# configure.py rejects this argument
+configure.universal_args-delete --disable-dependency-tracking
 
 livecheck.regex     "Botan-(1.10.\[0-9\]+).tbz"
 livecheck.url       http://botan.randombit.net/download.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140928/cafe3cab/attachment-0001.html>


More information about the macports-changes mailing list