Ticket #11438: zlib-universal-third.diff
File zlib-universal-third.diff, 2.7 KB (added by pipping@…, 18 years ago) |
---|
-
Portfile
1 1 # $Id$ 2 2 3 3 PortSystem 1.0 4 name zlib 5 version 1.2.3 6 categories archivers 7 maintainers landonf@opendarwin.org 8 description zlib lossless data-compression library 4 5 name zlib 6 version 1.2.3 7 categories archivers 8 maintainers landonf@opendarwin.org 9 description zlib lossless data-compression library 9 10 long_description \ 10 zlib is designed to be a free, general-purpose, \ 11 legally unencumbered, lossless data-compression \ 12 library for use on virtually any computer hardware \ 13 and operating system. 14 homepage http://www.zlib.net/ 15 platforms darwin 11 zlib is designed to be a free, general-purpose, legally \ 12 unencumbered, lossless data-compression library for use on virtually\ 13 any computer hardware and operating system. 16 14 17 master_sites ${homepage} http://www.gzip.org/zlib/ \ 18 sourceforge:libpng 15 homepage http://www.zlib.net/ 16 platforms darwin 19 17 20 use_bzip2 yes 21 checksums md5 dee233bf288ee795ac96a98cc2e369b6 18 master_sites ${homepage} \ 19 http://www.gzip.org/zlib/ \ 20 sourceforge:libpng 22 21 23 configure.args --shared 22 use_bzip2 yes 23 checksums md5 dee233bf288ee795ac96a98cc2e369b6 24 24 25 test.run yes 25 configure.args --shared 26 26 27 destroot.destdir prefix=${destroot}${prefix} 27 test.run yes 28 28 29 destroot.destdir prefix=${destroot}${prefix} 30 29 31 post-destroot { 30 system "cd ${worksrcpath} && ./configure" 31 system "cd ${worksrcpath} && make" 32 xinstall ${worksrcpath}/libz.a ${destroot}${prefix}/lib 32 ui_msg "$UI_PREFIX Configuring libz.a" 33 configure.args-delete --shared 34 run_command configure 35 modify_ldshared 36 ui_msg "$UI_PREFIX Building libz.a" 37 run_command build 38 ui_msg "$UI_PREFIX Staging libz.a into destroot" 39 xinstall ${worksrcpath}/libz.a ${destroot}${prefix}/lib/ 33 40 } 41 42 post-configure { 43 modify_ldshared 44 } 45 variant universal { 46 configure.env-append CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \ 47 LDFLAGS="-arch i386 -arch ppc" 48 } 49 50 proc modify_ldshared {} { 51 global worksrcpath 52 if {[variant_isset universal]} { 53 reinplace "s|^\\(LDSHARED *=.*\\)$|\\1 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc|" \ 54 "${worksrcpath}/Makefile" 55 } 56 } 57 58 proc run_command {cmd} { 59 if {[catch {system "[command $cmd]"} result]} { 60 return -code error "[format [msgcat::mc "%s failure: %s"] $cmd $result]" 61 } 62 }