source: trunk/dports/science/lalpulsar/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.4 KB
Line 
1# $Id: Portfile 151366 2016-08-13 15:36:28Z ryandesign@macports.org $
2
3PortSystem    1.0
4
5name          lalpulsar
6version       1.14.0
7categories    science
8platforms     darwin
9maintainers   ram aronnax
10license       GPL-2+
11
12description   LSC Algorithm Library - Pulsar
13long_description \
14  LIGO Scientific Collaboration Algorithm Library - Pulsar containing \
15  routines for continuous gravitatin wave gravitational data analysis.
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 f04d9e533f8988f0ce689210b555631f0c93f245 \
22              sha256 f79f10b4052ac74fcbaab73d68e5cd3083b7d56862bed1ecd2978f23c704d274
23
24depends_build port:pkgconfig
25
26depends_lib   port:gsl \
27              port:libomp \
28              port:libxml2 \
29              port:lal \
30              port:lalxml
31
32# Choose a compiler that supports OpenMP.
33compiler.whitelist macports-clang-3.8 macports-clang-3.7 macports-clang-3.9
34compiler.fallback  macports-clang-3.8
35
36configure.args --mandir=${prefix}/share/man \
37               --disable-silent-rules \
38               --disable-gcc-flags \
39               --disable-debug \
40               --enable-openmp \
41               PYTHON=false
42
43use_parallel_build yes
44
45# lalxml is currently enabled by default but may change in the future
46#variant lalxml description {Build with LALXML support} {
47#  if {[variant_isset swig_python]} {
48#    require_active_variants lalxml swig_python
49#  }
50#  depends_lib-append   port:libxml2 \
51#                       port:lalxml
52#  configure.args-append --enable-lalxml
53#}
54
55livecheck.type   regex
56livecheck.url    ${master_sites}
57livecheck.regex  {lalpulsar-(\d+(?:\.\d+)*).tar.xz}
58
59# Create subports for each supported Python version
60foreach v {27 34 35} {
61  subport py${v}-${name} {
62    set pythonversion     [string range ${v} 0 end-1].[string index ${v} end]
63    set pythonhome \
64      "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
65    set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
66
67    categories-prepend    python
68    description           Python ${pythonversion} bindings for ${description}
69    long_description      ${long_description} This package provides Python \
70                          ${pythonversion} bindings, modules, and scripts.
71
72    depends_build-append  port:swig-python
73    depends_lib-strsed    g/port:lal/port:py${v}-lal/
74    depends_lib-append    port:${name}
75    depends_lib-prepend   port:python${v} port:py${v}-numpy
76
77    configure.args-delete PYTHON=false
78    configure.args-append PYTHON=${pythonhome}/bin/python${pythonversion} --enable-swig-python
79    configure.args-append SWIG_CPPFLAGS="-I${pythonhome}/include"
80
81    destroot.args-append  pythondir="${pythondir}" \
82                          pyexecdir="${pythondir}" \
83                          pkgpythondir="${pythondir}/${name}" \
84                          pkgpyexecdir="${pythondir}/${name}" \
85                          prefix="${pythonhome}"
86
87    # Only install SWIG bindings, Python libraries, and Python scripts
88    destroot {
89      command_exec destroot "" "-C swig"
90      command_exec destroot "" "-C python"
91    }
92
93    post-destroot {
94      if {${subport} eq "py27-${name}"} {
95        foreach script [glob -tails -nocomplain -directory ${destroot}${pythonhome}/bin *] {
96          file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${pythonversion}/bin/${script}
97        }
98      }
99    }
100
101    livecheck.type        none
102  }
103}
Note: See TracBrowser for help on using the repository browser.