# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           compilers 1.0

name                lalapps
version             10.0.1
revision            0

categories          science python
maintainers         nomaintainer
license             GPL-2+

description         LSC Algorithm Library Applications
long_description    LALApps is a set of codes for gravitational wave data analysis, \
                    against the LSC Algorithm Library.

homepage            https://wiki.ligo.org/Computing/DASWG/LALSuite
master_sites        https://software.igwn.org/lscsoft/source/lalsuite/
use_xz              yes

checksums           rmd160  259ca7cf79c9b3e6b346e60af43caca241c68434 \
                    sha256  f6ec439087f7eec65a830a7af99fb040904287c9cf1e540acbed25146c08116a \
                    size    2288552

set v               312
set pythonversion   [string index ${v} 0].[string range ${v} 1 end]
set pythonhome      "${frameworks_dir}/Python.framework/Versions/${pythonversion}"
set pythondir       "${pythonhome}/lib/python${pythonversion}/site-packages"

depends_build-append \
                    port:pkgconfig

# Choose a compiler that supports OpenMP.
compiler.openmp_version 2.5

depends_lib-append  port:gsl \
                    port:fftw-3 \
                    port:fftw-3-single \
                    port:libframe \
                    port:metaio \
                    port:lal port:py${v}-lal \
                    port:lalframe port:py${v}-lalframe \
                    port:lalmetaio port:py${v}-lalmetaio \
                    port:lalsimulation port:py${v}-lalsimulation \
                    port:lalburst port:py${v}-lalburst \
                    port:lalinspiral port:py${v}-lalinspiral \
                    port:lalpulsar port:py${v}-lalpulsar \
                    port:lalinference port:py${v}-lalinference \
                    port:py${v}-lscsoft-glue \
                    port:python${v} \
                    port:py${v}-numpy \
                    port:py${v}-h5py

configure.args      --mandir=${prefix}/share/man \
                    --disable-silent-rules \
                    --disable-gcc-flags \
                    --disable-help2man \
                    PYTHON=${pythonhome}/bin/python${pythonversion}

test.run            yes
test.target         check

destroot.args-append \
                    pythondir="${pythondir}" \
                    pyexecdir="${pythondir}" \
                    pkgpythondir="${pythondir}/${name}" \
                    pkgpyexecdir="${pythondir}/${name}"

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}
