source: trunk/dports/lang/eero-devel/Portfile

Last change on this file was 141182, checked in by jeremyhu@…, 2 years ago

misc: Remove references to older versions of macports-clang that are no longer used

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.2 KB
Line 
1# $Id: Portfile 141182 2015-10-12 00:05:23Z ryandesign@macports.org $
2
3# Much of this Portfile is borrowed from clang-3.2, with adaptations where
4# needed.
5
6PortSystem              1.0
7PortGroup select        1.0
8PortGroup compiler_blacklist_versions 1.0
9
10name                    eero-devel
11version                 3.4.2014-06-01
12revision                1
13set llvm_tag            3.4.2014-06-01
14set clang_tag           3.4.2014-06-01
15set sub_prefix          ${prefix}/libexec/eero-devel
16
17categories              lang
18platforms               darwin
19maintainers             vince
20
21license                 NCSA
22description             Eero is Objective-C evolved
23long_description        The Eero language is Obj-C but replaces much \
24                        of the underlying C syntax by a more modern \
25                        Python like syntax. Binaries produced are \
26                        100% compatible with standard Obj-C. The Eero \
27                        compiler is based on Clang and thus can \
28                        also compile regular C, C++ and Obj-C.
29                       
30homepage                http://eerolanguage.org/
31master_sites            https://github.com/eerolanguage/llvm/tarball/${llvm_tag}:llvm \
32                        https://github.com/eerolanguage/clang/tarball/${clang_tag}:clang
33
34distfiles               llvm-${llvm_tag}${extract.suffix}:llvm \
35                        clang-${clang_tag}${extract.suffix}:clang
36
37checksums               llvm-${llvm_tag}${extract.suffix} \
38                        rmd160  7c29e09de9770e8f08119035fc34c0d164f5726f \
39                        sha256  49aad0faa72741a1fea3f24cf7954fde516e997be5b1a5527193ed8e8f24fdcc \
40                        clang-${clang_tag}${extract.suffix} \
41                        rmd160  a6b83d61f7c795d088e1d50c0fc139534bda424c \
42                        sha256  f96cc18c01c21859a3523cbcccc047b21f3f162d0677f32ac7503ade45245384
43
44
45dist_subdir             eero
46
47depends_lib             port:libffi
48
49default_variants        +analyzer
50
51post-extract {
52    move [glob ${workpath}/eerolanguage-llvm*] ${worksrcpath}
53    move [glob ${workpath}/eerolanguage-clang*] ${worksrcpath}/tools/clang
54}
55
56#patchfiles              tiger.patch  \
57#                        tiger-shlib.patch \
58#                        tiger-shlib-clang.patch \
59#                        scan-build-PR-35006.patch
60patch.pre_args          -p1
61
62build.env-append        VERBOSE=1 REQUIRE_RTTI=1
63destroot.env-append     VERBOSE=1 REQUIRE_RTTI=1
64configure.cppflags
65configure.ldflags
66configure.pre_args-delete --prefix=${prefix}
67configure.args          --enable-bindings=none --enable-libffi \
68                        --enable-shared --enable-jit \
69                        --enable-optimized --disable-profiling \
70                        --enable-debug-symbols --disable-debug-runtime \
71                        --prefix="${sub_prefix}" \
72                                                --enable-targets=x86,x86_64,arm,powerpc
73
74variant mp_ld64 description "uses MacPorts cctools ld64 - currently broken" {
75}
76
77# It seems only clang (>= 3.1 ?) can compile eero
78compiler.blacklist-append *gcc* {clang < 300}
79
80variant universal {
81    build.env-append \
82        UNIVERSAL=1 \
83        UNIVERSAL_ARCH="[get_canonical_archs]"
84    destroot.env-append \
85        UNIVERSAL=1 \
86        UNIVERSAL_ARCH="[get_canonical_archs]"
87}
88
89variant assertions description "Enable assertions for error detection (has performance impacts, especially on JIT)" {
90    configure.args-append --enable-assertions
91}
92
93platform darwin {
94        if {[variant_isset mp_ld64]} {
95                depends_run-append      port:ld64
96                depends_skip_archcheck-append ld64
97        }
98
99    if {${build_arch} eq "i386"} {
100        configure.pre_args-append --build=i686-apple-darwin${os.major}
101    } elseif {${build_arch} eq "ppc"} {
102        configure.pre_args-append --build=powerpc-apple-darwin${os.major}
103    } elseif {${build_arch} eq "ppc64"} {
104        configure.pre_args-append --build=powerpc64-apple-darwin${os.major}
105    } else {
106        configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
107    }
108
109    if {[string match "*ppc*" [get_canonical_archs]]} {
110        # http://trac.macports.org/ticket/33987
111        configure.args-append --with-optimize-option=-Os
112    }
113}
114
115platform darwin 8 {
116    # Tiger's DevTools make has issues with the nested ifs in compiler-rt
117    depends_build-append    port:gmake
118    build.cmd               ${prefix}/bin/gmake
119
120    post-configure {
121        reinplace "/^RPATH/s/=.*/=/" ${worksrcpath}/Makefile.config
122    }
123}
124
125variant arm_runtime description {Build and install the arm runtime for iOS development (requires iOS SDK)} {}
126
127variant analyzer description {Install clang static analyzer} {
128    depends_run-append  port:python27 port:perl5
129    post-patch {
130        reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5|g" \
131            ${worksrcpath}/tools/clang/tools/scan-build/ccc-analyzer \
132            ${worksrcpath}/tools/clang/tools/scan-build/c++-analyzer \
133            ${worksrcpath}/tools/clang/tools/scan-build/scan-build
134        reinplace "s|/usr/bin/env python|${prefix}/bin/python2.7|g" \
135            ${worksrcpath}/tools/clang/tools/scan-build/set-xcode-analyzer \
136            ${worksrcpath}/tools/clang/tools/scan-view/scan-view
137    }
138
139    post-destroot {
140        file mkdir ${destroot}${sub_prefix}/libexec
141        file copy ${worksrcpath}/tools/clang/tools/scan-build ${destroot}${sub_prefix}/libexec/scan-build
142        file copy ${worksrcpath}/tools/clang/tools/scan-view ${destroot}${sub_prefix}/libexec/scan-view
143
144        file delete -force ${destroot}${sub_prefix}/libexec/scan-build/.svn
145        file delete -force ${destroot}${sub_prefix}/libexec/scan-view/.svn
146        file delete -force ${destroot}${sub_prefix}/libexec/scan-view/Resources/.svn
147
148        ln -s ${sub_prefix}/libexec/scan-build/scan-build ${destroot}${sub_prefix}/bin/scan-build
149        ln -s ${sub_prefix}/libexec/scan-view/scan-view ${destroot}${sub_prefix}/bin/scan-view
150        ln -s ${sub_prefix}/bin ${destroot}${sub_prefix}/libexec/scan-build/bin
151    }
152}
153
154post-destroot {
155    # rename Clang as Eero
156    file rename ${destroot}${sub_prefix}/bin/clang \
157                ${destroot}${sub_prefix}/bin/eero
158    file delete ${destroot}${sub_prefix}/bin/clang++
159    file link   ${destroot}${sub_prefix}/bin/eero++ \
160                ${destroot}${sub_prefix}/bin/eero
161               
162        # Install just eero binaries, not llvm ones
163    foreach bin [glob ${destroot}${sub_prefix}/bin/*eero*] {
164        set bin_filename [string map \
165                 "${sub_prefix} ${prefix}" ${bin}]
166        set exec_path [string map "${destroot}${sub_prefix} ${sub_prefix}" ${bin}]
167
168        xinstall -m 755 "${filespath}/llvm-bin" "${bin_filename}"
169        reinplace "s:EXEC_PATH:${exec_path}:" "${bin_filename}"
170    }
171   
172    # http://trac.macports.org/ticket/33207
173        # This is borrowed from clang-3.2, but breaks linking with ld64 v.128
174        if {[variant_isset mp_ld64]} {
175                ln -s ${prefix}/libexec/ld64/ld ${destroot}${sub_prefix}/bin/ld
176        }
177
178    system "install_name_tool -id \
179        ${sub_prefix}/lib/libclang.dylib\
180        ${destroot}${sub_prefix}/lib/libclang.dylib"
181       
182    system "install_name_tool -id \
183        ${sub_prefix}/lib/libLLVM-3.4.1.dylib \
184        ${destroot}${sub_prefix}/lib/libLLVM-3.4.1.dylib"
185       
186    system "install_name_tool -change \
187        @executable_path/../lib/libLLVM-3.4.1.dylib \
188        ${sub_prefix}/lib/libLLVM-3.4.1.dylib \
189        ${destroot}${sub_prefix}/lib/libclang.dylib"
190}
Note: See TracBrowser for help on using the repository browser.