Changeset 97614


Ignore:
Timestamp:
Sep 9, 2012, 11:16:08 PM (7 years ago)
Author:
jeremyhu@…
Message:

{clang,dragonegg,llvm}-3.2: Bump to r163481 and move clang-3.2 to be a subport of llvm-3.2

Location:
trunk/dports/lang
Files:
6 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/dragonegg-3.2/Portfile

    r97523 r97614  
    3030
    3131fetch.type              svn
    32 svn.revision            163429
     32svn.revision            163481
    3333version                 ${llvm_version}-r${svn.revision}
    3434worksrcdir              trunk
  • trunk/dports/lang/llvm-3.2/Portfile

    r97523 r97614  
    55
    66set llvm_version        3.2
    7 revision                0
    87name                    llvm-${llvm_version}
     8subport                 clang-${llvm_version} {}
    99set suffix              mp-${llvm_version}
    10 set sub_prefix          ${prefix}/libexec/${name}
     10set sub_prefix          ${prefix}/libexec/llvm-${llvm_version}
    1111dist_subdir             llvm
    1212categories              lang
     
    1414license                 NCSA
    1515maintainers             jeremyhu openmaintainer
    16 description             llvm is a next generation compiler infrastructure (svn trunk version)
    17 long_description        The LLVM Core libraries provide a modern source- and \
     16
     17if {${subport} == "llvm-${llvm_version}"} {
     18    homepage            http://llvm.org/
     19    description         llvm is a next generation compiler infrastructure (svn trunk version)
     20    long_description    The LLVM Core libraries provide a modern source- and \
    1821                        target-independent optimizer, along with code \
    1922                        generation support for many popular CPUs (as well as \
     
    2225                        the LLVM intermediate representation ("LLVM IR").
    2326
    24 homepage                http://llvm.org/
    25 
    26 depends_lib             port:libffi
    27 depends_run             bin:perl:perl5 port:llvm_select
     27    depends_lib         port:libffi
     28    depends_run         bin:perl:perl5 port:llvm_select
     29} elseif {${subport} == "clang-${llvm_version}"} {
     30    homepage            http://clang.llvm.org/
     31    description         C, C++, Objective C and Objective C++ compiler
     32    long_description    Clang is an "LLVM native" C/C++/Objective-C compiler, \
     33                        which aims to deliver amazingly fast compiles (e.g. \
     34                        about 3x faster than GCC when compiling Objective-C \
     35                        code in a debug configuration), extremely useful error \
     36                        and warning messages and to provide a platform for \
     37                        building great source level tools. The included Clang \
     38                        Static Analyzer is a tool automatically finds bugs in \
     39                        your code, and is a great example of the sort of tool \
     40                        that can be built using the Clang frontend as a \
     41                        library to parse C/C++ code.
     42
     43    depends_lib         port:llvm-${llvm_version} port:libffi
     44    depends_run         port:clang_select port:ld64
     45    depends_skip_archcheck-append ld64
     46
     47    default_variants    +analyzer
     48}
    2849
    2950fetch.type              svn
    30 svn.revision            163429
     51svn.revision            163481
     52set compiler_rt_rev     ${svn.revision}
     53set libcxx_rev          ${svn.revision}
    3154version                 ${llvm_version}-r${svn.revision}
    3255worksrcdir              trunk
     
    3760
    3861#version                 ${llvm_version}
     62#set compiler_rt_rev     150641
     63#set libcxx_rev          ${compiler_rt_rev}
    3964#epoch                   1
    40 #master_sites            ${homepage}releases/${version}/
     65#master_sites            http://llvm.org/releases/${version}
    4166#extract.suffix          .tar.gz
    42 #distname                llvm-${version}.src
    43 
    44 patchfiles      tiger.patch \
     67#distfiles               llvm-${version}.src${extract.suffix}
     68#worksrcdir              llvm-${version}.src
     69
     70patchfiles      install_target.patch \
     71                tiger.patch \
    4572                tiger-shlib.patch
     73
    4674patch.pre_args  -p1
     75
     76if {${subport} == "clang-${llvm_version}"} {
     77    if {${distfiles} != ""} {
     78        distfiles-append     clang-${version}.src${extract.suffix} compiler-rt-${version}.src${extract.suffix}
     79    }
     80
     81    patchfiles-append    tiger-shlib-clang.patch tiger-libclang.patch scan-build-PR-35006.patch
     82
     83    build.target        clang-only
     84    destroot.target     install-clang
     85}
    4786
    4887build.env-append        VERBOSE=1 REQUIRE_RTTI=1
     
    5695                        --prefix="${sub_prefix}"
    5796
    58 select.group    llvm
    59 select.file     ${filespath}/mp-${name}
     97if {${subport} == "llvm-${llvm_version}"} {
     98    select.group        llvm
     99    select.file         ${filespath}/mp-${subport}
     100} elseif {${subport} == "clang-${llvm_version}"} {
     101    select.group        clang
     102    select.file         ${filespath}/mp-${subport}
     103}
    60104
    61105# g++-4.0 fails to build some of the newer C++ for ppc
     
    109153    }
    110154
    111     post-destroot {
     155    if {${subport} == "clang-${llvm_version}" && ${os.major} <= 9} {
     156        patchfiles-append leopard-no-asan.patch
     157    }
     158}
     159
     160platform darwin 8 {
     161    # Tiger's DevTools make has issues with the nested ifs in compiler-rt
     162    depends_run-append      port:gmake
     163    depends_skip_archcheck-append gmake
     164    build.cmd               ${prefix}/bin/gmake
     165    destroot.cmd            ${prefix}/bin/gmake
     166
     167    post-configure {
     168        reinplace "/^RPATH/s/=.*/=/" ${worksrcpath}/Makefile.config
     169    }
     170}
     171
     172post-extract {
     173    if {${subport} == "clang-${llvm_version}"} {
     174        system "cd ${worksrcpath}/tools && svn co -r ${svn.revision} http://llvm.org/svn/llvm-project/cfe/trunk clang"
     175        #system "cd ${worksrcpath}/tools && svn co -r ${svn.revision} http://llvm.org/svn/llvm-project/cfe/branches/release_32 clang"
     176        #file rename ${workpath}/clang-${llvm_version}.src ${worksrcpath}/tools/clang
     177
     178        system "cd ${worksrcpath}/projects && svn co -r ${compiler_rt_rev} http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt"
     179        #system "cd ${worksrcpath}/projects && svn co -r ${compiler_rt_rev} http://llvm.org/svn/llvm-project/compiler-rt/branches/release_32 compiler-rt"
     180        #file rename ${workpath}/compiler-rt-${llvm_version}.src ${worksrcpath}/projects/compiler-rt
     181
     182        system "cd ${worksrcpath}/projects && svn co -r ${libcxx_rev} http://llvm.org/svn/llvm-project/libcxx/trunk libcxx"
     183        #system "cd ${worksrcpath}/projects && svn co -r ${libcxx_rev} http://llvm.org/svn/llvm-project/libcxx/branches/release_32 libcxx"
     184        #file rename ${workpath}/libcxx-${llvm_version}.src ${worksrcpath}/projects/libcxx
     185    }
     186}
     187
     188post-patch {
     189    if {${subport} == "clang-${llvm_version}"} {
     190        # http://trac.macports.org/ticket/33272
     191        if {![variant_isset arm_runtime]} {
     192            reinplace {/^SubDirs/ s/arm//} ${worksrcpath}/projects/compiler-rt/lib/Makefile.mk
     193            reinplace {/^UniversalArchs/ s/arm[^ )]* *//g} ${worksrcpath}/projects/compiler-rt/make/platform/clang_darwin.mk
     194        }
     195    }
     196}
     197
     198post-destroot {
     199    file mkdir ${destroot}${prefix}/share/doc
     200    file rename ${destroot}${sub_prefix}/docs/llvm ${destroot}${prefix}/share/doc/${subport}
     201
     202    foreach bin [glob ${destroot}${sub_prefix}/bin/*] {
     203        set bin_filename [string map "${sub_prefix} ${prefix}" ${bin}]-${suffix}
     204        set exec_path [string map "${destroot}${sub_prefix} ${sub_prefix}" ${bin}]
     205
     206        xinstall -m 755 "${filespath}/llvm-bin" "${bin_filename}"
     207        reinplace "s:EXEC_PATH:${exec_path}:" "${bin_filename}"
     208    }
     209
     210    if {${subport} == "llvm-${llvm_version}"} {
     211        # r156389 (a5d2435409858728970202226d0bbbee508fe408) temporarilary removed llvm man pages
     212        #foreach man [glob ${destroot}${sub_prefix}/share/man/man1/*.1] {
     213        #    set basename [string map "${destroot}${sub_prefix}/share/man/man1/ {}" ${man}]
     214        #    file rename ${man} ${destroot}${prefix}/share/man/man1/[string map ".1 -${suffix}.1" ${basename}]
     215        #}
     216
    112217        foreach liba [glob ${destroot}${sub_prefix}/lib/*dylib] {
    113218            set liba_nodr [string map "${destroot} {}" ${liba}]
     
    121226            }
    122227        }
    123     }
    124 }
    125 
    126 platform darwin 8 {
    127     post-configure {
    128         reinplace "/^RPATH/s/=.*/=/" ${worksrcpath}/Makefile.config
    129     }
    130 }
    131 
    132 variant ocaml description {Enable generation of OCaml binding} {
    133     depends_lib-append   port:ocaml
    134 
    135     configure.args-delete --enable-bindings=none
    136     configure.args-append --enable-bindings=ocaml
    137 
    138     destroot.args-append  OVERRIDE_libdir=${sub_prefix}/lib
    139 }
    140 
    141 post-destroot {
    142     file mkdir ${destroot}${prefix}/share/doc
    143     file rename ${destroot}${sub_prefix}/docs/llvm ${destroot}${prefix}/share/doc/${name}
    144 
    145     # r156389 (a5d2435409858728970202226d0bbbee508fe408) temporarilary removed llvm man pages
    146     #foreach man [glob ${destroot}${sub_prefix}/share/man/man1/*.1] {
    147     #    set basename [string map "${destroot}${sub_prefix}/share/man/man1/ {}" ${man}]
    148     #    file rename ${man} ${destroot}${prefix}/share/man/man1/[string map ".1 -${suffix}.1" ${basename}]
    149     #}
    150 
    151     foreach bin [glob ${destroot}${sub_prefix}/bin/*] {
    152         set bin_filename [string map "${sub_prefix} ${prefix}" ${bin}]-${suffix}
    153         set exec_path [string map "${destroot}${sub_prefix} ${sub_prefix}" ${bin}]
    154 
    155         xinstall -m 755 "${filespath}/llvm-bin" "${bin_filename}"
    156         reinplace "s:EXEC_PATH:${exec_path}:" "${bin_filename}"
    157     }
    158 }
     228    } elseif {${subport} == "clang-${llvm_version}"} {
     229        system "ditto ${worksrcpath}/projects/libcxx/include ${destroot}${sub_prefix}/lib/c++/v1"
     230
     231        # http://trac.macports.org/ticket/33207
     232        ln -s ${prefix}/libexec/ld64/ld ${destroot}${sub_prefix}/bin/ld
     233
     234        system "install_name_tool -id ${sub_prefix}/lib/libclang.dylib ${destroot}${sub_prefix}/lib/libclang.dylib"
     235        system "install_name_tool -change @executable_path/../lib/libLLVM-${llvm_version}svn.dylib ${sub_prefix}/lib/libLLVM-${llvm_version}svn.dylib ${destroot}${sub_prefix}/lib/libclang.dylib"
     236    }
     237}
     238
     239if {${subport} == "llvm-${llvm_version}"} {
     240    variant ocaml description {Enable generation of OCaml binding} {
     241        depends_lib-append   port:ocaml
     242
     243        configure.args-delete --enable-bindings=none
     244        configure.args-append --enable-bindings=ocaml
     245
     246        destroot.args-append  OVERRIDE_libdir=${sub_prefix}/lib
     247    }
     248} elseif {${subport} == "clang-${llvm_version}"} {
     249    variant arm_runtime description {Build and install the arm runtime for iOS development (requires iOS SDK)} {}
     250
     251    set pythonver ""
     252    set pythonverdot ""
     253
     254    if {![variant_isset python25] && ![variant_isset python26]} {
     255        default_variants +python27
     256    }
     257
     258    variant python25 conflicts python26 python27 description {Use python 2.5} {
     259        set pythonver 25
     260        set pythonverdot 2.5
     261    }
     262
     263    variant python26 conflicts python25 python27 description {Use python 2.6} {
     264        set pythonver 26
     265        set pythonverdot 2.6
     266    }
     267
     268    variant python27 conflicts python25 python26 description {Use python 2.7} {
     269        set pythonver 27
     270        set pythonverdot 2.7
     271    }
     272
     273    variant analyzer description {Install clang static analyzer} {
     274        if {[string equal "${pythonver}" ""]} {
     275            ui_error "You mush select a python variant to use the clang static analyzer (+analyzer)"
     276            error "Invalid variant combination"
     277        }
     278
     279        depends_run-append port:perl5 port:python${pythonver}
     280
     281        post-patch {
     282            reinplace "s|/usr/bin/env perl|${prefix}/bin/perl5|g" \
     283                ${worksrcpath}/tools/clang/tools/scan-build/ccc-analyzer \
     284                ${worksrcpath}/tools/clang/tools/scan-build/c++-analyzer \
     285                ${worksrcpath}/tools/clang/tools/scan-build/scan-build
     286            reinplace "s|/usr/bin/env python|${prefix}/bin/python${pythonverdot}|g" \
     287                ${worksrcpath}/tools/clang/tools/scan-build/set-xcode-analyzer \
     288                ${worksrcpath}/tools/clang/tools/scan-view/scan-view
     289        }
     290
     291        post-destroot {
     292            file mkdir ${destroot}${sub_prefix}/libexec
     293            file copy ${worksrcpath}/tools/clang/tools/scan-build ${destroot}${sub_prefix}/libexec/scan-build
     294            file copy ${worksrcpath}/tools/clang/tools/scan-view ${destroot}${sub_prefix}/libexec/scan-view
     295
     296            file delete -force ${destroot}${sub_prefix}/libexec/scan-build/.svn
     297            file delete -force ${destroot}${sub_prefix}/libexec/scan-view/.svn
     298            file delete -force ${destroot}${sub_prefix}/libexec/scan-view/Resources/.svn
     299
     300            ln -s ${sub_prefix}/libexec/scan-build/scan-build ${destroot}${sub_prefix}/bin/scan-build
     301            ln -s ${sub_prefix}/libexec/scan-view/scan-view ${destroot}${sub_prefix}/bin/scan-view
     302            ln -s ${sub_prefix}/bin ${destroot}${sub_prefix}/libexec/scan-build/bin
     303
     304            xinstall -m 755 "${filespath}/llvm-bin" "${destroot}${prefix}/bin/scan-build-${suffix}"
     305            reinplace "s:EXEC_PATH:${sub_prefix}/bin/scan-build:" "${destroot}${prefix}/bin/scan-build-${suffix}"
     306
     307            xinstall -m 755 "${filespath}/llvm-bin" "${destroot}${prefix}/bin/scan-view-${suffix}"
     308            reinplace "s:EXEC_PATH:${sub_prefix}/bin/scan-view:" "${destroot}${prefix}/bin/scan-view-${suffix}"
     309        }
     310    }
     311}
Note: See TracChangeset for help on using the changeset viewer.