| 66 | variant python requires python27 description {Compatibility variant, requires +python27} {} |
| 67 | |
| 68 | set pythons_suffixes {27 34 35} |
| 69 | |
| 70 | set pythons_ports {} |
| 71 | foreach s ${pythons_suffixes} { |
| 72 | lappend pythons_ports python${s} |
| 73 | } |
| 74 | |
| 75 | foreach 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. |
| 96 | post-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 | |