Ticket #37048: Portfile-weechat.2.diff

File Portfile-weechat.2.diff, 2.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
     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 ""
     82    set r [regexp {([3])} [string index ${s} 0] t]
     83    eval [subst {
     84        variant ${p} description "Bindings for python ${v} plugins" conflicts ${c} {
     85            configure.args-delete   -DENABLE_PYTHON${t}=OFF
     86            configure.args-append   -DENABLE_PYTHON=ON
     87            configure.args-append   -DENABLE_PYTHON${t}=ON
     88            configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python${v}
     89            configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers
     90            configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/${v}/Python
     91            depends_lib-append      path:bin/python:${p}
     92        }
     93    }]
     94}
     95
     96# TODO: Ideally this should go inside its corresponding python variant.
     97post-configure {
     98    set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
     99
     100    if {[file exists ${patchfile}]} {
     101        reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
     102        reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
     103    }
     104}
     105
    66106variant aspell description {Support for aspell} {
    67107    configure.args-delete   -DENABLE_ASPELL=OFF
    68108    configure.args-append   -DENABLE_ASPELL=ON
     
    87127    depends_lib-append      path:bin/perl:perl5
    88128}
    89129
    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 
    100130variant ruby description {Bindings for ruby plugins} {
    101131    configure.args-delete   -DENABLE_RUBY=OFF
    102132    configure.args-append   -DENABLE_RUBY=ON