source: trunk/dports/science/laldetchar/Portfile

Last change on this file was 151366, checked in by ram@…, 13 months ago

science/*lal*: latest science run release

switch python bindings to subports
support multiple python versions
compile using an OpenMP enabled compiler
add aronnax as co-maintainer

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1# $Id: Portfile 151366 2016-08-13 15:36:28Z ryandesign@macports.org $
2
3PortSystem    1.0
4
5name          laldetchar
6version       0.3.3
7categories    science
8platforms     darwin
9maintainers   ram aronnax
10license       GPL-2+
11
12description   LSC Algorithm Library - DetChar
13long_description \
14  LIGO Scientific Collaboration Algorithm Library - DetChar, containing \
15  routines for detectory characterisation.
16
17homepage      https://www.lsc-group.phys.uwm.edu/daswg/projects/lalsuite.html
18master_sites  http://software.ligo.org/lscsoft/source/lalsuite
19use_xz        yes
20
21checksums     rmd160 a56bc7509952a9b24545acb1657811851ddd0c10 \
22              sha256 bc39ffb69d702a36b543f20b0764845f023ac471543cea7464fa40978f23c67a
23
24# See https://bugs.ligo.org/redmine/issues/4508
25patchfiles    0001-Make-laldetchar-idq-append-file-to-cache-a-Python-on.patch
26use_autoreconf yes
27
28depends_build port:pkgconfig
29
30depends_lib   port:lal \
31              port:lalframe \
32              port:lalmetaio \
33              port:lalsimulation \
34              port:lalburst \
35              port:gsl \
36              port:libframe \
37              port:metaio \
38              path:lib/pkgconfig/glib-2.0.pc:glib2
39
40# Choose a compiler that supports OpenMP.
41compiler.whitelist macports-clang-3.8 macports-clang-3.7 macports-clang-3.9
42compiler.fallback  macports-clang-3.8
43
44configure.args --mandir=${prefix}/share/man \
45               --disable-silent-rules \
46               --disable-gcc-flags \
47               --disable-debug \
48               PYTHON=false
49
50use_parallel_build yes
51
52livecheck.type   regex
53livecheck.url    ${master_sites}
54livecheck.regex  {laldetchar-(\d+(?:\.\d+)*).tar.xz}
55
56# Create subports for each supported Python version
57foreach v {27 34 35} {
58  subport py${v}-${name} {
59    set pythonversion     [string range ${v} 0 end-1].[string index ${v} end]
60    set pythonhome \
61      "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
62    set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
63
64    categories-prepend    python
65    description           Python ${pythonversion} bindings for ${description}
66    long_description      ${long_description} This package provides Python \
67                          ${pythonversion} bindings, modules, and scripts.
68
69    depends_build-append  port:swig-python
70    depends_lib-strsed    g/port:lal/port:py${v}-lal/
71    depends_lib-append    port:${name}
72    depends_lib-prepend   port:python${v} port:py${v}-numpy
73
74    configure.args-delete PYTHON=false
75    configure.args-append PYTHON=${pythonhome}/bin/python${pythonversion} --enable-swig-python
76    configure.args-append SWIG_CPPFLAGS="-I${pythonhome}/include"
77
78    destroot.args-append  pythondir="${pythondir}" \
79                          pyexecdir="${pythondir}" \
80                          pkgpythondir="${pythondir}/${name}" \
81                          pkgpyexecdir="${pythondir}/${name}" \
82                          prefix="${pythonhome}"
83
84    # Only install SWIG bindings, Python libraries, and Python scripts
85    destroot {
86      command_exec destroot "" "-C swig"
87      command_exec destroot "" "-C python"
88    }
89
90    post-destroot {
91      if {${subport} eq "py27-${name}"} {
92        foreach script [glob -tails -nocomplain -directory ${destroot}${pythonhome}/bin *] {
93          file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${pythonversion}/bin/${script}
94        }
95      }
96    }
97
98    livecheck.type        none
99  }
100}
Note: See TracBrowser for help on using the repository browser.