# $Id: Portfile 117167 2014-02-18 00:04:43Z ram@macports.org $

PortSystem    1.0

name          gstlal-calibration
version       0.1.1
categories    science
platforms     darwin
maintainers   ram
license       GPL

description   GStreamer elements for onlin GW data calibration
long_description \
  This package contains the plugins and shared libraries required to \
  run the online gstlal gravitational-wave calibration software.

homepage      https://www.lsc-group.phys.uwm.edu/daswg/projects/gstlal.html
master_sites  http://www.lsc-group.phys.uwm.edu/daswg/download/software/source/

checksums     rmd160 52e70c6f678099a5d6572da1ccf64925a0b8d5e1 \
              sha256 f71b84a7971d486fa581614e7cb5ef774378f906e1b79732fc3a1e26fe053c31

depends_build port:pkgconfig

depends_lib   port:gstlal \
              port:python27 \
              port:fftw-3 \
              port:glue \
              port:pylal \
              port:gstreamer010 \
              port:gstreamer010-gst-plugins-base \
              port:gstreamer010-gst-plugins-good \
              port:py27-gst-python \
              port:py27-gobject \
              port:py27-numpy \
              port:py27-scipy \
              port:lal \
              port:lalmetaio

set python_prefix ${frameworks_dir}/Python.framework/Versions/2.7
configure.pkg_config_path ${python_prefix}/lib/pkgconfig
configure.python ${prefix}/bin/python2.7

use_parallel_build yes

set pythondir "${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages"
destroot.args-append \
              pythondir="${pythondir}" \
              pyexecdir="${pythondir}" \
              pkgpythondir="${pythondir}/${name}" \
              pkgpyexecdir="${pythondir}/${name}"

pre-activate {
  # gstlal-calibration now contains files that used to be provided by gstlal-ugly
  if {![catch {set installed [lindex [registry_active gstlal-ugly] 0]}]} {
    set _version [lindex $installed 1]
    if {[vercmp $_version 0.6.0] < 0} {
      # gstlal-ugly used to install some files now provided by gstlal-calibration in versions < 0.6.0
      registry_deactivate_composite gstlal-ugly "" [list ports_nodepcheck 1]
    }
  }
}

livecheck.type   regex
livecheck.url    ${master_sites}
livecheck.regex  {gstlal-calibration-(\d+(?:\.\d+)*).tar.gz}
