source: trunk/dports/science/lal/Portfile

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