Ticket #37048: Portfile-weechat.3.diff

File Portfile-weechat.3.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
     69set pythons_suffixes {27 34 35}
     70
     71set pythons_ports {}
     72foreach s ${pythons_suffixes} {
     73    lappend pythons_ports python${s}
     74}
     75
     76foreach s ${pythons_suffixes} {
     77    set p python${s}
     78    set v [string index ${s} 0].[string index ${s} 1]
     79    set i [lsearch -exact ${pythons_ports} ${p}]
     80    set c [lreplace ${pythons_ports} ${i} ${i}]
     81    # set ${t} to '3' if ${s} ends with '3'; t must be set beforehand, though...
     82    set t ""
     83    regexp {(3$)} ${s} t
     84    eval [subst {
     85        variant ${p} description "Bindings for python ${v} plugins" conflicts ${c} {
     86            configure.args-delete   -DENABLE_PYTHON=OFF
     87            configure.args-delete   -DENABLE_PYTHON${t}=OFF
     88            configure.args-append   -DENABLE_PYTHON=ON
     89            configure.args-append   -DENABLE_PYTHON${t}=ON
     90            configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python${v}
     91            configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers
     92            configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/${v}/Python
     93            depends_lib-append      port:${p}
     94        }
     95    }]
     96}
     97
     98# TODO: Ideally this should go inside its corresponding python variant.
     99post-configure {
     100    set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
     101
     102    if {[file exists ${patchfile}]} {
     103        reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
     104        reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
     105    }
     106}
     107
    66108variant aspell description {Support for aspell} {
    67109    configure.args-delete   -DENABLE_ASPELL=OFF
    68110    configure.args-append   -DENABLE_ASPELL=ON
     
    87129    depends_lib-append      path:bin/perl:perl5
    88130}
    89131
    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 
    100132variant ruby description {Bindings for ruby plugins} {
    101133    configure.args-delete   -DENABLE_RUBY=OFF
    102134    configure.args-append   -DENABLE_RUBY=ON