Ticket #37048: Portfile-weechat.5.diff

File Portfile-weechat.5.diff, 2.8 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 {
     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 {
     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
     89post-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
    66101variant aspell description {Support for aspell} {
    67102    configure.args-delete   -DENABLE_ASPELL=OFF
    68103    configure.args-append   -DENABLE_ASPELL=ON
     
    87122    depends_lib-append      path:bin/perl:perl5
    88123}
    89124
    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 
    100125variant ruby description {Bindings for ruby plugins} {
    101126    configure.args-delete   -DENABLE_RUBY=OFF
    102127    configure.args-append   -DENABLE_RUBY=ON