[141005] trunk/dports/_resources/port1.0/group

michaelld at macports.org michaelld at macports.org
Wed Oct 7 13:18:43 PDT 2015


Revision: 141005
          https://trac.macports.org/changeset/141005
Author:   michaelld at macports.org
Date:     2015-10-07 13:18:42 -0700 (Wed, 07 Oct 2015)
Log Message:
-----------
python 1.0 PortGroup: when creating the requested subports, append Python to each; do not overwrite what was there before.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/octave-1.0.tcl
    trunk/dports/_resources/port1.0/group/python-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/octave-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/octave-1.0.tcl	2015-10-07 19:48:25 UTC (rev 141004)
+++ trunk/dports/_resources/port1.0/group/octave-1.0.tcl	2015-10-07 20:18:42 UTC (rev 141005)
@@ -57,6 +57,26 @@
 
     worksrcdir                  ${octave.module}
 
+    # depend on the Fortran compiler used to build octave
+
+    if {[catch {set installed [lindex [registry_active octave] 0]}]} {
+	ui_msg "Warning in octave 1.0 PortGroup:"
+	ui_msg "  Cannot find port 'octave' in the registry."
+	ui_msg "  This should never happen!"
+	ui_msg "  Continuing, and hoping for the best!"
+    } else {
+        set _variants [lindex ${installed} 3]
+	set gcc1 [string first {gcc} ${_variants}]
+	if {${gcc1} != -1} {
+	    # using +gccXY; retrieve that string
+	    set gcc [string range ${_variants} ${gcc1} [expr ${gcc1} + 4]]
+	} else {
+	    # must be using +g95
+	    set gcc "g95"
+	}
+	#depends_lib-append port:${gcc}
+    }
+
     # octave is not universal
 
     universal_variant           no
@@ -76,7 +96,6 @@
 }
 
 post-extract {
-
     # rename the effective worksrcdir to always be ${octave.module}
 
     set worksrcdir_name [exec /bin/ls ${workpath} | grep -v -E "^\\."]
@@ -131,9 +150,21 @@
     # fix usage of LAPACK_LIBS to include FLIBS, such that -lgfortran
     # is always paired with the appropriate -Lpath statement.
 
+    set GFORTRAN [glob ${prefix}/lib/libgcc/libgfortran*]
+    set QUADMATH [glob ${prefix}/lib/libgcc/libquadmath*]
+    set FLIBS [exec ${prefix}/bin/mkoctfile -p FLIBS | sed -e "s at -L\[^ \]* @@g" -e "s at -lgfortran@${GFORTRAN}@g" -e "s at -lquadmath@${QUADMATH}@g"]
+    set FLIBS "-L${prefix}/lib/libgcc ${FLIBS}"
+    set LAPACK_LIBS [exec ${prefix}/bin/mkoctfile -p LAPACK_LIBS | sed -e "s at -L\[^ \]* @@g" -e "s at -lgfortran@${GFORTRAN}@g" -e "s at -lquadmath@${QUADMATH}@g"]
+    set LAPACK_LIBS "${FLIBS} ${LAPACK_LIBS}"
+
+    ui_msg "GFORTRAN is '${GFORTRAN}'"
+    ui_msg "QUADMATH is '${QUADMATH}'"
+    ui_msg "FLIBS is '${FLIBS}'"
+    ui_msg "LAPACK_LIBS is '${LAPACK_LIBS}'"
+
     configure.env-append \
-	LAPACK_LIBS='[exec ${prefix}/bin/mkoctfile -p FLIBS] \
-	             [exec ${prefix}/bin/mkoctfile -p LAPACK_LIBS]'
+	FLIBS='${FLIBS}' \
+	LAPACK_LIBS='${LAPACK_LIBS}'
 
     # In 10.8+, set the LC_CTYPE (locale) to "C" otherwise
     # /usr/bin/sed can fail with an error when processing unicode
@@ -162,12 +193,37 @@
     xinstall -m 644 ${worksrcpath}/${distname}.tar.gz ${destroot}${prefix}/share/octave/${octave.module}.tar.gz
 }
 
-post-deactivate {
-    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg uninstall -nodeps ${octave.module}'"
-    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
+pre-deactivate {
+    ui_debug "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg uninstall -nodeps ${octave.module}'"
+    system "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg uninstall -nodeps ${octave.module}'"
+    ui_debug "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
+    system "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
+
+    # remove cruft left behind; cruft sometimes happens ;)
+    foreach global_dir {lib/octave/packages share/octave/packages} {
+	if {![catch {set stk_dirs [glob ${prefix}/${global_dir}/${octave.module}*]}]} {
+	    foreach stk_dir ${stk_dirs} {
+		ui_debug "removing cruft directory ${stk_dir}"
+		file delete -force ${stk_dir}
+	    }
+	}
+    }
 }
 
 post-activate {
-    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg install -verbose -global ${prefix}/share/octave/${octave.module}.tar.gz'"
-    system "${prefix}/bin/octave -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
+
+    # remove cruft left behind; cruft sometimes happens ;)
+    foreach global_dir {lib/octave/packages share/octave/packages} {
+	if {![catch {set stk_dirs [glob ${prefix}/${global_dir}/${octave.module}*]}]} {
+	    foreach stk_dir ${stk_dirs} {
+		ui_debug "removing cruft directory ${stk_dir}"
+		file delete -force ${stk_dir}
+	    }
+	}
+    }
+
+    ui_debug "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg install -verbose -global ${prefix}/share/octave/${octave.module}.tar.gz'"
+    system "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg install -verbose -global ${prefix}/share/octave/${octave.module}.tar.gz'"
+    ui_debug "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
+    system "${prefix}/bin/octave -V -q -f --eval 'pkg prefix ${prefix}/share/octave/packages ${prefix}/lib/octave/packages; pkg rebuild'"
 }

Modified: trunk/dports/_resources/port1.0/group/python-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/python-1.0.tcl	2015-10-07 19:48:25 UTC (rev 141004)
+++ trunk/dports/_resources/port1.0/group/python-1.0.tcl	2015-10-07 20:18:42 UTC (rev 141005)
@@ -96,7 +96,7 @@
     global name subport python._addedcode
     if {[string match py-* $name]} {
         foreach v [option $option] {
-            subport py${v}[string trimleft $name py] { depends_lib port:python${v} }
+            subport py${v}[string trimleft $name py] { depends_lib-append port:python${v} }
         }
         if {$subport eq $name || $subport eq ""} {
             # set up py-foo as a stub port that depends on the default pyXY-foo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151007/a8f927fd/attachment.html>


More information about the macports-changes mailing list