source: trunk/dports/science/lalinspiral/Portfile

Last change on this file was 151366, checked in by ram@…, 12 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.1 KB
Line 
1# $Id: Portfile 151366 2016-08-13 15:36:28Z ryandesign@macports.org $
2
3PortSystem    1.0
4
5name          lalinspiral
6version       1.7.5
7categories    science
8platforms     darwin
9maintainers   ram aronnax
10license       GPL-2+
11
12description   LSC Algorithm Library - Inspiral
13long_description \
14  LIGO Scientific Collaboration Algorithm Library - Inspiral, containing \
15  routines for compact binary gravitational wave data analysis.
16
17homepage      https://wiki.ligo.org/DASWG/LALSuite
18master_sites  http://software.ligo.org/lscsoft/source/lalsuite
19use_xz        yes
20
21checksums     rmd160 fc82fa51a3585b3218525f5f68bb8631b2e902f6 \
22              sha256 33a6d87d525c0881be77732ed9f74e4ce73921f952abdfcd4c8f36efd0d0a5c6
23
24depends_build port:pkgconfig
25
26depends_lib   port:lal \
27              port:lalframe \
28              port:lalmetaio \
29              port:lalsimulation \
30              port:gsl \
31              port:metaio
32
33# Choose a compiler that supports OpenMP.
34compiler.whitelist macports-clang-3.8 macports-clang-3.7 macports-clang-3.9
35compiler.fallback  macports-clang-3.8
36
37configure.args --mandir=${prefix}/share/man \
38               --disable-silent-rules \
39               --disable-gcc-flags \
40               --disable-debug \
41               PYTHON=false
42
43use_parallel_build yes
44
45livecheck.type   regex
46livecheck.url    ${master_sites}
47livecheck.regex  {lalinspiral-(\d+(?:\.\d+)*).tar.xz}
48
49# Create subports for each supported Python version
50foreach v {27 34 35} {
51  subport py${v}-${name} {
52    set pythonversion     [string range ${v} 0 end-1].[string index ${v} end]
53    set pythonhome \
54      "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
55    set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
56
57    categories-prepend    python
58    description           Python ${pythonversion} bindings for ${description}
59    long_description      ${long_description} This package provides Python \
60                          ${pythonversion} bindings, modules, and scripts.
61
62    depends_build-append  port:swig-python
63    depends_lib-strsed    g/port:lal/port:py${v}-lal/
64    depends_lib-append    port:${name}
65    depends_lib-prepend   port:python${v} port:py${v}-numpy
66
67    configure.args-delete PYTHON=false
68    configure.args-append PYTHON=${pythonhome}/bin/python${pythonversion} --enable-swig-python
69    configure.args-append SWIG_CPPFLAGS="-I${pythonhome}/include"
70
71    destroot.args-append  pythondir="${pythondir}" \
72                          pyexecdir="${pythondir}" \
73                          pkgpythondir="${pythondir}/${name}" \
74                          pkgpyexecdir="${pythondir}/${name}" \
75                          prefix="${pythonhome}"
76
77    # Only install SWIG bindings, Python libraries, and Python scripts
78    destroot {
79      command_exec destroot "" "-C swig"
80      command_exec destroot "" "-C python"
81    }
82
83    post-destroot {
84      if {${subport} eq "py27-${name}"} {
85        foreach script [glob -tails -nocomplain -directory ${destroot}${pythonhome}/bin *] {
86          file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${pythonversion}/bin/${script}
87        }
88      }
89    }
90
91    livecheck.type        none
92  }
93}
Note: See TracBrowser for help on using the repository browser.