Ticket #37048: Portfile-weechat.diff

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

    old new  
    5858                    -DENABLE_GUILE=OFF \
    5959                    -DENABLE_PERL=OFF \
    6060                    -DENABLE_PYTHON=OFF \
     61                    -DENABLE_PYTHON3=OFF \
    6162                    -DENABLE_RUBY=OFF \
    6263                    -DENABLE_ASPELL=OFF \
    6364                    -DENABLE_MAN=ON
    6465
     66variant python requires python27 description {Compatibility variant, requires +python27} {}
     67
     68set pythons_suffixes {27 34 35}
     69
     70set pythons_ports {}
     71foreach s ${pythons_suffixes} {
     72    lappend pythons_ports python${s}
     73}
     74
     75foreach s ${pythons_suffixes} {
     76    set p python${s}
     77    set v [string index ${s} 0].[string index ${s} 1]
     78    set i [lsearch -exact ${pythons_ports} ${p}]
     79    set c [lreplace ${pythons_ports} ${i} ${i}]
     80    set t ""
     81    set r [regexp {([3])} [string index ${s} 0] t]
     82    eval [subst {
     83        variant ${p} description "Bindings for python ${v} plugins" conflicts ${c} {
     84            configure.args-delete   -DENABLE_PYTHON${t}=OFF
     85            configure.args-append   -DENABLE_PYTHON=ON
     86            configure.args-append   -DENABLE_PYTHON${t}=ON
     87            configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python${v}
     88            configure.args-append   -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/${v}/Headers
     89            configure.args-append   -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/${v}/Python
     90            depends_lib-append      path:bin/python:${p}
     91        }
     92    }]
     93}
     94
     95# TODO: Ideally this should go inside its corresponding python variant.
     96post-configure {
     97    set patchfile ${worksrcpath}/src/plugins/python/CMakeFiles/python.dir/link.txt
     98
     99    if {[file exists ${patchfile}]} {
     100        reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
     101        reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
     102    }
     103}
     104
    65105variant aspell description {Support for aspell} {
    66106    configure.args-delete   -DENABLE_ASPELL=OFF
    67107    configure.args-append   -DENABLE_ASPELL=ON
     
    86126    depends_lib-append      path:bin/perl:perl5
    87127}
    88128
    89 variant python description {Bindings for python plugins} {
    90     configure.args-delete   -DENABLE_PYTHON=OFF
    91     configure.args-append   -DENABLE_PYTHON=ON
    92     depends_lib-append      path:bin/python:python27
    93 
    94     post-configure {
    95         reinplace -E "s|\(Python.framework\)|${frameworks_dir}/\\1|" ${worksrcpath}/src/plugins/python/CMakeFiles/python.dir/link.txt
    96     }
    97 }
    98 
    99129variant ruby description {Bindings for ruby plugins} {
    100130    configure.args-delete   -DENABLE_RUBY=OFF
    101131    configure.args-append   -DENABLE_RUBY=ON