53 | | set pythons_suffixes {27 34} |
54 | | |
55 | | set pythons_ports {} |
56 | | foreach s ${pythons_suffixes} { |
57 | | lappend pythons_ports python${s} |
58 | | } |
59 | | |
60 | | foreach s ${pythons_suffixes} { |
61 | | set p python${s} |
62 | | set v [string index ${s} 0].[string index ${s} 1] |
63 | | set i [lsearch -exact ${pythons_ports} ${p}] |
64 | | set c [lreplace ${pythons_ports} ${i} ${i}] |
65 | | set d ${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v} |
66 | | eval [subst { |
67 | | variant ${p} description "Enable SWIG Python interface for Python ${v}" conflicts ${c} { |
68 | | |
69 | | depends_build-append port:swig-python |
70 | | depends_lib-append port:${p} port:py${s}-numpy |
71 | | configure.args-strsed s/--disable-python/--enable-python/ |
72 | | destroot.args-append pythondir="${d}" pyexecdir="${d}" |
73 | | |
74 | | } |
75 | | }] |
76 | | } |
80 | | livecheck.regex {ldas-tools-(\d+(?:\.\d+)*).tar.gz} |
| 49 | livecheck.regex {ldas-tools-framecpp-(\d+(?:\.\d+)*).tar.gz} |
| 50 | |
| 51 | #======================================================================== |
| 52 | # Create subports for each supported Python version |
| 53 | #======================================================================== |
| 54 | foreach v {27} { |
| 55 | set python.version ${v} |
| 56 | set python.branch [string range ${python.version} 0 end-1].[string index ${python.version} end] |
| 57 | set python.bin ${prefix}/bin/python${python.branch} |
| 58 | set python.prefix ${frameworks_dir}/Python.framework/Versions/${python.branch} |
| 59 | set python.site_packages "${python.prefix}/lib/python${python.branch}/site-packages" |
| 60 | set python.pkgname LDAStools |
| 61 | |
| 62 | subport py${v}-${name} { |
| 63 | categories-prepend python |
| 64 | description Python ${python.version} bindings for ${description} |
| 65 | long_description ${long_description} This package provides Python \ |
| 66 | ${python.version} bindings, modules, and scripts. |
| 67 | |
| 68 | depends_build-append port:swig-python |
| 69 | depends_lib-append port:${name} |
| 70 | depends_lib-append port:python${python.version} |
| 71 | |
| 72 | configure.python ${python.bin} |
| 73 | configure.args-replace PYTHON=false PYTHON=${python.prefix}/bin/python${python.version} |
| 74 | configure.args-replace --disable-python --enable-python |
| 75 | configure.args-append SWIG_CPPFLAGS="-I${python.prefix}/include" |
| 76 | |
| 77 | destroot.args-append pythondir="${python.site_packages}" \ |
| 78 | pyexecdir="${python.site_packages}" \ |
| 79 | pkgpythondir="${python.site_packages}/${python.pkgname}" \ |
| 80 | pkgpyexecdir="${python.site_packages}/${python.pkgname}" \ |
| 81 | -C ${worksrcpath}/swig/python |
| 82 | |
| 83 | post-destroot { |
| 84 | if {${subport} eq "py27-${name}"} { |
| 85 | foreach script [glob -tails -nocomplain -directory ${destroot}${python.prefix}/bin *] { |
| 86 | file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${python.version}/bin/${script} |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | livecheck.type none |
| 92 | } |
| 93 | } |