source: trunk/dports/lang/dragonegg-3.4/Portfile

Last change on this file was 138252, checked in by ryandesign@…, 2 years ago

dragonegg-3.3-gcc-4.8, dragonegg-3.4-gcc-4.8: revbump for gcc48 @4.8.5 update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 138252 2015-07-03 06:18:30Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup select        1.0
6
7set llvm_version        3.4
8set llvm_version_no_dot 34
9name                    dragonegg-${llvm_version}
10
11subport                 ${name}-gcc-4.5 {
12    revision            3
13    set gcc_version     4.5
14    set gcc_version_no_dot 45
15}
16subport                 ${name}-gcc-4.6 {
17    revision            5
18    set gcc_version     4.6
19    set gcc_version_no_dot 46
20}
21subport                 ${name}-gcc-4.7 {
22    revision            6
23    set gcc_version     4.7
24    set gcc_version_no_dot 47
25}
26subport                 ${name}-gcc-4.8 {
27    revision            9
28    set gcc_version     4.8
29    set gcc_version_no_dot 48
30    #Fixing issue with TARGET_CPU_DEFAULT_max.
31    #see http://llvm.org/bugs/show_bug.cgi?id=18548
32    patchfiles-append   patch-CPU_DEFAULT.patch
33}
34
35dist_subdir             llvm
36categories              lang
37platforms               darwin
38maintainers             jeremyhu openmaintainer
39license                 GPL-2
40
41description             DragonEgg is a LLVM plug-in for GCC
42long_description        DragonEgg replaces GCC optimizers and code generators \
43                        by the LLVM optimizing infrastructure. It supersedes \
44                        llvm-gcc.
45
46homepage                http://dragonegg.llvm.org/
47
48if {${subport} eq ${name}} {
49version                 ${llvm_version}
50epoch                   1
51revision                1
52
53distfiles
54
55set gcc_version         4.6
56
57depends_run             port:${name}-gcc-${gcc_version}
58
59use_configure           no
60build                   {}
61destroot {
62    # For base
63    foreach binary {gcc cpp c++ g++ gcj gcov gfortran} {
64        ln -s dragonegg-${llvm_version}-${binary}-mp-${gcc_version} ${destroot}${prefix}/bin/dragonegg-${llvm_version}-${binary}
65    }
66}
67
68} else {
69
70depends_lib             port:llvm-${llvm_version} port:gcc${gcc_version_no_dot}
71depends_run             port:gcc_select
72
73# gcc needs to match our arch, not the other way around
74# We build +universal just fine in order to support whatever arch gcc is
75depends_skip_archcheck-append gcc${gcc_version_no_dot}
76
77#fetch.type              svn
78#svn.revision            198151
79#version                 ${llvm_version}-r${svn.revision}
80#worksrcdir              trunk
81#svn.url                 http://llvm.org/svn/llvm-project/dragonegg/trunk
82#worksrcdir              release_${llvm_version_no_dot}
83#svn.url                 http://llvm.org/svn/llvm-project/dragonegg/branches/release_${llvm_version_no_dot}
84
85version                 ${llvm_version}
86epoch                   1
87master_sites            http://llvm.org/releases/${version}/
88extract.suffix          .tar.gz
89distname                dragonegg-${version}.src
90worksrcdir              dragonegg-${version}
91checksums           sha1    afd845f591dc00dc058a3f901df6489e9b41102f \
92                    rmd160  0b4ef9f855eb2739ee619da0dac150b904a0be3a \
93                    sha256  34bf35c7d5f395fdc1e2a6b8ddbd83fc2e5027a895333efbe03cf8b5d767639c
94
95pre-fetch {
96    ui_msg "Please remember to keep dragonegg and llvm in phase by updating llvm-${llvm_version} first."
97}
98
99use_configure no
100
101select.group    gcc
102select.file     ${worksrcpath}/dragonegg-${llvm_version}-gcc${gcc_version_no_dot}
103
104build.target
105
106# g++-4.0 fails to build some of the newer C++ for ppc
107# Intel looks ok, but I prefer using gcc-4.2 for consistency
108compiler.blacklist gcc-4.0
109
110patchfiles-append missing-includes.patch
111
112post-extract {
113    file copy ${filespath}/dragonegg-select ${select.file}
114    reinplace "s:LLVM_VERSION:${llvm_version}:" ${select.file}
115    reinplace "s:GCC_VERSION:${gcc_version}:" ${select.file}
116}
117
118variant universal {
119    post-patch {
120        reinplace "/-MD -MP/d" ${worksrcpath}/Makefile
121    }
122}
123
124set cxx_stdlibflags {}
125if {[string match *clang* ${configure.cxx}]} {
126    set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
127}
128build.env-append \
129    ENABLE_LLVM_PLUGINS=1 \
130    LLVM_CONFIG=${prefix}/bin/llvm-config-mp-${llvm_version} \
131    GCC=${prefix}/bin/gcc-mp-${gcc_version} \
132    CC="${configure.cc} ${configure.cppflags} ${configure.cflags} [get_canonical_archflags cc]" \
133    CXX="${configure.cxx} ${configure.cppflags} ${configure.cxxflags} ${cxx_stdlibflags} [get_canonical_archflags cxx]"
134
135destroot {
136    xinstall -m 755 -d ${destroot}${prefix}/libexec/dragonegg
137    xinstall -m 755 ${worksrcpath}/dragonegg.so ${destroot}${prefix}/libexec/dragonegg/llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}.so
138    reinplace "s:dragonegg:llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}:" ${worksrcpath}/integrated-as.specs
139    xinstall -m 644 ${worksrcpath}/integrated-as.specs ${destroot}${prefix}/libexec/dragonegg/llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}-integrated-as.specs
140
141    foreach binary {gcc cpp c++ g++ gcj gcov gfortran} {
142        set path ${destroot}${prefix}/bin/dragonegg-${llvm_version}-${binary}-mp-${gcc_version}
143        xinstall -m 755 ${filespath}/dragonegg-gcc ${path}
144        reinplace "s:PLUGIN:${prefix}/libexec/dragonegg/llvm${llvm_version_no_dot}gcc${gcc_version_no_dot}.so:" ${path}
145        reinplace "s:PREFIX:${prefix}:" ${path}
146        reinplace "s:GCC_VERSION:${gcc_version}:" ${path}
147        reinplace "s:BINARY:${binary}:" ${path}
148    }
149}
150
151}
152
153livecheck.type          none
Note: See TracBrowser for help on using the repository browser.