source: trunk/dports/lang/libcxx/Portfile

Last change on this file was 153828, checked in by jeremyhu@…, 13 months ago

libcxx: Blacklist clang-3.9 and clang-devel

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: Portfile 153828 2016-10-12 21:32:06Z ryandesign@macports.org $
2
3PortSystem              1.0
4PortGroup               compiler_blacklist_versions 1.0
5
6name                    libcxx
7version                 3.7.1
8epoch                   1
9categories              lang
10platforms               darwin
11license                 MIT NCSA
12maintainers             jeremyhu
13description             libc++ is a new implementation of the C++ standard library with support for C++11 and portions of C++14.
14long_description        ${description} \
15                        Because objects cannot be passed between different versions of the C++ runtime, this port must \
16                        replace the host version in order to be used.  On Snow Leopard and earlier, this is done \
17                        automatically because there is no existing host version of this library.  On Lion and later, \
18                        users must build the port with +replacemnt_libcxx and install the root manually if they wish \
19                        to replace the existing host implementation.
20
21homepage                http://libcxx.llvm.org/
22
23master_sites            http://www.llvm.org/releases/${version}/
24dist_subdir             llvm
25
26use_xz                  yes
27distname                ${name}-${version}.src
28
29checksums               rmd160  b63d75f0547eb17e3f3f4df0875dfe1d0c32525d \
30                        sha256  357fbd4288ce99733ba06ae2bec6f503413d258aeebaab8b6a791201e6f7f144
31
32variant universal {}
33default_variants +universal
34use_configure no
35
36set roots_path ${prefix}/var/system_roots/
37set root_name  ${name}-${version}-${revision}
38
39platform darwin {
40    if {${os.major} < 9} {
41        pre-fetch {
42            ui_error "${name} is not supported on Tiger or earlier."
43            error "unsupported platform"
44        }
45    }
46
47    if {${os.major} < 11} {
48        post-activate {
49            system "cd / && tar xzf ${roots_path}/${root_name}.tgz"
50        }
51    }
52}
53
54variant replacemnt_libcxx description {EXPERTS ONLY: Build a replacement libcxxabi and libcxx even if it is already part of the base OS.} {}
55
56if {${os.major} < 11 || [variant_isset replacemnt_libcxx]} {
57    compiler.blacklist *gcc* {clang < 300}
58
59    # clang 3.5 and newer are blacklisted to prevent dependency cycles
60    foreach ver {3.5 3.6 3.7 3.8 3.9 devel} {
61        if {![file exists ${prefix}/bin/clang-mp-${ver}]} {
62            compiler.blacklist-append macports-clang-${ver}
63        }
64    }
65
66    depends_lib port:libcxxabi
67
68    supported_archs i386 x86_64 ppc
69
70    if {[variant_isset universal] && [lsearch ${universal_archs} ppc] != -1} {
71        # http://trac.macports.org/wiki/LibcxxOnOlderSystems#Leopardppc
72        compiler.whitelist macports-clang-3.6
73    }
74
75    patch.pre_args -p1
76    patchfiles-append \
77        0001-buildit-build-fix-for-Leopard.patch \
78        0002-buildit-Set-compatibility-version-to-RC_ProjectSourc.patch \
79        0003-Fix-local-and-iterator-when-building-with-Lion-and-n.patch \
80        0004-implement-atomic-using-mutex-lock_guard-for-64b-ops-.patch \
81        0005-string-Fix-exception-declaration.patch
82
83    build.dir ${worksrcpath}/lib
84    build.cmd ./buildit
85    build.env-append \
86        CC="${configure.cc}" \
87        CXX="${configure.cxx}" \
88        RC_XBS=1 \
89        RC_ProjectSourceVersion="${version}" \
90        RC_CFLAGS="[get_canonical_archflags]" \
91        TRIPLE="-apple-darwin${os.major}"
92
93    # We want to use the host's libc++ everywhere because we want to ensure
94    # that only *ONE* copy of this library is in any process's address space.
95    # On Snow Leopard and earlier, this port provides this library in /usr for
96    # binary compatibility with Lion and later.
97    #
98    # On newer OS version, this port does not install the content to /usr and
99    # just leaves it to expert users who may want to replace their system
100    # runtime.
101
102    destroot {
103        xinstall -m 755 -d ${destroot}${roots_path}/${root_name}/usr/lib
104        xinstall -m 755 ${worksrcpath}/lib/libc++.1.dylib ${destroot}${roots_path}/${root_name}/usr/lib
105        ln -s libc++.1.dylib ${destroot}${roots_path}/${root_name}/usr/lib/libc++.dylib
106
107        system "cd ${destroot}${roots_path}/${root_name} && tar czf ../${root_name}.tgz ."
108        file delete -force ${destroot}${roots_path}/${root_name}
109    }
110} else {
111    distfiles
112    fetch {}
113    build {}
114    destroot {
115        xinstall -d ${destroot}${prefix}/share/doc/${name}
116        system "echo ${name} is an empty port on this OS version because the functionality is already provided by the OS. > ${destroot}${prefix}/share/doc/${name}/README.txt"
117    }
118}
119
120livecheck.type none
Note: See TracBrowser for help on using the repository browser.