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 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup muniversal 1.0 |
---|
6 | |
---|
7 | name cmake |
---|
8 | version 3.0.2 |
---|
9 | revision 2 |
---|
10 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
11 | categories devel |
---|
12 | license BSD |
---|
13 | installs_libs no |
---|
14 | maintainers css |
---|
15 | description Cross-platform make |
---|
16 | long_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. |
---|
20 | homepage http://www.cmake.org/ |
---|
21 | master_sites http://www.cmake.org/files/v${branch}/ |
---|
22 | platforms darwin freebsd |
---|
23 | |
---|
24 | checksums rmd160 b94ea2ed4dced373e289fa5f66674a227135f350 \ |
---|
25 | sha256 6b4ea61eadbbd9bec0ccb383c29d1f4496eacc121ef7acf37c7a24777805693e |
---|
26 | |
---|
27 | depends_lib-append port:libidn \ |
---|
28 | port:openssl \ |
---|
29 | port:curl \ |
---|
30 | port:expat \ |
---|
31 | port:zlib \ |
---|
32 | port:bzip2 \ |
---|
33 | port:libarchive |
---|
34 | |
---|
35 | patchfiles 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 | |
---|
41 | configure.env-append \ |
---|
42 | CMAKE_PREFIX_PATH=${prefix} \ |
---|
43 | CMAKE_INCLUDE_PATH=${prefix}/include/ncurses \ |
---|
44 | CMAKE_LIBRARY_PATH=${prefix}/lib |
---|
45 | |
---|
46 | configure.args --mandir=/share/man --docdir=/share/doc/cmake \ |
---|
47 | --parallel=${build.jobs} \ |
---|
48 | --init=${worksrcpath}/macports.cmake \ |
---|
49 | --system-libs |
---|
50 | |
---|
51 | configure.universal_args |
---|
52 | configure.post_args |
---|
53 | |
---|
54 | # Leopard's Rosetta has some difficulties configuring the ppc slice |
---|
55 | platform 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 | |
---|
65 | platform 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 | |
---|
72 | post-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 | |
---|
81 | post-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 | |
---|
102 | variant 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 | |
---|
108 | variant 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 | |
---|
113 | default_variants +doc |
---|
114 | |
---|
115 | livecheck.type regex |
---|
116 | livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix} |
---|
117 | livecheck.url [lindex $master_sites 0] |
---|