Ticket #11438: zlib-universal-third.diff

File zlib-universal-third.diff, 2.7 KB (added by pipping@…, 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
     4
     5name                zlib
     6version             1.2.3
     7categories          archivers
     8maintainers         landonf@opendarwin.org
     9description         zlib lossless data-compression library
    910long_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.
    1614
    17 master_sites    ${homepage} http://www.gzip.org/zlib/ \
    18                                 sourceforge:libpng
     15homepage            http://www.zlib.net/
     16platforms           darwin
    1917
    20 use_bzip2       yes
    21 checksums       md5 dee233bf288ee795ac96a98cc2e369b6
     18master_sites        ${homepage} \
     19                    http://www.gzip.org/zlib/ \
     20                    sourceforge:libpng
    2221
    23 configure.args  --shared
     22use_bzip2           yes
     23checksums           md5 dee233bf288ee795ac96a98cc2e369b6
    2424
    25 test.run        yes
     25configure.args      --shared
    2626
    27 destroot.destdir prefix=${destroot}${prefix}
     27test.run            yes
    2828
     29destroot.destdir    prefix=${destroot}${prefix}
     30
    2931post-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/
    3340}
     41
     42post-configure {
     43    modify_ldshared
     44}
     45variant universal {
     46    configure.env-append CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" \
     47                         LDFLAGS="-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}