source: trunk/dports/science/lalinference/Portfile

Last change on this file was 151388, checked in by ram@…, 16 months ago

science/lalinference: move use_autoreconf after deps

otherwise depends_build overwrites the dependencies on the autotools and
the build fails as the autotools are missing.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1# $Id: Portfile 151388 2016-08-14 16:11:30Z ryandesign@macports.org $
2
3PortSystem    1.0
4PortGroup     active_variants 1.1
5
6name          lalinference
7version       1.7.0
8categories    science
9platforms     darwin
10maintainers   ram aronnax
11license       GPL-2+
12
13description   LSC Algorithm Library - Inference
14long_description \
15  LIGO Scientific Collaboration Algorithm Library - Inference containing \
16  routines for Bayesian inference 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 c2e41deac545cd4c1b8700b2fc1255627001798e \
23              sha256 5d8568279cf31698b1615e1a9cfac25b828853414d461cdedc6dc8e5579f198f
24
25depends_build port:pkgconfig
26
27depends_lib   port:gsl \
28              port:libomp \
29              port:metaio \
30              port:libxml2 \
31              port:lal \
32              port:lalframe \
33              port:lalmetaio \
34              port:lalxml \
35              port:lalsimulation \
36              port:lalburst \
37              port:lalinspiral \
38              port:lalpulsar \
39              port:healpix-c \
40              port:ligo-lvalert
41
42# Add missing HAVE_PYTHON conditional.
43# Fixed on master; remove upon next release of LALSuite.
44use_autoreconf yes
45patchfiles     patch-python_tiger_Makefile.am.diff
46
47# Choose a compiler that supports OpenMP.
48compiler.whitelist macports-clang-3.8 macports-clang-3.7 macports-clang-3.9
49compiler.fallback  macports-clang-3.8
50
51configure.args --mandir=${prefix}/share/man \
52               --disable-silent-rules \
53               --disable-gcc-flags \
54               --disable-debug \
55               --enable-openmp \
56               PYTHON=false
57
58use_parallel_build yes
59
60pre-activate {
61  # lalinference now contains files that used to be provided by lalapps
62  if {![catch {set installed [lindex [registry_active lalapps] 0]}]} {
63    set _version [lindex $installed 1]
64    if {[vercmp $_version 6.19.0] < 0} {
65      # lalapps used to install some files now provided by lalinference in versions < 6.19.0
66      registry_deactivate_composite lalapps "" [list ports_nodepcheck 1]
67    }
68  }
69}
70
71# lalxml is currently enabled by default but may change in the future
72#variant lalxml description {Build with LALXML support} {
73#  require_active_variants lalpulsar lalxml
74#  depends_lib-append    port:libxml2 \
75#                        port:lalxml
76#  configure.args-append --enable-lalxml
77#}
78
79livecheck.type   regex
80livecheck.url    ${master_sites}
81livecheck.regex  {lalinference-(\d+(?:\.\d+)*).tar.xz}
82
83# Create subports for each supported Python version
84foreach v {27 34 35} {
85  subport py${v}-${name} {
86    set pythonversion     [string range ${v} 0 end-1].[string index ${v} end]
87    set pythonhome \
88      "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
89    set pythondir "${pythonhome}/lib/python${pythonversion}/site-packages"
90
91    categories-prepend    python
92    description           Python ${pythonversion} bindings for ${description}
93    long_description      ${long_description} This package provides Python \
94                          ${pythonversion} bindings, modules, and scripts.
95
96    depends_build-append  port:swig-python
97    depends_lib-strsed    g/port:lal/port:py${v}-lal/
98    depends_lib-append    port:${name}
99    depends_lib-prepend   port:python${v} port:py${v}-numpy
100    depends_run-append    port:py${v}-healpy
101
102    configure.args-delete PYTHON=false
103    configure.args-append PYTHON=${pythonhome}/bin/python${pythonversion} --enable-swig-python
104    configure.args-append SWIG_CPPFLAGS="-I${pythonhome}/include"
105
106    destroot.args-append  pythondir="${pythondir}" \
107                          pyexecdir="${pythondir}" \
108                          pkgpythondir="${pythondir}/${name}" \
109                          pkgpyexecdir="${pythondir}/${name}" \
110                          prefix="${pythonhome}"
111
112    # Only install SWIG bindings, Python libraries, and Python scripts
113    destroot {
114      command_exec destroot "" "-C swig"
115      command_exec destroot "" "-C python"
116    }
117
118    post-destroot {
119      if {${subport} eq "py27-${name}"} {
120        foreach script [glob -tails -nocomplain -directory ${destroot}${pythonhome}/bin *] {
121          file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${pythonversion}/bin/${script}
122        }
123      }
124    }
125
126    livecheck.type        none
127  }
128}
Note: See TracBrowser for help on using the repository browser.