source: trunk/dports/devel/cctools/Portfile @ 120116

Last change on this file since 120116 was 120116, checked in by jeremyhu@…, 5 years ago

cctools and ld64: Bump to Xcode 5.1 versions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.1 KB
Line 
1# $Id: Portfile 120116 2014-05-16 02:02:23Z jeremyhu@macports.org $
2
3PortSystem              1.0
4
5name                    cctools
6# Xcode 5.1
7version                 855
8revision                1
9categories              devel
10platforms               darwin
11maintainers             jeremyhu openmaintainer
12license                 {APSL-2 GPL-2+}
13installs_libs           no
14description             Compiler Tools for Mac OS X and Darwin
15long_description        A set of essential tools to support development \
16                        on Mac OS X and Darwin. Conceptually similar \
17                        similar to binutils on other platforms.
18
19homepage                http://opensource.apple.com/source/${name}/
20master_sites            http://opensource.apple.com/tarballs/${name}/
21
22checksums               rmd160  82e2a198ceedd3aae8b22b8455c6d0aacf36705f \
23                        sha256  751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58
24
25# Just use the host's until the port is fixed port:xnu-headers
26
27depends_lib             port:cctools-headers
28depends_build           port:ld64
29
30patchfiles              cctools-829-lto.patch PR-37520.patch cctools-839-static-dis_info.patch PR-12400897.patch
31
32variant universal {}
33
34if {${os.arch} eq "powerpc" || ${os.major} < 9} {
35    # XCode 4.1
36    version             806
37    revision            3
38    distname            cctools-${version}
39    checksums           rmd160  91c0a3f192f1eed60b64ef5a0a06918d0ce0b0c9 \
40                        sha256  6116c06920112c634f6df2fa8b2f171ee3b90ff2176137da5856336695a6a676
41    supported_archs     ppc i386 x86_64
42
43    patchfiles-delete   cctools-829-lto.patch PR-37520.patch cctools-839-static-dis_info.patch
44    patchfiles-append   cctools-806-lto.patch PR-9087924.patch PR-9830754.patch cctools-822-no-lto.patch PR-11136237.patch PR-12475288.patch
45} else {
46    if {${os.major} < 11} {
47        patchfiles-append snowleopard-strnlen.patch
48    }
49    supported_archs     i386 x86_64
50}
51
52if {![variant_isset llvm29] && ![variant_isset llvm30] && ![variant_isset llvm31] && ![variant_isset llvm32] && ![variant_isset llvm33] && ![variant_isset llvm34] && ${os.major} >= 9} {
53    default_variants +llvm33
54}
55
56set llvm_version {}
57variant llvm29 conflicts llvm30 llvm31 llvm32 llvm33 llvm34 description {Use llvm-2.9 for libLTO and llvm-mc} {
58    set llvm_version        2.9
59    depends_run-append      port:llvm-${llvm_version}
60}
61
62variant llvm30 conflicts llvm29 llvm31 llvm32 llvm33 llvm34 description {Use llvm-3.0 for libLTO and llvm-mc} {
63    set llvm_version        3.0
64    depends_run-append      port:llvm-${llvm_version}
65}
66
67variant llvm31 conflicts llvm29 llvm30 llvm32 llvm33 llvm34 description {Use llvm-3.1 for libLTO and llvm-mc} {
68    set llvm_version        3.1
69    depends_run-append      port:llvm-${llvm_version}
70}
71
72variant llvm32 conflicts llvm29 llvm30 llvm31 llvm33 llvm34 description {Use llvm-3.2 for libLTO and llvm-mc} {
73    set llvm_version        3.2
74    depends_run-append      port:llvm-${llvm_version}
75}
76
77variant llvm33 conflicts llvm29 llvm30 llvm31 llvm32 llvm34 description {Use llvm-3.3 for libLTO and llvm-mc} {
78    set llvm_version        3.3
79    depends_run-append      port:llvm-${llvm_version}
80}
81
82variant llvm34 conflicts llvm29 llvm30 llvm31 llvm32 llvm33 description {Use llvm-3.4 for libLTO and llvm-mc} {
83    set llvm_version        3.4
84    depends_run-append      port:llvm-${llvm_version}
85}
86
87use_configure           no
88destroot.args           DSTROOT=${destroot}${prefix} RC_ProjectSourceVersion=${version}
89
90post-patch {
91    # We don't want to build cctools ld.  We want to use ld64
92    reinplace "/^SUBDIRS_32/s/ld//" ${worksrcpath}/Makefile
93    reinplace "/^COMMON_SUBDIRS/s/ ld / /" ${worksrcpath}/Makefile
94
95    # Use our chosen version of llvm
96    if {${llvm_version} != ""} {
97        reinplace "s:\"llvm-mc\":\"llvm-mc-mp-${llvm_version}\":" ${worksrcpath}/as/driver.c
98        reinplace "s:@@LLVM_LIBDIR@@:${prefix}/libexec/llvm-${llvm_version}/lib:" ${worksrcpath}/libstuff/lto.c
99    }
100
101    foreach file [glob ${worksrcpath}/{*/,}Makefile] {
102        reinplace "s:/usr/local:@PREFIX@:g" ${file}
103        reinplace "s:/usr:@PREFIX@:g" ${file}
104        reinplace "s:@PREFIX@:${prefix}:g" ${file}
105        reinplace "s:${prefix}/efi:${prefix}:g" ${file}
106        reinplace "s:/Developer${prefix}:${prefix}:g" ${file}
107        reinplace "s:${prefix}/man:${prefix}/share/man:g" ${file}
108
109        # Don't strip installed binaries
110        reinplace "s:\\(install .*\\)-s :\\1:g" ${file}
111
112        if {${os.major} < 10} {
113            reinplace "s:${prefix}/bin/mig:/usr/bin/mig:g" ${file}
114        }
115    }
116}
117
118use_configure   no
119use_parallel_build  yes
120
121build.target    all
122
123set cxx_stdlibflags {}
124if {[info exists configure.cxx_stdlib] &&
125    ${configure.cxx_stdlib} ne {} &&
126    [string match *clang* ${configure.cxx}]} {
127    set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
128}
129
130pre-build {
131    build.args-append \
132        RC_ProjectSourceVersion=${version} \
133        USE_DEPENDENCY_FILE=NO \
134        BUILD_DYLIBS=NO \
135        CC="${configure.cc} ${configure.cflags}" \
136        CXX="${configure.cxx} ${configure.cxxflags}" \
137        CXXLIB="${cxx_stdlibflags}" \
138        RC_ARCHS="[get_canonical_archs]" \
139        SDK="-I${prefix}/include"
140
141    if {${llvm_version} != ""} {
142        build.args-append \
143            LTO=-DLTO_SUPPORT \
144            RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
145            LLVM_MC="llvm-mc-mp-${llvm_version}"
146    } else {
147        build.args-append \
148            LTO= \
149            RC_CFLAGS="[get_canonical_archflags]"
150    }
151
152    if {[file exists ${prefix}/lib/libprunetrie.a]} {
153        build.args-append \
154            TRIE=-DTRIE_SUPPORT
155    } else {
156        build.args-append \
157            TRIE=
158    }
159}
160
161pre-destroot {
162    destroot.args-append \
163        RC_ProjectSourceVersion=${version} \
164        USE_DEPENDENCY_FILE=NO \
165        BUILD_DYLIBS=NO \
166        CC="${configure.cc} ${configure.cflags}" \
167        CXX="${configure.cxx} ${configure.cxxflags}" \
168        CXXLIB="${cxx_stdlibflags}" \
169        RC_ARCHS="[get_canonical_archs]" \
170        SDK="-I${prefix}/include"
171
172    if {${llvm_version} != ""} {
173        destroot.args-append \
174            LTO=-DLTO_SUPPORT \
175            RC_CFLAGS="[get_canonical_archflags] `llvm-config-mp-${llvm_version} --cflags`" \
176            LLVM_MC="llvm-mc-mp-${llvm_version}"
177    } else {
178        destroot.args-append \
179            LTO= \
180            RC_CFLAGS="[get_canonical_archflags]"
181    }
182
183    if {[file exists ${prefix}/lib/libprunetrie.a]} {
184        destroot.args-append \
185            TRIE=-DTRIE_SUPPORT
186    } else {
187        destroot.args-append \
188            TRIE=
189    }
190}
191
192platform macosx {
193    build.args-append RC_OS="macos"
194    destroot.args-append RC_OS="macos"
195}
196
197destroot.target install_tools
198destroot.args-append DSTROOT=${destroot}
199post-destroot {
200    file delete -force ${destroot}${prefix}/OpenSourceLicenses
201    file delete -force ${destroot}${prefix}/OpenSourceVersions
202    file delete -force ${destroot}${prefix}/RelNotes
203
204    if {${os.major} < 10} {
205        file delete -force ${destroot}/Developer
206    }
207
208    # Provided by port:cctools-headers
209    file delete -force ${destroot}${prefix}/include
210}
211
212livecheck.type          regex
213livecheck.regex         "${name}-(\[\\d.\]+)"
Note: See TracBrowser for help on using the repository browser.