Ticket #18948: Portfile-unittest-cpp.diff

File Portfile-unittest-cpp.diff, 1.4 KB (added by guidolorenz@…, 16 years ago)
  • Portfile

    old new  
    2626
    2727use_configure           no
    2828
    29 test.run                yes
    30 test.target             
    31 test.cmd                ./TestUnitTest++
    32 
    3329destroot {
    3430    xinstall -m 755 -d ${destroot}${prefix}/include/unittest++/Posix
    3531    eval xinstall -m 640 [glob ${worksrcpath}/src/*.h] \
     
    4036        ${destroot}${prefix}/lib
    4137}
    4238
    43 universal_variant       no
     39variant universal {
     40    build {
     41        # Build and test the library for the native architecture,
     42        # just to check if everything is fine.
     43        system "cd ${worksrcpath} && ${build.cmd} TestUnitTest++"
     44        system "cd ${worksrcpath} && ${build.cmd} clean"
     45       
     46        # Now build the library for all universal architectures.
     47        set lipo_args {}
     48        foreach arch ${universal_archs} {
     49            system "cd ${worksrcpath} && ${build.cmd} libUnitTest++.a CXXFLAGS='-arch ${arch}' LDFLAGS='-arch ${arch}'"
     50            move ${worksrcpath}/libUnitTest++.a ${worksrcpath}/libUnitTest++.a.${arch}
     51            system "cd ${worksrcpath} && ${build.cmd} clean"
     52            lappend lipo_args -arch ${arch} ${worksrcpath}/libUnitTest++.a.${arch}
     53        }
     54       
     55        # Roll a universal binary.
     56        system "lipo ${lipo_args} -create -output ${worksrcpath}/libUnitTest++.a"
     57    }
     58}