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