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

---
 science/ldas-tools-framecpp/Portfile | 91 ++++++++++++++++++++----------------
 1 file changed, 52 insertions(+), 39 deletions(-)

diff --git a/science/ldas-tools-framecpp/Portfile b/science/ldas-tools-framecpp/Portfile
index c2eab77..cdbb82b 100644
--- a/science/ldas-tools-framecpp/Portfile
+++ b/science/ldas-tools-framecpp/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-framecpp
-version       2.5.1
+version       2.5.4
 categories    science
 platforms     darwin
 maintainers   ligo.org:ed.maros
@@ -15,15 +15,16 @@ long_description ${description}
 homepage      https://wiki.ligo.org/DASWG/LDASTools
 master_sites  http://software.ligo.org/lscsoft/source/
 
-checksums     rmd160 d0e083e0d001279d16478ffac529e37bdd3250e7 \
-              sha256 bb3d6111a567c785947df8fe0e935bfdbc551f0e2565cc2ac964b4fbaf1a6f82
+checksums     rmd160 53853b72a57db344437b8ab7b8d199c6cee91495 \
+              sha256 54783c5ae235b8016adbc02d95aedcbd5f1256ae3b74b27ae516d9dee3cbe11b
 
 depends_lib    port:ldas-tools-al \
                port:openssl \
                port:zlib \
                port:bzip2
 
-configure.args --disable-silent-rules \
+configure.args  --disable-warnings-as-errors \
+               --disable-silent-rules \
                --with-optimization=high \
                --disable-tcl \
                --disable-python \
@@ -31,7 +32,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
 }
 
@@ -40,41 +41,53 @@ 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-(\d+(?:\.\d+)*).tar.gz}
+livecheck.regex  {ldas-tools-framecpp-(\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