# $Id: Portfile 38059 2008-07-04 20:13:54Z ram@macports.org $ PortSystem 1.0 name lame set major 3 set minor 98 version ${major}.${minor} categories audio platforms darwin freebsd maintainers ram openmaintainer description Lame Ain't an MP3 Encoder long_description LAME is an educational tool to be used for learning \ about MP3 encoding. The goal of the LAME project is to use the open \ source model to improve the psycho acoustics, noise shaping and speed \ of MP3. LAME is not for everyone - it is distributed as source code \ only and requires the ability to use a C compiler. homepage http://lame.sourceforge.net/ master_sites sourceforge:lame distname ${name}-${major}${minor} depends_lib port:ncurses checksums md5 f44b9f8e1b5d8835d0a77f9cc9cedd1c \ sha1 287979d076834882c99d0cc01ddbd9b3697ceaae \ rmd160 754343791ac80d2403291c63f99eb409bca6b62f configure.args --mandir=${prefix}/share/man 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}" set pcp "{prefix}/lib/pkgconfig" set my_configure_args "CC=\"gcc -arch ${arch}\"" 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}" } } build { foreach arch ${my_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 [list [file readlink ${workpath}/${first_arch}/libmp3lame/.libs/libmp3lame.dylib] libmp3lame.a] { set output_lib ${destroot}${prefix}/lib/${lib} set lipo_args {} foreach arch ${my_universal_archs} { lappend lipo_args -arch ${arch} ${workpath}/${arch}/libmp3lame/.libs/${lib} } lappend lipo_args -create -output ${output_lib} delete ${output_lib} system "lipo ${lipo_args}" } set output_bin ${destroot}${prefix}/bin/lame set lipo_args {} foreach arch ${my_universal_archs} { lappend lipo_args -arch ${arch} ${workpath}/${arch}/frontend/lame } lappend lipo_args -create -output ${output_bin} delete ${output_bin} system "lipo ${lipo_args}" } } livecheck.check regex livecheck.url ${homepage}download.php livecheck.regex {The current release version of LAME is ([0-9]+\.[0-9]+)}