Ticket #46169: Portfile

File Portfile, 4.7 KB (added by jonathanrmadsen@…, 9 years ago)

Modified Portfile

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 127220 2014-10-23 18:57:44Z jmr@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                cmake
8version             3.0.2
9revision            2
10set branch          [join [lrange [split ${version} .] 0 1] .]
11categories          devel
12license             BSD
13installs_libs       no
14maintainers         css
15description         Cross-platform make
16long_description    An extensible, open-source system that manages the build    \
17                    process in an operating system and compiler independent manner. \
18                    Unlike many cross-platform systems, CMake is designed to be     \
19                    used in conjunction with the native build environment.
20homepage            http://www.cmake.org/
21master_sites        http://www.cmake.org/files/v${branch}/
22platforms           darwin freebsd
23
24checksums           rmd160  b94ea2ed4dced373e289fa5f66674a227135f350 \
25                    sha256  6b4ea61eadbbd9bec0ccb383c29d1f4496eacc121ef7acf37c7a24777805693e
26
27depends_lib-append  port:libidn \
28                    port:openssl \
29                    port:curl \
30                    port:expat \
31                    port:zlib \
32                    port:bzip2 \
33                    port:libarchive
34
35patchfiles          patch-CMakeFindFrameworks.cmake.diff \
36                    patch-Modules-FindFreetype.cmake.diff \
37                    patch-Modules-FindQt4.cmake.diff \
38                    patch-Modules-Platform-Darwin.cmake.diff \
39                    patch-Modules-noArchCheck.diff
40
41configure.env-append \
42                    CMAKE_PREFIX_PATH=${prefix} \
43                    CMAKE_INCLUDE_PATH=${prefix}/include/ncurses \
44                    CMAKE_LIBRARY_PATH=${prefix}/lib
45
46configure.args      --mandir=/share/man --docdir=/share/doc/cmake \
47                    --parallel=${build.jobs} \
48                    --init=${worksrcpath}/macports.cmake \
49                    --system-libs
50
51configure.universal_args
52configure.post_args
53
54# Leopard's Rosetta has some difficulties configuring the ppc slice
55platform darwin 9 {
56    global universal_archs_supported
57    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
58        supported_archs i386 x86_64
59    } elseif {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
60        supported_archs ppc ppc64
61    }
62    set universal_archs_supported ${supported_archs}
63}
64
65platform darwin 11 {
66    # TODO: Figure out why using libc++ fails.
67    #       Since nothing links against cmake and cmake is just using
68    #       the STL, we're safe to force libstdc++
69    configure.cxx_stdlib libstdc++
70}
71
72post-patch {
73    # copy cmake init file, ready to be patched below
74    copy ${filespath}/macports.cmake ${worksrcpath}
75
76    # patch PREFIX
77    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/macports.cmake
78    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Modules/CMakeFindFrameworks.cmake
79}
80
81post-destroot {
82    xinstall -d -m 0755 ${destroot}${prefix}/share/emacs/site-lisp
83    xinstall -m 0644 ${worksrcpath}/Auxiliary/cmake-mode.el \
84        ${destroot}${prefix}/share/emacs/site-lisp
85    foreach type {syntax indent} {
86        xinstall -d -m 0755 ${destroot}${prefix}/share/vim/vimfiles/${type}
87        xinstall -m 0644 -W ${worksrcpath}/Auxiliary cmake-${type}.vim \
88            ${destroot}${prefix}/share/vim/vimfiles/${type}
89    }
90    if ([variant_isset gui]) {
91        set app CMake
92        xinstall -d ${destroot}${applications_dir}/${app}.app/Contents/MacOS \
93            ${destroot}${applications_dir}/${app}.app/Contents/Resources
94        xinstall -m 644 ${filespath}/Info.plist.in ${destroot}${applications_dir}/${app}.app/Contents/Info.plist
95        reinplace "s|@VERSION@|${version}|g" ${destroot}${applications_dir}/${app}.app/Contents/Info.plist
96        reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${applications_dir}/${app}.app/Contents/Info.plist
97        ln -s ${prefix}/bin/cmake-gui ${destroot}${applications_dir}/${app}.app/Contents/MacOS/cmake-gui
98        xinstall -m 644 ${worksrcpath}/Source/QtDialog/CMakeSetup.icns ${destroot}${applications_dir}/${app}.app/Contents/Resources/CMakeSetup.icns
99    }
100}
101
102variant gui description {Qt4 based cmake-gui} {
103    PortGroup qt4 1.0
104    patchfiles-append patch-CMakeLists.txt.diff
105    configure.args-append --qt-gui --qt-qmake=${qt_qmake_cmd}
106}
107
108variant doc description {Build HTML and manual pages documentation} {
109    depends_lib-append port:py-sphinx
110    configure.args-append --sphinx-man --sphinx-html
111}
112
113default_variants +doc
114
115livecheck.type      regex
116livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
117livecheck.url       [lindex $master_sites 0]