[42793] trunk/dports/multimedia/x264/Portfile
jeremyhu at macports.org
jeremyhu at macports.org
Sun Nov 30 16:54:12 PST 2008
Revision: 42793
http://trac.macports.org/changeset/42793
Author: jeremyhu at macports.org
Date: 2008-11-30 16:54:11 -0800 (Sun, 30 Nov 2008)
Log Message:
-----------
x264: Buildfix for universal variant - ticket #15996 - Maintainer Timeout
Modified Paths:
--------------
trunk/dports/multimedia/x264/Portfile
Modified: trunk/dports/multimedia/x264/Portfile
===================================================================
--- trunk/dports/multimedia/x264/Portfile 2008-12-01 00:51:49 UTC (rev 42792)
+++ trunk/dports/multimedia/x264/Portfile 2008-12-01 00:54:11 UTC (rev 42793)
@@ -25,6 +25,7 @@
configure.args \
--enable-pthread --enable-pic
+configure.cflags-append -fno-common -read_only_relocs suppress
destroot.args DIR_INSTALL=${destroot}${prefix}
@@ -38,3 +39,80 @@
variant G5 description {G5 specific optimizations} {
configure.cflags-append "-mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt -fast -mabi=altivec -maltivec"
}
+
+set my_universal_archs {i386 ppc}
+set first_arch [lindex ${my_universal_archs} 0]
+
+set my_worksrcpaths ${worksrcpath}
+
+variant universal {
+ set my_worksrcpaths {}
+ foreach arch ${my_universal_archs} {
+ lappend my_worksrcpaths ${workpath}/${arch}
+ }
+
+ post-patch {
+ foreach arch ${my_universal_archs} {
+ if {[string equal ${arch} ${first_arch}]} {
+ move ${worksrcpath} ${workpath}/${first_arch}
+ } else {
+ copy ${workpath}/${first_arch} ${workpath}/${arch}
+ }
+ }
+ }
+ configure {
+ foreach arch ${my_universal_archs} {
+ set my_arch_flag "-arch ${arch}"
+ set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag} -I${prefix}/include -L${prefix}/lib"
+ set my_ldflags "${configure.ldflags} ${my_arch_flag}"
+ if {[string equal ${arch} i386 ]} {
+ set my_configure_args "CC=\"gcc -arch ${arch}\""
+ } else {
+ set my_configure_args "CC=\"gcc -arch ${arch}\" --disable-asm"
+ }
+ system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" ${configure.cmd} ${configure.pre_args} ${configure.args} ${my_configure_args}"
+ }
+ }
+
+ build {
+ foreach arch ${my_universal_archs} {
+ system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}"
+ # This was a first look at dylib. Needs some more investigation as I don't know ins&outs of macports
+ #system "cd ${workpath}/${arch} && gcc -dynamiclib -arch ${arch} -o ${workpath}/${arch}/libx264.dylib common/*.o common/${arch}/*.o encoder/*.o"
+ }
+ }
+
+ destroot {
+ system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}"
+ # leave .dylib and .a for later. Only .a now
+ #foreach lib [list [file readlink ${workpath}/${first_arch}/libx264.dylib] libx264.a] {
+ # set output_lib ${destroot}${prefix}/lib/${lib}
+ # set lipo_args {}
+ # foreach arch ${my_universal_archs} {
+ # lappend lipo_args -arch ${arch} ${workpath}/${arch}/${lib}
+ # }
+ # lappend lipo_args -create -output ${output_lib}
+ # delete ${output_lib}
+ # system "lipo ${lipo_args}"
+ #}
+ # Do currently only .a
+ set output_lib ${destroot}${prefix}/lib/libx264.a
+ set lipo_args {}
+ foreach arch ${my_universal_archs} {
+ lappend lipo_args -arch ${arch} ${workpath}/${arch}/libx264.a
+ }
+ lappend lipo_args -create -output ${output_lib}
+ delete ${output_lib}
+ system "lipo ${lipo_args}"
+
+ set output_bin ${destroot}${prefix}/bin/x264
+ set lipo_args {}
+ foreach arch ${my_universal_archs} {
+ lappend lipo_args -arch ${arch} ${workpath}/${arch}/x264
+ }
+ lappend lipo_args -create -output ${output_bin}
+ delete ${output_bin}
+ system "lipo ${lipo_args}"
+ }
+}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081130/fe8340a5/attachment.html>
More information about the macports-changes
mailing list