Ticket #37048: Portfile-weechat.4.diff

File Portfile-weechat.4.diff, 3.7 KB (added by harciga, 9 years ago)
  • Portfile

    old new  
    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
    6566
     67variant python requires python27 description {Compatibility variant, requires +python27} {}
     68
     69variant python27 description "Bindings for python 2.7 plugins" conflicts python34 python35 {
     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
     77variant python34 description "Bindings for python 3.4 plugins" conflicts python27 python35 {
     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    ui_warn "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
     89variant python35 description "Bindings for python 3.5 plugins" conflicts python27 python34 {
     90    configure.args-replace  -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
     91    configure.args-replace  -DENABLE_PYTHON3=OFF -DENABLE_PYTHON3=ON
     92    configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.5
     93    configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/3.5/Headers
     94    configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/3.5/Python
     95    depends_lib-append      port:python35
     96
     97    # From http://weechat.org/files/doc/stable/weechat_user.en.html#dependencies
     98    ui_warn "Recommended Python version is 2.7 (all scripts run fine with version 2.7, but not with versions ≤ 2.6 or ≥ 3.0)."
     99}
     100
     101post-configure {
     102    if {[variant_isset python27] || [variant_isset python34] || [variant_isset python35]} {
     103        set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
     104
     105        reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
     106
     107        if {[variant_isset python34] || [variant_isset python35]} {
     108            reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
     109        }
     110    }
     111}
     112
    66113variant aspell description {Support for aspell} {
    67114    configure.args-delete   -DENABLE_ASPELL=OFF
    68115    configure.args-append   -DENABLE_ASPELL=ON
     
    87134    depends_lib-append      path:bin/perl:perl5
    88135}
    89136
    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
    94 
    95     post-configure {
    96         reinplace -E "s|\(Python.framework\)|${frameworks_dir}/\\1|" ${worksrcpath}/src/plugins/python/CMakeFiles/python.dir/link.txt
    97     }
    98 }
    99 
    100137variant ruby description {Bindings for ruby plugins} {
    101138    configure.args-delete   -DENABLE_RUBY=OFF
    102139    configure.args-append   -DENABLE_RUBY=ON