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 12 12 name llvm-${llvm_version} 13 13 revision 2 14 14 subport clang-${llvm_version} { revision 3 } 15 subport clang-libstdcxx-${llvm_version} { revision 0 } 15 16 set suffix mp-${llvm_version} 16 17 set sub_prefix ${prefix}/libexec/llvm-${llvm_version} 17 18 dist_subdir llvm … … 20 21 license NCSA 21 22 maintainers jeremyhu larryv 22 23 24 if {${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 23 30 if {${subport} eq "llvm-${llvm_version}"} { 24 31 homepage http://llvm.org/ 25 32 description llvm is a next generation compiler infrastructure … … 32 39 33 40 depends_lib port:libedit port:libffi port:ncurses port:xar port:zlib 34 41 depends_run bin:perl:perl5 port:llvm_select 35 } elseif {${ subport} eq "clang-${llvm_version}"} {42 } elseif {${clang_subport}} { 36 43 homepage http://clang.llvm.org/ 37 44 description C, C++, Objective C and Objective C++ compiler 38 45 long_description Clang is an "LLVM native" C/C++/Objective-C compiler, \ … … 92 99 if {[variant_isset polly]} { 93 100 distfiles-append polly-${version}.src${extract.suffix} 94 101 } 95 } elseif {${ subport} eq "clang-${llvm_version}"} {102 } elseif {${clang_subport}} { 96 103 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} 97 104 } 98 105 } … … 127 134 0007-CMake-Fix-llvm_setup_rpath-function.patch \ 128 135 0008-Fix-build-issues-pre-Lion-due-to-missing-a-strnlen-d.patch 129 136 130 if {${ subport} eq "clang-${llvm_version}"} {137 if {${clang_subport}} { 131 138 patchfiles-append \ 132 139 1001-MacPorts-Only-Prepare-clang-format-for-replacement-w.patch \ 133 140 1002-MacPorts-Only-Fix-name-of-scan-view-executable-insid.patch \ … … 210 217 if {${subport} eq "llvm-${llvm_version}"} { 211 218 select.group llvm 212 219 select.file ${filespath}/mp-${subport} 213 } elseif {${ subport} eq "clang-${llvm_version}"} {220 } elseif {${clang_subport}} { 214 221 select.group clang 215 222 select.file ${filespath}/mp-${subport} 216 223 … … 242 249 # Xcode 6.2's clang (600.0.57) fails due to https://llvm.org/bugs/show_bug.cgi?id=25753 243 250 compiler.blacklist *gcc* {clang < 602} 244 251 245 if {${ subport} eq "clang-${llvm_version}"} {252 if {${clang_subport}} { 246 253 # clang older than 3.5 fail due to https://llvm.org/bugs/show_bug.cgi?id=25753 247 254 compiler.blacklist-append macports-clang-3.3 macports-clang-3.4 248 255 } … … 295 302 configure.optflags -Os 296 303 } 297 304 298 if {${ subport} eq "clang-${llvm_version}"&& [vercmp $xcodeversion 5.0] < 0} {305 if {${clang_subport} && [vercmp $xcodeversion 5.0] < 0} { 299 306 # https://llvm.org/bugs/show_bug.cgi?id=13671 300 307 patchfiles-append leopard-no-asan.patch 301 308 configure.args-append -DCOMPILER_RT_BUILD_SANITIZERS=OFF 302 309 } 303 310 304 if {${ subport} eq "clang-${llvm_version}"&& ${os.major} <= 9} {311 if {${clang_subport} && ${os.major} <= 9} { 305 312 patchfiles-append leopard-no-blocks.patch 306 313 } 307 314 … … 331 338 file rename ${workpath}/polly-${version}.src ${worksrcpath}/tools/polly 332 339 } 333 340 } 334 } elseif {${ subport} eq "clang-${llvm_version}"} {341 } elseif {${clang_subport}} { 335 342 if {${worksrcdir} eq "trunk"} { 336 343 system -W ${worksrcpath}/tools "svn ${proxy_args} co -r ${svn.revision} http://llvm.org/svn/llvm-project/cfe/trunk clang" 337 344 system -W ${worksrcpath}/projects "svn ${proxy_args} co -r ${compiler_rt_rev} http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt" … … 351 358 } 352 359 } 353 360 354 if {${ subport} eq "clang-${llvm_version}"} {361 if {${clang_subport}} { 355 362 destroot { 356 363 system "cd ${destroot.dir}/tools/clang && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}" 357 364 system "cd ${destroot.dir}/projects/compiler-rt && ${destroot.cmd} ${destroot.pre_args} ${destroot.target} ${destroot.post_args}" … … 382 389 if {[variant_isset polly]} { 383 390 ln -s LLVMPolly.so ${destroot}${sub_prefix}/lib/LLVMPolly.dylib 384 391 } 385 } elseif {${ subport} eq "clang-${llvm_version}"} {392 } elseif {${clang_subport}} { 386 393 system "ditto ${worksrcpath}/projects/libcxx/include ${destroot}${sub_prefix}/lib/c++/v1" 387 394 388 395 # http://trac.macports.org/ticket/33207 … … 403 410 404 411 destroot.args-append OVERRIDE_libdir=${sub_prefix}/lib 405 412 } 406 } elseif {${ subport} eq "clang-${llvm_version}"} {413 } elseif {${clang_subport}} { 407 414 if {[variant_isset assertions]} { 408 415 # Need to match llvm +-assertions 409 416 require_active_variants port:llvm-${llvm_version} assertions … … 455 462 } 456 463 } 457 464 465 if {${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 458 480 livecheck.type none