Ticket #69992: build_libmacho.patch

File build_libmacho.patch, 3.1 KB (added by RJVB (René Bertin), 4 months ago)
  • devel/cctools/Portfile

    diff --git a/devel/cctools/Portfile b/devel/cctools/Portfile
    index 2e44ceff..c26ea37c 100644
    a b variant xtools description "Use darwin-xtools as cctools" { 
    184184    }
    185185}
    186186
     187variant libmacho conflicts xcode xtools description {build libmacho} {}
     188default_variants-append +libmacho
     189
    187190destroot.args           RAW_DSTROOT=${destroot} DSTROOT=${destroot}${prefix} RC_ProjectSourceVersion=${version}
    188191
    189192# reconfirmed 20210818 - cctools +llvm10 will not build universal on BigSur
    pre-build { 
    316319    }
    317320}
    318321
     322post-build {
     323    if {[variant_isset libmacho]} {
     324        if {${llvm_version} ne ""} {
     325            system -W ${worksrcpath}/libmacho "${build.cmd} ${build.pre_args} \
     326                RC_ProjectSourceVersion=${version} \
     327                USE_DEPENDENCY_FILE=NO \
     328                BUILD_DYLIBS=NO \
     329                DEPENDENT_LIBS= \
     330                CC=\"${configure.cc} ${configure.cflags}\" \
     331                CXX=\"${configure.cxx} ${configure.cxxflags}\" \
     332                CXXLIB=\"${cxx_stdlibflags}\" \
     333                TRIE=-DTRIE_SUPPORT \
     334                RC_ARCHS=\"[get_canonical_archs]\" \
     335                SDK=\"${configure.cppflags}\"
     336                LTO=-DLTO_SUPPORT \
     337                RC_CFLAGS=\"[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`\" \
     338                LLVM_MC=\"llvm-mc-mp-${llvm_version}\" RC_OS=\"macos\""
     339        } else {
     340            system -W ${worksrcpath}/libmacho "${build.cmd} ${build.pre_args} \
     341                RC_ProjectSourceVersion=${version} \
     342                USE_DEPENDENCY_FILE=NO \
     343                BUILD_DYLIBS=NO \
     344                DEPENDENT_LIBS= \
     345                CC=\"${configure.cc} ${configure.cflags}\" \
     346                CXX=\"${configure.cxx} ${configure.cxxflags}\" \
     347                CXXLIB=\"${cxx_stdlibflags}\" \
     348                TRIE=-DTRIE_SUPPORT \
     349                RC_ARCHS=\"[get_canonical_archs]\" \
     350                SDK=\"${configure.cppflags}\"
     351                LTO= \
     352                RC_CFLAGS=\"[get_canonical_archflags]\" RC_OS=\"macos\""
     353        }
     354    }
     355}
     356
    319357pre-destroot {
    320358    if {![variant_isset xcode] && ![variant_isset xtools]} {
    321359        destroot.args-append \
    platform macosx { 
    350388destroot.target install_tools
    351389destroot.args-append DSTROOT=${destroot}
    352390post-destroot {
     391    if {[variant_isset libmacho]} {
     392        xinstall -d -m 755 ${destroot}${prefix}/lib/system
     393        xinstall -m 755 ${worksrcpath}/libmacho/dtmp_obj/libmacho.dylib ${destroot}${prefix}/lib/system
     394    }
     395
    353396    if {![variant_isset xcode] && ![variant_isset xtools]} {
    354397        file delete -force ${destroot}${prefix}/OpenSourceLicenses
    355398        file delete -force ${destroot}${prefix}/OpenSourceVersions
    post-destroot { 
    379422            ln -s llvm-size-mp-${llvm_version} ${destroot}${prefix}/bin/size
    380423        }
    381424    }
     425    if {[file exists ${workpath}/build.log]} {
     426        xinstall -m 755 -d ${destroot}${prefix}/share/doc/cctools
     427        xinstall -m 644 ${workpath}/build.log ${destroot}${prefix}/share/doc/cctools/
     428    }
    382429}
    383430
    384431livecheck.type          regex