[44060] trunk/dports/math/fftw-3-single/Portfile

ram at macports.org ram at macports.org
Sat Dec 20 02:49:54 PST 2008


Revision: 44060
          http://trac.macports.org/changeset/44060
Author:   ram at macports.org
Date:     2008-12-20 02:49:51 -0800 (Sat, 20 Dec 2008)
Log Message:
-----------
math/fftw-3-single: apply patch from #13814 for universal variant

Modified Paths:
--------------
    trunk/dports/math/fftw-3-single/Portfile

Modified: trunk/dports/math/fftw-3-single/Portfile
===================================================================
--- trunk/dports/math/fftw-3-single/Portfile	2008-12-20 07:51:28 UTC (rev 44059)
+++ trunk/dports/math/fftw-3-single/Portfile	2008-12-20 10:49:51 UTC (rev 44060)
@@ -58,8 +58,6 @@
 test.run     yes
 test.target  check
 
-universal_variant no
-
 use_parallel_build yes
 
 platform powerpc {
@@ -84,6 +82,70 @@
         configure.args-delete --disable-fortran
 }
 
+if {![info exists universal_archs]} {
+    set universal_archs {i386 x86_64 ppc ppc64}
+}
+set first_arch [lindex ${universal_archs} 0]
+
+set my_worksrcpaths ${worksrcpath}
+
+variant universal {
+	set my_worksrcpaths {}
+	foreach arch ${universal_archs} {
+		lappend my_worksrcpaths ${workpath}/${arch}
+	}
+
+	post-patch {
+		foreach arch ${universal_archs} {
+			if {[string equal ${arch} ${first_arch}]} {
+				move ${worksrcpath} ${workpath}/${first_arch}
+			} else {
+				copy ${workpath}/${first_arch} ${workpath}/${arch}
+			}
+		}
+	}
+
+	configure {
+		foreach arch ${universal_archs} {
+			set my_arch_flag "-arch ${arch}"
+			set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag}"
+			set my_ldflags "${configure.ldflags} ${my_arch_flag}"
+			system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" ${configure.cmd} ${configure.pre_args} ${configure.args}"
+		}
+	}
+
+	build {
+		foreach arch ${universal_archs} {
+			system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}"
+		}
+	}
+
+	destroot {
+		system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}"
+		foreach lib {libfftw3f.3.dylib libfftw3f.a} {
+			set output_lib ${destroot}${prefix}/lib/${lib}
+			set lipo_args {}
+			foreach arch ${universal_archs} {
+				lappend lipo_args -arch ${arch} ${workpath}/${arch}/.libs/${lib}
+			}
+			lappend lipo_args -create -output ${output_lib}
+			delete ${output_lib}
+			system "lipo ${lipo_args}"
+		}
+
+		foreach lib {libfftw3f_threads.3.dylib libfftw3f_threads.a} {
+			set output_lib ${destroot}${prefix}/lib/${lib}
+			set lipo_args {}
+			foreach arch ${universal_archs} {
+				lappend lipo_args -arch ${arch} ${workpath}/${arch}/threads/.libs/${lib}
+			}
+			lappend lipo_args -create -output ${output_lib}
+			delete ${output_lib}
+			system "lipo ${lipo_args}"
+		}
+	}
+}
+
 post-destroot {
   file delete ${destroot}${prefix}/include/fftw3.f
   file delete ${destroot}${prefix}/include/fftw3.h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081220/f4b4ce86/attachment-0001.html>


More information about the macports-changes mailing list