# $Id: Portfile 118590 2014-04-05 10:17:05Z ram@macports.org $

PortSystem    1.0
PortGroup     active_variants 1.1
PortGroup     conflicts_build 1.0

name          lalxml
version       1.1.10
revision      3
categories    science
platforms     darwin
maintainers   ram
license       GPL

description   LSC Algorithm Library - XML
long_description \
  LIGO Scientific Collaboration Algorithm Library - XML containing \
  routines for accessing XML files using libxml2.

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

checksums     rmd160 24bb89445bdfd2198d506e2384ecaa553f1532ba \
              sha256 b36f06bc97cab401edcf6da1186eb60cfa9c66335ef310652778f05d8327be3b

patchfiles    0001-SWIG-make-wrappings-compatible-with-SWIG-v3.0.0.patch
patch.pre_args -p2

depends_build-append port:pkgconfig

depends_lib   port:python27 \
              port:lal \
              port:libxml2 \
              port:gsl

configure.python ${prefix}/bin/python2.7
configure.args --mandir=${prefix}/share/man \
               --disable-silent-rules \
               --disable-gcc-flags \
               --disable-debug

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}"

# FIXME: fails to build if previous version active
conflicts_build ${name}

variant swig_python description {Build python SWIG bindings} {
  require_active_variants lal swig_python
  depends_build-append  port:swig-python
  depends_lib-append    port:py27-numpy
  configure.args-append --enable-swig-python
}

default_variants +swig_python

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