Ticket #24978: Portfile

File Portfile, 3.1 KB (added by aeppert@…, 14 years ago)
Line 
1
2PortSystem 1.0
3
4name                    llvm
5version                 2.7
6revision                1
7categories              lang
8platforms               darwin
9use_parallel_build      yes
10maintainers             erickt openmaintainer
11description             llvm is a next generation compiler infrastructure
12long_description        llvm brings tools to work on the llvm intermediate \
13                        language incl. a C and C++ frontend.
14
15homepage                http://llvm.org/
16master_sites            ${homepage}releases/${version}/
17
18extract.suffix          .tgz
19
20checksums               md5     ac322661f20e7d6c810b1869f886ad9b \
21                        sha1    059fc21b0ec1b649c4a3dec81756e5f92aa131a2 \
22                        rmd160  0fa2f362dd6a45efec35ce8fa0f8d36d98f32c8f
23
24depends_lib             path:bin/perl:perl5
25
26universal_variant       no
27
28configure.dir           ${workpath}/build
29build.dir               ${configure.dir}
30destroot.dir            ${configure.dir}
31
32post-extract {
33    file mkdir ${configure.dir}
34}
35
36patchfiles              patch-Makefile.config.in.diff \
37                        patch-Makefile.ocaml.diff
38
39configure.cppflags
40configure.ldflags
41configure.cmd           ${worksrcpath}/configure
42configure.args          --enable-optimized --enable-jit \
43                        --enable-bindings=none \
44                        --disable-assertions
45
46if {[info exists build_arch] && ${os.platform} == "darwin"} {
47    configure.args-append --build=${build_arch}-apple-darwin${os.major}
48}
49
50post-destroot {
51    file mkdir ${destroot}${prefix}/lib/llvm
52    file mkdir ${destroot}${prefix}/lib/llvm/src
53    file mkdir ${destroot}${prefix}/lib/llvm/obj
54
55    file copy ${worksrcpath}/include ${destroot}${prefix}/lib/llvm/src
56    file copy ${configure.dir}/include ${destroot}${prefix}/lib/llvm/obj
57    file copy ${configure.dir}/Release-Asserts ${destroot}${prefix}/lib/llvm/obj
58
59    reinplace "s|${worksrcpath}|${prefix}/lib/llvm/src|g"       ${destroot}${prefix}/bin/llvm-config \
60                                                                ${destroot}${prefix}/lib/llvm/obj/Release-Asserts/bin/llvm-config
61    reinplace "s|${configure.dir}|${prefix}/lib/llvm/obj|g"     ${destroot}${prefix}/bin/llvm-config \
62                                                                ${destroot}${prefix}/lib/llvm/obj/Release-Asserts/bin/llvm-config
63
64    fs-traverse item ${destroot} {
65        if {[file isfile ${item}] && ".dir" == [file tail ${item}]} {
66            delete ${item}
67        }
68    }
69}
70
71variant ocaml description {Enable generation of OCaml binding} {
72    depends_build-append port:ocaml
73    depends_lib-append   port:ocaml
74
75    configure.args-delete --enable-bindings=none
76    configure.args-append --enable-bindings=ocaml
77
78    destroot.args-append  OVERRIDE_libdir=${prefix}/lib
79}
80
81variant disable_pic description {Disable generation of position independent code} {
82    configure.args-append --disable-pic
83}
84
85variant host_only description {Disables non-host targets} {
86    configure.args-append --enable-targets=host-only
87}
88
89livecheck.type  regex
90livecheck.url   ${homepage}releases/
91livecheck.regex {llvm-(0-9.)+)\.tgz}
92