Ticket #37048: weechat-python.patch

File weechat-python.patch, 2.1 KB (added by larryv (Lawrence Velázquez), 9 years ago)

adding variants without eval+subst

  • dports/irc/weechat/Portfile

    diff --git a/dports/irc/weechat/Portfile b/dports/irc/weechat/Portfile
    index 9ab8faa..e7d3431 100644
    a b configure.args-append \ 
    5959                    -DENABLE_GUILE=OFF \
    6060                    -DENABLE_PERL=OFF \
    6161                    -DENABLE_PYTHON=OFF \
     62                    -DENABLE_PYTHON3=OFF \
    6263                    -DENABLE_RUBY=OFF \
    6364                    -DENABLE_ASPELL=OFF \
    6465                    -DENABLE_MAN=ON
    variant perl description {Bindings for perl plugins} { 
    8788    depends_lib-append      path:bin/perl:perl5
    8889}
    8990
    90 variant python description {Bindings for python plugins} {
    91     configure.args-delete   -DENABLE_PYTHON=OFF
    92     configure.args-append   -DENABLE_PYTHON=ON
    93     depends_lib-append      path:bin/python:python27
     91variant python requires python27 description {Legacy variant} {}
    9492
    95     post-configure {
    96         reinplace -E "s|\(Python.framework\)|${frameworks_dir}/\\1|" ${worksrcpath}/src/plugins/python/CMakeFiles/python.dir/link.txt
     93set pythonBranch {}
     94
     95variant python27 description {Enable Python 2.7 bindings} conflicts python34 {
     96    depends_lib-append      port:python27
     97    set pythonBranch 2.7
     98}
     99
     100variant python34 description {Enable Python 3.4 bindings} conflicts python27 {
     101    depends_lib-append      port:python34
     102    set pythonBranch 3.4
     103    configure.args-replace  -DENABLE_PYTHON3=OFF -DENABLE_PYTHON3=ON
     104}
     105
     106if {[variant_isset python27] || [variant_isset python34]} {
     107    set pythonFramework ${frameworks_dir}/Python.framework/Versions/$pythonBranch
     108    configure.args-replace  -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
     109    configure.args-append   -DPYTHON_EXECUTABLE='${prefix}/bin/python$pythonBranch' \
     110                            -DPYTHON_INCLUDE_PATH='$pythonFramework/Headers' \
     111                            -DPYTHON_LIBRARY='$pythonFramework/Python'
     112}
     113
     114post-configure {
     115    set f ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
     116    if {[file exists $patchFile]} {
     117        reinplace -E "s| \(Python\.framework\)| ${frameworks_dir}/\\1|g" $f
     118        reinplace -E s|-Wl,-stack_size,1000000|| $f
    97119    }
    98120}
    99121