[97736] trunk/dports/net

devans at macports.org devans at macports.org
Thu Sep 13 11:06:32 PDT 2012


Revision: 97736
          http://trac.macports.org//changeset/97736
Author:   devans at macports.org
Date:     2012-09-13 11:06:32 -0700 (Thu, 13 Sep 2012)
Log Message:
-----------
libtorrent-rasterbar*: fail with error message if active boost doesn't have the required Python support.

Modified Paths:
--------------
    trunk/dports/net/libtorrent-rasterbar/Portfile
    trunk/dports/net/libtorrent-rasterbar-devel/Portfile

Modified: trunk/dports/net/libtorrent-rasterbar/Portfile
===================================================================
--- trunk/dports/net/libtorrent-rasterbar/Portfile	2012-09-13 15:33:09 UTC (rev 97735)
+++ trunk/dports/net/libtorrent-rasterbar/Portfile	2012-09-13 18:06:32 UTC (rev 97736)
@@ -36,6 +36,23 @@
                     reinplace "s|__MP_BUILD_ARCH__|${build_arch}|" ${worksrcpath}/bindings/python/setup.py.in
                 }
 
+#
+# Make sure that boost is installed with the correct Python variant
+#
+
+pre-configure {
+    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 {${boost_python_version} != ${boost_python_required}} {
+            ui_error "This port requires 'boost ${boost_variant}'. Please install as follows:"
+            ui_error "    sudo port install boost ${boost_variant}"
+            return -code error
+    }
+}
+
 configure.args  --disable-silent-rules \
                 --enable-python-binding \
                 --enable-geoip \
@@ -57,14 +74,19 @@
                 "PYTHON_INSTALL_PARAMS=--prefix=${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7"
 }
 
-if {![variant_isset python26]} {
-        default_variants +python27
-}
-
 variant error_logging description {Enable logging of errors to disk} {
     configure.args-append --enable-logging=errors
 }
 
+if {[variant_isset python26]} {
+        set boost_python_required 2.6
+        set boost_variant         +python26
+} else {
+        set boost_python_required 2.7
+        set boost_variant         +python27
+        default_variants          +python27
+}
+
 livecheck.type  regex
 livecheck.url   http://code.google.com/p/libtorrent/downloads/list
 livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"

Modified: trunk/dports/net/libtorrent-rasterbar-devel/Portfile
===================================================================
--- trunk/dports/net/libtorrent-rasterbar-devel/Portfile	2012-09-13 15:33:09 UTC (rev 97735)
+++ trunk/dports/net/libtorrent-rasterbar-devel/Portfile	2012-09-13 18:06:32 UTC (rev 97736)
@@ -41,6 +41,23 @@
                     reinplace "s|__MP_BUILD_ARCH__|${build_arch}|" ${worksrcpath}/bindings/python/setup.py.in
                 }
 
+#
+# Make sure that boost is installed with the correct Python variant
+#
+
+pre-configure {
+    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 {${boost_python_version} != ${boost_python_required}} {
+            ui_error "This port requires 'boost ${boost_variant}'. Please install as follows:"
+            ui_error "    sudo port install boost ${boost_variant}"
+            return -code error
+    }
+}
+
 configure.args  --disable-silent-rules \
                 --enable-python-binding \
                 --enable-geoip \
@@ -62,12 +79,17 @@
                 "PYTHON_INSTALL_PARAMS=--prefix=${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7"
 }
 
-if {![variant_isset python26]} {
-        default_variants +python27
-}
-
 variant error_logging description {Enable logging of errors to disk} {
     configure.args-append --enable-logging=errors
 }
 
+if {[variant_isset python26]} {
+        set boost_python_required 2.6
+        set boost_variant         +python26
+} else {
+        set boost_python_required 2.7
+        set boost_variant         +python27
+        default_variants          +python27
+}
+
 livecheck.type  none
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120913/41a96d8a/attachment.html>


More information about the macports-changes mailing list