| 1 | # $Id$ |
|---|
| 2 | |
|---|
| 3 | PortSystem 1.0 |
|---|
| 4 | |
|---|
| 5 | name lame |
|---|
| 6 | version 3.98.2 |
|---|
| 7 | categories audio |
|---|
| 8 | platforms darwin freebsd |
|---|
| 9 | maintainers ram openmaintainer |
|---|
| 10 | |
|---|
| 11 | description Lame Ain't an MP3 Encoder |
|---|
| 12 | long_description LAME is an educational tool to be used for learning \ |
|---|
| 13 | about MP3 encoding. The goal of the LAME project is to use the open \ |
|---|
| 14 | source model to improve the psycho acoustics, noise shaping and speed \ |
|---|
| 15 | of MP3. LAME is not for everyone - it is distributed as source code \ |
|---|
| 16 | only and requires the ability to use a C compiler. |
|---|
| 17 | |
|---|
| 18 | homepage http://lame.sourceforge.net/ |
|---|
| 19 | master_sites sourceforge:lame |
|---|
| 20 | distname ${name}-398-2 |
|---|
| 21 | |
|---|
| 22 | depends_lib port:ncurses |
|---|
| 23 | |
|---|
| 24 | checksums md5 719dae0ee675d0c16e0e89952930ed35 \ |
|---|
| 25 | sha1 b2db41dbc9c0824caa102e8c932b820c79ccd5ec \ |
|---|
| 26 | rmd160 767dd94271eef221170469535db2bf388149715a |
|---|
| 27 | |
|---|
| 28 | configure.args --mandir=${prefix}/share/man |
|---|
| 29 | |
|---|
| 30 | set my_universal_archs {i386 ppc} |
|---|
| 31 | set first_arch [lindex ${my_universal_archs} 0] |
|---|
| 32 | |
|---|
| 33 | set my_worksrcpaths ${worksrcpath} |
|---|
| 34 | |
|---|
| 35 | variant universal { |
|---|
| 36 | set my_worksrcpaths {} |
|---|
| 37 | foreach arch ${my_universal_archs} { |
|---|
| 38 | lappend my_worksrcpaths ${workpath}/${arch} |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | post-patch { |
|---|
| 42 | foreach arch ${my_universal_archs} { |
|---|
| 43 | if {[string equal ${arch} ${first_arch}]} { |
|---|
| 44 | move ${worksrcpath} ${workpath}/${first_arch} |
|---|
| 45 | } else { |
|---|
| 46 | copy ${workpath}/${first_arch} ${workpath}/${arch} |
|---|
| 47 | } |
|---|
| 48 | } |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | configure { |
|---|
| 52 | foreach arch ${my_universal_archs} { |
|---|
| 53 | set my_arch_flag "-arch ${arch}" |
|---|
| 54 | set my_cflags "${configure.cflags} -isysroot ${sysroot} ${my_arch_flag} -I${prefix}/include -L${prefix}/lib" |
|---|
| 55 | set my_ldflags "${configure.ldflags} ${my_arch_flag}" |
|---|
| 56 | set pcp "{prefix}/lib/pkgconfig" |
|---|
| 57 | set my_configure_args "CC=\"gcc -arch ${arch}\"" |
|---|
| 58 | 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}" |
|---|
| 59 | } |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | build { |
|---|
| 63 | foreach arch ${my_universal_archs} { |
|---|
| 64 | system "cd ${workpath}/${arch} && ${build.cmd} ${build.pre_args}" |
|---|
| 65 | } |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | destroot { |
|---|
| 69 | system "cd ${workpath}/${first_arch} && ${destroot.cmd} ${destroot.pre_args} ${destroot.post_args}" |
|---|
| 70 | foreach lib [list [file readlink ${workpath}/${first_arch}/libmp3lame/.libs/libmp3lame.dylib] libmp3lame.a] { |
|---|
| 71 | set output_lib ${destroot}${prefix}/lib/${lib} |
|---|
| 72 | set lipo_args {} |
|---|
| 73 | foreach arch ${my_universal_archs} { |
|---|
| 74 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/libmp3lame/.libs/${lib} |
|---|
| 75 | } |
|---|
| 76 | lappend lipo_args -create -output ${output_lib} |
|---|
| 77 | delete ${output_lib} |
|---|
| 78 | system "lipo ${lipo_args}" |
|---|
| 79 | } |
|---|
| 80 | set output_bin ${destroot}${prefix}/bin/lame |
|---|
| 81 | set lipo_args {} |
|---|
| 82 | foreach arch ${my_universal_archs} { |
|---|
| 83 | lappend lipo_args -arch ${arch} ${workpath}/${arch}/frontend/lame |
|---|
| 84 | } |
|---|
| 85 | lappend lipo_args -create -output ${output_bin} |
|---|
| 86 | delete ${output_bin} |
|---|
| 87 | system "lipo ${lipo_args}" |
|---|
| 88 | } |
|---|
| 89 | } |
|---|