[138277] trunk/dports/irc/weechat/Portfile

ionic at macports.org ionic at macports.org
Fri Jul 3 14:18:48 PDT 2015


Revision: 138277
          https://trac.macports.org/changeset/138277
Author:   ionic at macports.org
Date:     2015-07-03 14:18:48 -0700 (Fri, 03 Jul 2015)
Log Message:
-----------
weechat: fix python variant(s). Patch provided by maintainer. Fixes: #37048.

Modified Paths:
--------------
    trunk/dports/irc/weechat/Portfile

Modified: trunk/dports/irc/weechat/Portfile
===================================================================
--- trunk/dports/irc/weechat/Portfile	2015-07-03 21:10:33 UTC (rev 138276)
+++ trunk/dports/irc/weechat/Portfile	2015-07-03 21:18:48 UTC (rev 138277)
@@ -59,10 +59,45 @@
                     -DENABLE_GUILE=OFF \
                     -DENABLE_PERL=OFF \
                     -DENABLE_PYTHON=OFF \
+                    -DENABLE_PYTHON3=OFF \
                     -DENABLE_RUBY=OFF \
                     -DENABLE_ASPELL=OFF \
                     -DENABLE_MAN=ON
 
+variant python requires python27 description {Compatibility variant, requires +python27} {}
+
+variant python27 description "Bindings for python 2.7 plugins" conflicts python34 {
+    configure.args-replace  -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
+    configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7
+    configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/2.7/Headers
+    configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python
+    depends_lib-append      port:python27
+}
+
+variant python34 description "Bindings for python 3.4 plugins" conflicts python27 {
+    configure.args-replace  -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
+    configure.args-replace  -DENABLE_PYTHON3=OFF -DENABLE_PYTHON3=ON
+    configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.4
+    configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/3.4/Headers
+    configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/3.4/Python
+    depends_lib-append      port:python34
+
+    # From http://weechat.org/files/doc/stable/weechat_user.en.html#dependencies
+    notes "Recommended Python version is 2.7 (all scripts run fine with version 2.7, but not with versions ≤ 2.6 or ≥ 3.0)."
+}
+
+post-configure {
+    if {[variant_isset python27] || [variant_isset python34]} {
+        set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
+
+        reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
+
+        if {[variant_isset python34]} {
+            reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
+        }
+    }
+}
+
 variant aspell description {Support for aspell} {
     configure.args-delete   -DENABLE_ASPELL=OFF
     configure.args-append   -DENABLE_ASPELL=ON
@@ -87,16 +122,6 @@
     depends_lib-append      path:bin/perl:perl5
 }
 
-variant python description {Bindings for python plugins} {
-    configure.args-delete   -DENABLE_PYTHON=OFF
-    configure.args-append   -DENABLE_PYTHON=ON
-    depends_lib-append      path:bin/python:python27
-
-    post-configure {
-        reinplace -E "s|\(Python.framework\)|${frameworks_dir}/\\1|" ${worksrcpath}/src/plugins/python/CMakeFiles/python.dir/link.txt
-    }
-}
-
 variant ruby description {Bindings for ruby plugins} {
     configure.args-delete   -DENABLE_RUBY=OFF
     configure.args-append   -DENABLE_RUBY=ON
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150703/e0e1a97f/attachment.html>


More information about the macports-changes mailing list