40 | | #variant docs description {build documentation} { |
41 | | # configure.args-delete --disable-latex \ |
42 | | # --disable-dot \ |
43 | | # --disable-ldas-documentation \ |
44 | | # configure.args-append --docdir=${prefix}/share/doc/ldas-tools |
45 | | #} |
46 | | |
47 | | #------------------------------------------------------------------------ |
48 | | # Python variants |
49 | | #------------------------------------------------------------------------ |
50 | | set pythons_suffixes {27 34} |
51 | | |
52 | | set pythons_ports {} |
53 | | foreach s ${pythons_suffixes} { |
54 | | lappend pythons_ports python${s} |
55 | | } |
56 | | |
57 | | foreach s ${pythons_suffixes} { |
58 | | set p python${s} |
59 | | set v [string index ${s} 0].[string index ${s} 1] |
60 | | set i [lsearch -exact ${pythons_ports} ${p}] |
61 | | set c [lreplace ${pythons_ports} ${i} ${i}] |
62 | | set d ${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v} |
63 | | eval [subst { |
64 | | variant ${p} description "Enable SWIG Python interface for Python ${v}" conflicts ${c} { |
65 | | |
66 | | depends_build-append port:swig-python |
67 | | depends_lib-append port:${p} port:py${s}-numpy |
68 | | configure.args-strsed s/--disable-python/--enable-python/ |
69 | | destroot.args-append pythondir="${d}" pyexecdir="${d}" |
70 | | |
71 | | } |
72 | | }] |
73 | | } |
74 | | |
77 | | livecheck.regex {ldas-tools-filters-(\d+(?:\.\d+)*).tar.gz} |
| 43 | livecheck.regex {ldas-tools-ldasgen-(\d+(?:\.\d+)*).tar.gz} |
| 44 | |
| 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} |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | livecheck.type none |
| 86 | } |
| 87 | } |