| 67 | variant python requires python27 description {Compatibility variant, requires +python27} {} |
| 68 | |
| 69 | variant python27 description "Bindings for python 2.7 plugins" conflicts python34 { |
| 70 | configure.args-replace -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON |
| 71 | configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 |
| 72 | configure.args-append -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/2.7/Headers |
| 73 | configure.args-append -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python |
| 74 | depends_lib-append port:python27 |
| 75 | } |
| 76 | |
| 77 | variant python34 description "Bindings for python 3.4 plugins" conflicts python27 { |
| 78 | configure.args-replace -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON |
| 79 | configure.args-replace -DENABLE_PYTHON3=OFF -DENABLE_PYTHON3=ON |
| 80 | configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python3.4 |
| 81 | configure.args-append -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/3.4/Headers |
| 82 | configure.args-append -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/3.4/Python |
| 83 | depends_lib-append port:python34 |
| 84 | |
| 85 | # From http://weechat.org/files/doc/stable/weechat_user.en.html#dependencies |
| 86 | notes "Recommended Python version is 2.7 (all scripts run fine with version 2.7, but not with versions ≤ 2.6 or ≥ 3.0)." |
| 87 | } |
| 88 | |
| 89 | post-configure { |
| 90 | if {[variant_isset python27] || [variant_isset python34]} { |
| 91 | set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt |
| 92 | |
| 93 | reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile} |
| 94 | |
| 95 | if {[variant_isset python34]} { |
| 96 | reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile} |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |