| 31 | | # disable universal variant until a solution to #15995 is found |
| 32 | | universal_variant no |
| | 31 | set my_universal_archs {i386 ppc} |
| | 32 | set first_arch [lindex ${my_universal_archs} 0] |
| | 33 | |
| | 34 | set my_worksrcpaths ${worksrcpath} |
| | 35 | |
| | 36 | variant universal { |
| | 37 | set my_worksrcpaths {} |
| | 38 | foreach arch ${my_universal_archs} { |
| | 39 | lappend my_worksrcpaths ${workpath}/${arch} |
| | 40 | } |
| | 41 | |
| | 42 | post-patch { |
| | 43 | foreach arch ${my_universal_archs} { |
| | 44 | if {[string equal ${arch} ${first_arch}]} { |
| | 45 | move ${worksrcpath} ${workpath}/${first_arch} |
| | 46 | } else { |
| | 47 | copy ${workpath}/${first_arch} ${workpath}/${arch} |
| | 48 | } |
| | 49 | } |
| | 50 | } |
| | 51 | |
| | 52 | configure { |
| | 53 | foreach arch ${my_universal_archs} { |
| | 54 | set my_arch_flag "-arch ${arch}" |
| | 55 | set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag} -I${prefix}/include -L${prefix}/lib" |
| | 56 | set my_ldflags "${configure.ldflags} ${my_arch_flag}" |
| | 57 | set pcp "{prefix}/lib/pkgconfig" |
| | 58 | set my_configure_args "CC=\"gcc -arch ${arch}\"" |
| | 59 | system "cd ${workpath}/${arch} && CFLAGS=\"${my_cflags}\" CXXFLAGS=\"${my_cflags}\" LDFLAGS=\"${my_ldflags}\" PKG_CONFIG_PATH=\"${pcp}\" ${configure.cmd} ${configure.pre_args} ${configure.args} ${my_configure_args}" |
| | 60 | } |
| | 61 | } |
| | 62 | |
| | 63 | build { |
| | 64 | foreach arch ${my_universal_archs} { |
| | 65 | system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}" |
| | 66 | } |
| | 67 | } |
| | 68 | |
| | 69 | destroot { |
| | 70 | system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}" |
| | 71 | foreach lib [list [file readlink ${workpath}/${first_arch}/libmp3lame/.libs/libmp3lame.dylib] libmp3lame.a] { |
| | 72 | set output_lib ${destroot}${prefix}/lib/${lib} |
| | 73 | set lipo_args {} |
| | 74 | foreach arch ${my_universal_archs} { |
| | 75 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/libmp3lame/.libs/${lib} |
| | 76 | } |
| | 77 | lappend lipo_args -create -output ${output_lib} |
| | 78 | delete ${output_lib} |
| | 79 | system "lipo ${lipo_args}" |
| | 80 | } |
| | 81 | set output_bin ${destroot}${prefix}/bin/lame |
| | 82 | set lipo_args {} |
| | 83 | foreach arch ${my_universal_archs} { |
| | 84 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/frontend/lame |
| | 85 | } |
| | 86 | lappend lipo_args -create -output ${output_bin} |
| | 87 | delete ${output_bin} |
| | 88 | system "lipo ${lipo_args}" |
| | 89 | } |
| | 90 | } |