From 7df883f4f3e3d1987f426c348acce8de88487a4a Mon Sep 17 00:00:00 2001
From: "ed.maros" <ed.maros@ligo.org>
Date: Tue, 1 Nov 2016 17:09:41 -0700
Subject: [PATCH] Updated to source distribution 2.5.4

---
 science/ldas-tools-ldasgen/Portfile | 94 ++++++++++++++++++++-----------------
 1 file changed, 52 insertions(+), 42 deletions(-)

diff --git a/science/ldas-tools-ldasgen/Portfile b/science/ldas-tools-ldasgen/Portfile
index 2031691..f2050a3 100644
--- a/science/ldas-tools-ldasgen/Portfile
+++ b/science/ldas-tools-ldasgen/Portfile
@@ -1,10 +1,10 @@
-# $Id$
+# -*- 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     compiler_blacklist_versions 1.0
 
 name          ldas-tools-ldasgen
-version       2.5.0
+version       2.5.4
 categories    science
 platforms     darwin
 maintainers   ligo.org:ed.maros
@@ -15,12 +15,13 @@ long_description ${description}
 homepage      https://wiki.ligo.org/DASWG/LDASTools
 master_sites  http://software.ligo.org/lscsoft/source/
 
-checksums     rmd160 96d30566e32cb0db1f0a2d2f7b88060533950793 \
-              sha256 2eedeea1be81c4fec29c501da3c18db52bb930663bd923b5735c5e64c720eb1d
+checksums     rmd160 b8f7600b992f599b183146732967582a942b4ad8 \
+              sha256 48b410aeb1b9718c5185c74fc9cba11c79da08f8bdc78a140db72b07a8ba099f
 
 depends_lib    port:ldas-tools-al
 
-configure.args --disable-silent-rules \
+configure.args --disable-warnings-as-errors \
+               --disable-silent-rules \
                --with-optimization=high \
                --disable-tcl \
                --disable-python \
@@ -28,7 +29,7 @@ configure.args --disable-silent-rules \
                --without-dot \
                --disable-latex
 
-if {${os.major} < 13} {
+if {${configure.cxx_stdlib} eq "libstdc++" } {
     configure.args-append --disable-cxx11
 }
 
@@ -37,41 +38,50 @@ compiler.blacklist-append {clang < 500.2.75} llvm-gcc-4.2 gcc-4.2
 
 use_parallel_build yes
 
-#variant docs description {build documentation} {
-#  configure.args-delete --disable-latex \
-#                        --disable-dot \
-#                        --disable-ldas-documentation \
-#  configure.args-append --docdir=${prefix}/share/doc/ldas-tools
-#}
-
-#------------------------------------------------------------------------
-# Python variants
-#------------------------------------------------------------------------
-set pythons_suffixes {27 34}
-
-set pythons_ports {}
-foreach s ${pythons_suffixes} {
-    lappend pythons_ports python${s}
-}
-
-foreach s ${pythons_suffixes} {
-    set p python${s}
-    set v [string index ${s} 0].[string index ${s} 1]
-    set i [lsearch -exact ${pythons_ports} ${p}]
-    set c [lreplace ${pythons_ports} ${i} ${i}]
-    set d ${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v}
-    eval [subst {
-        variant ${p} description "Enable SWIG Python interface for Python ${v}" conflicts ${c} {
-
-            depends_build-append    port:swig-python
-            depends_lib-append      port:${p} port:py${s}-numpy
-            configure.args-strsed   s/--disable-python/--enable-python/
-            destroot.args-append    pythondir="${d}" pyexecdir="${d}"
-
-        }
-    }]
-}
-
 livecheck.type   regex
 livecheck.url    ${master_sites}
-livecheck.regex  {ldas-tools-filters-(\d+(?:\.\d+)*).tar.gz}
+livecheck.regex  {ldas-tools-ldasgen-(\d+(?:\.\d+)*).tar.gz}
+
+#========================================================================
+# Create subports for each supported Python version
+#========================================================================
+foreach v {27} {
+  set python.version       ${v}
+  set python.branch        [string range ${python.version} 0 end-1].[string index ${python.version} end]
+  set python.bin           ${prefix}/bin/python${python.branch}
+  set python.prefix        ${frameworks_dir}/Python.framework/Versions/${python.branch}
+  set python.site_packages "${python.prefix}/lib/python${python.branch}/site-packages"
+  set python.pkgname       LDAStools
+
+  subport py${v}-${name} {
+    categories-prepend    python
+    description           Python ${python.version} bindings for ${description}
+    long_description      ${long_description} This package provides Python \
+                          ${python.version} bindings, modules, and scripts.
+
+    depends_build-append      port:swig-python
+    depends_lib-append        port:${name}
+    depends_lib-append        port:python${python.version}
+
+    configure.python          ${python.bin}
+    configure.args-replace    PYTHON=false PYTHON=${python.prefix}/bin/python${python.version}
+    configure.args-replace    --disable-python --enable-python
+    configure.args-append     SWIG_CPPFLAGS="-I${python.prefix}/include"
+
+    destroot.args-append      pythondir="${python.site_packages}" \
+                              pyexecdir="${python.site_packages}" \
+                              pkgpythondir="${python.site_packages}/${python.pkgname}" \
+                              pkgpyexecdir="${python.site_packages}/${python.pkgname}" \
+                              -C ${worksrcpath}/swig/python
+
+    post-destroot {
+      if {${subport} eq "py27-${name}"} {
+        foreach script [glob -tails -nocomplain -directory ${destroot}${python.prefix}/bin *] {
+          file link -symbolic ${destroot}${prefix}/bin/${script} ../Library/Frameworks/Python.framework/Versions/${python.version}/bin/${script}
+        }
+      }
+    }
+
+    livecheck.type        none
+  }
+}
-- 
2.10.1