source: trunk/dports/science/lalstochastic/Portfile

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