From b22163701f966cac3fadf306e21aa5ff4caf88c6 Mon Sep 17 00:00:00 2001
From: "ed.maros" <ed.maros@ligo.org>
Date: Tue, 1 Nov 2016 16:37:42 -0700
Subject: [PATCH] Updated for version 2.5.5

---
 science/ldas-tools-al/Portfile | 100 ++++++++++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 41 deletions(-)

diff --git a/science/ldas-tools-al/Portfile b/science/ldas-tools-al/Portfile
index ac4cacd..1c024f8 100644
--- a/science/ldas-tools-al/Portfile
+++ b/science/ldas-tools-al/Portfile
@@ -1,29 +1,32 @@
-# $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-al
-version       2.5.0
+version       2.5.5
 categories    science
 platforms     darwin
 maintainers   ligo.org:ed.maros
 
-description   Suite of LDAS tools
+description   LDAS Tools Abstraction library
 long_description ${description}
 
 homepage      https://wiki.ligo.org/DASWG/LDASTools
 master_sites  http://software.ligo.org/lscsoft/source/
 
-checksums     rmd160 65d06067bf42270eadc5704bc1e1985cef89b9db \
-              sha256 97c907802ad2f3766be817720de93aafdec9ea5386e0ff6550659e435e5c0d73
+checksums     rmd160 fc50f9c7911463fabd79f55e59fbcc8519bd45b1 \
+              sha256 5583e511bd680a43023b1d9a1c05d3e0c11ac70624032e8c918bdb47dd7a4b8e
 
-depends_lib    port:openssl \
+depends_lib    port:lib/libssl.dylib:openssl \
                port:zlib \
                port:bzip2 \
                port:flex
 
-configure.args --disable-silent-rules \
+
+configure.args PYTHON=false \
+               --disable-warnings-as-errors \
+               --disable-silent-rules \
                --with-optimization=high \
                --disable-tcl \
                --disable-python \
@@ -31,7 +34,9 @@ configure.args --disable-silent-rules \
                --without-dot \
                --disable-latex
 
-if {${os.major} < 13} {
+#------------------------------------------------------------------------
+
+if {${configure.cxx_stdlib} eq "libstdc++" } {
     configure.args-append --disable-cxx11
 }
 
@@ -51,41 +56,54 @@ pre-activate {
   }
 }
 
-#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-al-(\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}"
+
+    build.dir                 ${worksrcpath}/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