[53393] trunk/dports/multimedia/x264/Portfile
jeremyhu at macports.org
jeremyhu at macports.org
Sat Jul 4 15:20:37 PDT 2009
Revision: 53393
http://trac.macports.org/changeset/53393
Author: jeremyhu at macports.org
Date: 2009-07-04 15:20:35 -0700 (Sat, 04 Jul 2009)
Log Message:
-----------
x264: Move to muniversal instead of re-inventing the wheel
Modified Paths:
--------------
trunk/dports/multimedia/x264/Portfile
Modified: trunk/dports/multimedia/x264/Portfile
===================================================================
--- trunk/dports/multimedia/x264/Portfile 2009-07-04 20:53:05 UTC (rev 53392)
+++ trunk/dports/multimedia/x264/Portfile 2009-07-04 22:20:35 UTC (rev 53393)
@@ -2,6 +2,7 @@
# $Id$
PortSystem 1.0
+PortGroup muniversal 1.0
name x264
version 20090408
@@ -50,92 +51,9 @@
# to exhibit problems in some cases (see #19835)
# disable by default but can be enabled using +asm variant for the adventurous
#
-
variant asm description {enable intel assembler optimizations (experimental)} {
depends_build-append port:yasm
configure.args-delete --disable-asm
}
-variant G5 description {G5 specific optimizations} {
- if {! [variant_isset universal]} {
- configure.cflags-append "-mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt -fast -mabi=altivec -maltivec"
- }
-}
-
-if {![info exists universal_archs]} {
- set universal_archs {i386 ppc}
-}
-
-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} ${my_arch_flag} -I${prefix}/include -L${prefix}/lib"
- if {[info exists universal_sysroot]} {
- set my_cflags "${my_cflags} -isysroot ${universal_sysroot}"
- }
- set my_ldflags "${configure.ldflags} ${my_arch_flag}"
- set my_configure_args "--host=${arch}-apple-darwin"
- if {[string equal ${arch} ppc ] || [string equal ${arch} ppc64 ]} {
- set my_configure_args "${my_configure_args} --disable-asm"
-
- if {[variant_isset G5] || [string equal ${arch} ppc64 ]} {
- set my_cflags "${my_cflags} -mcpu=970 -mtune=970 -mpowerpc64 -mpowerpc-gpopt -fast -mabi=altivec -maltivec"
- }
- }
- 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 ${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}"
- foreach lib [list libx264.67.dylib libx264.a] {
- set output_lib ${destroot}${prefix}/lib/${lib}
- set lipo_args {}
- foreach arch ${universal_archs} {
- lappend lipo_args -arch ${arch} ${workpath}/${arch}/${lib}
- }
- 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 ${universal_archs} {
- lappend lipo_args -arch ${arch} ${workpath}/${arch}/x264
- }
- lappend lipo_args -create -output ${output_bin}
- delete ${output_bin}
- system "lipo ${lipo_args}"
- }
-}
-
livecheck.check none
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090704/6a1dacbd/attachment-0001.html>
More information about the macports-changes
mailing list