Ticket #53194: Portfile.3.diff

File Portfile.3.diff, 5.7 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 8 years ago)
  • Portfile

    old new  
    1212name                    llvm-${llvm_version}
    1313revision                2
    1414subport                 clang-${llvm_version} { revision 3 }
     15subport                 clang-libstdcxx-${llvm_version} { revision 0 }
    1516set suffix              mp-${llvm_version}
    1617set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
    1718dist_subdir             llvm
     
    2021license                 NCSA
    2122maintainers             jeremyhu larryv
    2223
     24if {${subport} eq "clang-${llvm_version}" || ${subport} eq "clang-libstdcxx-${llvm_version}"} {
     25    set clang_subport   true
     26} else {
     27    set clang_subport   false
     28}
     29
    2330if {${subport} eq "llvm-${llvm_version}"} {
    2431    homepage            http://llvm.org/
    2532    description         llvm is a next generation compiler infrastructure
     
    3239
    3340    depends_lib         port:libedit port:libffi port:ncurses port:xar port:zlib
    3441    depends_run         bin:perl:perl5 port:llvm_select
    35 } elseif {${subport} eq "clang-${llvm_version}"} {
     42} elseif {${clang_subport}} {
    3643    homepage            http://clang.llvm.org/
    3744    description         C, C++, Objective C and Objective C++ compiler
    3845    long_description    Clang is an "LLVM native" C/C++/Objective-C compiler, \
     
    9299        if {[variant_isset polly]} {
    93100            distfiles-append     polly-${version}.src${extract.suffix}
    94101        }
    95     } elseif {${subport} eq "clang-${llvm_version}"} {
     102    } elseif {${clang_subport}} {
    96103        distfiles-append     cfe-${version}.src${extract.suffix} compiler-rt-${version}.src${extract.suffix} libcxx-${version}.src${extract.suffix} clang-tools-extra-${version}.src${extract.suffix}
    97104    }
    98105}
     
    127134    0007-CMake-Fix-llvm_setup_rpath-function.patch \
    128135    0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch
    129136
    130 if {${subport} eq "clang-${llvm_version}"} {
     137if {${clang_subport}} {
    131138    patchfiles-append \
    132139        1001-MacPorts-Only-Prepare-clang-format-for-replacement-w.patch \
    133140        1002-MacPorts-Only-Fix-name-of-scan-view-executable-insid.patch \
     
    210217if {${subport} eq "llvm-${llvm_version}"} {
    211218    select.group        llvm
    212219    select.file         ${filespath}/mp-${subport}
    213 } elseif {${subport} eq "clang-${llvm_version}"} {
     220} elseif {${clang_subport}} {
    214221    select.group        clang
    215222    select.file         ${filespath}/mp-${subport}
    216223
     
    242249# Xcode 6.2's clang (600.0.57) fails due to https://llvm.org/bugs/show_bug.cgi?id=25753
    243250compiler.blacklist *gcc* {clang < 602}
    244251
    245 if {${subport} eq "clang-${llvm_version}"} {
     252if {${clang_subport}} {
    246253    # clang older than 3.5 fail due to https://llvm.org/bugs/show_bug.cgi?id=25753
    247254    compiler.blacklist-append macports-clang-3.3 macports-clang-3.4
    248255}
     
    295302        configure.optflags    -Os
    296303    }
    297304
    298     if {${subport} eq "clang-${llvm_version}" && [vercmp $xcodeversion 5.0] < 0} {
     305    if {${clang_subport} && [vercmp $xcodeversion 5.0] < 0} {
    299306        # https://llvm.org/bugs/show_bug.cgi?id=13671
    300307        patchfiles-append leopard-no-asan.patch
    301308        configure.args-append -DCOMPILER_RT_BUILD_SANITIZERS=OFF
    302309    }
    303310
    304     if {${subport} eq "clang-${llvm_version}" && ${os.major} <= 9} {
     311    if {${clang_subport} && ${os.major} <= 9} {
    305312        patchfiles-append leopard-no-blocks.patch
    306313    }
    307314
     
    331338                file rename ${workpath}/polly-${version}.src ${worksrcpath}/tools/polly
    332339            }
    333340        }
    334     } elseif {${subport} eq "clang-${llvm_version}"} {
     341    } elseif {${clang_subport}} {
    335342        if {${worksrcdir} eq "trunk"} {
    336343            system -W ${worksrcpath}/tools "svn ${proxy_args} co -r ${svn.revision} http://llvm.org/svn/llvm-project/cfe/trunk clang"
    337344            system -W ${worksrcpath}/projects "svn ${proxy_args} co -r ${compiler_rt_rev} http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt"
     
    351358    }
    352359}
    353360
    354 if {${subport} eq "clang-${llvm_version}"} {
     361if {${clang_subport}} {
    355362    destroot {
    356363        system "cd ${destroot.dir}/tools/clang && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}"
    357364        system "cd ${destroot.dir}/projects/compiler-rt && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}"
     
    382389        if {[variant_isset polly]} {
    383390            ln -s LLVMPolly.so ${destroot}${sub_prefix}/lib/LLVMPolly.dylib
    384391        }
    385     } elseif {${subport} eq "clang-${llvm_version}"} {
     392    } elseif {${clang_subport}} {
    386393        system "ditto ${worksrcpath}/projects/libcxx/include ${destroot}${sub_prefix}/lib/c++/v1"
    387394
    388395        # http://trac.macports.org/ticket/33207
     
    403410
    404411        destroot.args-append  OVERRIDE_libdir=${sub_prefix}/lib
    405412    }
    406 } elseif {${subport} eq "clang-${llvm_version}"} {
     413} elseif {${clang_subport}} {
    407414    if {[variant_isset assertions]} {
    408415        # Need to match llvm +-assertions
    409416        require_active_variants port:llvm-${llvm_version} assertions
     
    455462    }
    456463}
    457464
     465if {${subport} eq "clang-libstdcxx-${llvm_version}"} {
     466    depends_lib-append port:gcc6
     467
     468    patchfiles-append patch-macports-libstdcxx.diff
     469
     470    post-patch {
     471        reinplace "s|@@MACPORTS_GCC_INCLUDE_DIR@@|${prefix}/include/gcc6/c++|g" \
     472            ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
     473        reinplace "s|@@MACPORTS_HOST_NAME@@|${build_arch}-apple-darwin${os.major}|g" \
     474            ${worksrcpath}/tools/clang/lib/Frontend/InitHeaderSearch.cpp
     475        reinplace "s|@@MACPORTS_libstdc++@@|${prefix}/lib/libgcc/libstdc++.6.dylib|g" \
     476            ${worksrcpath}/tools/clang/lib/Driver/ToolChains.cpp
     477    }
     478}
     479
    458480livecheck.type          none