Ticket #11438: zlib-universal-eridius.diff

File zlib-universal-eridius.diff, 2.8 KB (added by kballard (Lily Ballard), 17 years ago)
  • Portfile

     
    11# $Id$
    22
    33PortSystem 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
    9 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
    164
    17 master_sites    ${homepage} http://www.gzip.org/zlib/ \
    18                                 sourceforge:libpng
     5name                zlib
     6version             1.2.3
     7categories          archivers
     8maintainers         landonf@opendarwin.org
     9description         zlib lossless data-compression library
     10long_description    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.
    1914
    20 use_bzip2       yes
    21 checksums       md5 dee233bf288ee795ac96a98cc2e369b6
     15homepage            http://www.zlib.net/
     16platforms           darwin
    2217
    23 configure.args  --shared
     18master_sites        ${homepage} http://www.gzip.org/zlib/ \
     19                    sourceforge:libpng
    2420
    25 test.run        yes
     21use_bzip2           yes
     22checksums           md5 dee233bf288ee795ac96a98cc2e369b6
    2623
    27 destroot.destdir prefix=${destroot}${prefix}
     24configure.args      --shared
    2825
     26test.run            yes
     27
     28destroot.destdir    prefix=${destroot}${prefix}
     29
    2930post-destroot {
    30         system "cd ${worksrcpath} && ./configure"
    31         system "cd ${worksrcpath} && make"
    32         xinstall ${worksrcpath}/libz.a ${destroot}${prefix}/lib
     31    ui_msg "$UI_PREFIX Configuring libz.a"
     32    configure.args-delete --shared
     33    run_command configure
     34    modify_ldshared
     35    ui_msg "$UI_PREFIX Building libz.a"
     36    run_command build
     37    ui_msg "$UI_PREFIX Staging libz.a into destroot"
     38    xinstall ${worksrcpath}/libz.a ${destroot}${prefix}/lib/
    3339}
     40
     41post-configure {
     42    modify_ldshared
     43}
     44
     45variant universal {
     46    configure.env-append CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
     47                         LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
     48}
     49
     50proc 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
     58proc run_command {cmd} {
     59    if {[catch {system "[command $cmd]"} result]} {
     60        return -code error "[format [msgcat::mc "%s failure: %s"] $cmd $result]"
     61    }
     62}
     63 No newline at end of file