Commits

Duncan Macleod authored and Adam Mercer committed 63174f076eb
lalinspiral: reworked configure args and dependencies
No tags

science/lalinspiral/Portfile

Modified
1 1 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 2
3 3 PortSystem 1.0
4 4
5 5 name lalinspiral
6 6 version 1.8.0
7 +revision 1
7 8
8 9 description LSC Algorithm Library - Inspiral
9 10 long_description \
10 11 LIGO Scientific Collaboration Algorithm Library - Inspiral, containing \
11 12 routines for compact binary gravitational wave data analysis.
12 13
13 14 checksums rmd160 550819ffcb0813d9c8e131387b9e77467b7d5f66 \
14 15 sha256 c031d878e7c06bf2c0b8ab56f6cf3a29ced4a6e85e3daab42a4101d27999b2ed \
15 16 size 919300
16 17
17 18 depends_lib port:lal \
18 19 port:lalframe \
19 20 port:lalmetaio \
20 21 port:lalsimulation \
21 22 port:gsl \
22 23 port:metaio
23 24
25 +# add Python dependencies for python subports
26 +if {[string match "py*" ${subport}]} {
27 + set numbers [regexp -all -inline -- {[0-9]+} ${subport}]
28 + set v [lindex ${numbers} 0]
29 + # python, C-library port, and numpy are automatically added below
30 + depends_lib port:py${v}-lal port:py${v}-lalmetaio port:py${v}-lalsimulation \
31 + port:py${v}-lalframe port:py${v}-lalburst port:py${v}-lscsoft-glue
32 + revision 1
33 +}
34 +
35 +# add Octave dependencies for octave subports
36 +if {[string match "octave-*" ${subport}]} {
37 + # octave, and C-library port are automatically added below
38 + depends_lib port:octave-lal port:octave-lalframe port:octave-lalmetaio \
39 + port:octave-lalsimulation
40 + revision 1
41 +}
42 +
24 43 ###############################################################################
25 44 ### Everything below this line is common to all LALSuite ports. ###############
26 45 ###############################################################################
27 46
28 47 categories science
29 48 platforms darwin
30 49 maintainers {ram @skymoo} {aronnax @lpsinger}
31 50 license GPL-2+
32 51
33 52 # The GPL and OpenSSL licenses conflict with each other, and our build
38 57 # our scripts.
39 58 license_noconflict openssl
40 59
41 60 homepage https://wiki.ligo.org/Computing/DASWG/LALSuite
42 61 master_sites http://software.ligo.org/lscsoft/source/lalsuite
43 62 use_xz yes
44 63
45 64 depends_build-append \
46 65 port:pkgconfig \
47 66 port:swig \
48 - port:python27
49 67
50 68 # Choose a compiler that supports OpenMP.
51 69 compiler.whitelist macports-clang-6.0 macports-clang-5.0 macports-clang-4.0 macports-clang-7.0 macports-clang-3.9
52 70 compiler.fallback macports-clang-6.0
53 71
54 -set default_pythonarg PYTHON=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
55 72 configure.args-append \
56 73 --mandir=${prefix}/share/man \
57 74 --disable-silent-rules \
58 75 --disable-gcc-flags \
59 76 --enable-swig-iface \
60 - --disable-python \
61 - ${default_pythonarg}
77 + --disable-swig-octave \
78 + --disable-swig-python \
79 + --disable-python
62 80
63 81 test.run yes
64 82 test.target check
65 83
66 84 # Create subports for each supported Python version
67 85 foreach v {27 35 36 37} {
68 86 subport py${v}-${name} {
69 87 set pythonversion [string range ${v} 0 end-1].[string index ${v} end]
70 88 set pythonhome \
71 89 "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
72 90 set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
73 91
74 92 categories-prepend python
75 93 description Python ${pythonversion} bindings for ${description}
76 94 long_description ${long_description} This package provides Python \
77 95 ${pythonversion} bindings, modules, and scripts.
78 96
97 +
79 98 depends_build-append port:swig-python
80 - depends_build-replace port:python27 port:python${v}
81 - depends_lib-strsed g/port:lal/port:py${v}-lal/
82 - depends_lib-append port:${name} port:py${v}-numpy
99 + depends_lib-prepend port:python${v} port:${name} port:py${v}-numpy
83 100
84 - configure.args-replace ${default_pythonarg} PYTHON=${pythonhome}/bin/python${pythonversion}
85 - configure.args-replace --disable-python --enable-python
86 - configure.args-append --enable-swig-python
101 + configure.args-append PYTHON=${pythonhome}/bin/python${pythonversion}
102 + configure.args-replace --disable-python --enable-python
103 + configure.args-replace --disable-swig-python --enable-swig-python
87 104
88 105 destroot.args-append pythondir="${pythondir}" \
89 106 pyexecdir="${pythondir}" \
90 107 pkgpythondir="${pythondir}/${name}" \
91 108 pkgpyexecdir="${pythondir}/${name}" \
92 109 prefix="${pythonhome}"
93 110
94 111 # Only install SWIG bindings, Python libraries, and Python scripts
95 112 destroot {
96 113 command_exec destroot "" "-C swig"
117 134 set pythonhome \
118 135 "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
119 136 set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
120 137
121 138 categories-prepend octave
122 139 description Octave ${pythonversion} bindings for ${description}
123 140 long_description ${long_description} This package provides Octave \
124 141 bindings, modules, and scripts.
125 142
126 143 depends_build-append port:swig-octave
127 - depends_lib-strsed g/port:lal/port:octave-lal/
128 - depends_lib-append port:${name} port:octave
144 + depends_lib-prepend port:octave port:${name}
129 145
130 - configure.args-append --enable-swig-octave
146 + configure.args-replace --disable-swig-octave --enable-swig-octave
131 147
132 148 # Only install SWIG bindings, Python libraries, and Python scripts
133 149 destroot {
134 150 command_exec destroot "" "-C swig"
135 151 }
136 152
137 153 post-destroot {
138 154 # Remove Octave include directory
139 155 # (duplicate of SWIG headers in ${prefix}/include)
140 156 file delete -force ${destroot}${prefix}/include

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut