Ticket #34001: Portfile.4

File Portfile.4, 4.8 KB (added by pusteblumekuchen@…, 13 years ago)
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$
3
4PortSystem      1.0
5name            widelands
6version         build17-rc2
7worksrcdir      ${distname}-src/build
8distfiles       ${distname}-src.tar.bz2
9use_bzip2       yes
10PortGroup       cmake 1.0
11categories      games
12license         GPL-2+
13platforms       darwin
14maintainers     nomaintainer
15description     Widelands is an open source real-time strategy game. It is built upon the SDL and other open source libraries and is (and will always be) under heavy development. If you knew Settlers I & II (© Bluebyte), then you already have a rough idea what Widelands is all about because widelands is heavily inspired by those two games.
16
17homepage        http://wl.widelands.org
18
19master_sites    https://launchpad.net/${name}/build17/${version}/+download/
20
21checksums       rmd160  98cfc877823cd1ca765be1ef9d8c59ad889cf5be \
22                sha256  5fb9f51ccde51c2854b4a8302cef9716cbe471dd7c6d57db66c745f8dc9489cc
23
24depends_lib     port:libsdl \
25                port:libsdl_image \
26                port:libsdl_mixer \
27                port:libsdl_net \
28                port:libsdl_ttf \
29                port:libsdl_gfx \
30                port:boost \
31                port:glew \
32                port:lua
33
34#https://bugs.launchpad.net/widelands/+bug/744595
35if {${configure.compiler} == "clang"} {
36    configure.compiler llvm-gcc-4.2
37}
38
39configure.args      ../ \
40                    -DCMAKE_INSTALL_PREFIX:PATH="${applications_dir}/Widelands.app/Contents/MacOS"
41
42pre-destroot {
43    file mkdir ${destroot}${applications_dir}/Widelands.app/
44    file mkdir ${destroot}${applications_dir}/Widelands.app/Contents/
45    file mkdir ${destroot}${applications_dir}/Widelands.app/Contents/Resources
46    file mkdir ${destroot}${applications_dir}/Widelands.app/MacOS/
47    file copy ${worksrcpath}/../pics/widelands.icns ${destroot}${applications_dir}/Widelands.app/Contents/Resources/widelands.icns
48    set data    " {\n\
49                CFBundleName = widelands;\n\
50                CFBundleDisplayName = Widelands;\n\
51                CFBundleIdentifier = \"org.widelands.wl\";\n\
52                CFBundleVersion = ${version};\n\
53                \"CFBundleInfoDictionaryVersion\" = \"6.0\";\n\
54                CFBundlePackageType = APPL;\n\
55                CFBundleSignature = \"????\";\n\
56                CFBundleExecutable = widelands;\n\
57                CFBundleIconFile = \"widelands.icns\";\n\
58                }"
59    set filename "${destroot}${applications_dir}/Widelands.app/Contents/Info.plist"
60    set fileId [open $filename "w"]
61    puts -nonewline $fileId $data
62    close $fileId
63}
64
65variant portable description {Don't depend on shared libraries, link static} {
66    configure.args-append \
67    -DSDL_LIBRARY:STRING="-L${prefix}/lib ${prefix}/lib/libSDLmain.a ${prefix}/lib/libSDL.a -Wl,${prefix}/lib/libX11.a -Wl,${prefix}/lib/libXext.a -Wl,${prefix}/lib/libXrandr.a -Wl,${prefix}/lib/libXrender.a -Wl,${prefix}/lib/libXdmcp.a -Wl,${prefix}/lib/libXau.a -Wl,${prefix}/lib/libxcb.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit" \
68    -DSDL_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
69    \
70    -DSDLIMAGE_LIBRARY:STRING="-Wl,${prefix}/lib/libSDL_image.a -Wl,${prefix}/lib/libjpeg.a -Wl,${prefix}/lib/libtiff.a" \
71    -DSDLIMAGE_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
72    \
73    -DPNG_LIBRARY:FILEPATH="${prefix}/lib/libpng.a" \
74    -DPNG_INCLUDE_DIR:PATH="${prefix}/include" \
75    \
76    -DSDLTTF_LIBRARY:STRING="-Wl,${prefix}/lib/libfreetype.a -Wl,${prefix}/lib/libbz2.a -Wl,${prefix}/lib/libSDL_ttf.a" \
77    -DSDLTTF_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
78    \
79    -DSDLGFX_LIBRARY:FILEPATH="${prefix}/lib/libSDL_gfx.a" \
80    -DSDLGFX_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
81    \
82    -DSDLMIXER_LIBRARY:STRING="-Wl,${prefix}/lib/libvorbisfile.a -Wl,${prefix}/lib/libogg.a -Wl,${prefix}/lib/libvorbis.a -Wl,${prefix}/lib/libSDL_mixer.a -Wl,${prefix}/lib/libsmpeg.a -Wl,${prefix}/lib/libFLAC.a  -Wl,${prefix}/lib/libFLAC++.a -Wl,${prefix}/lib/libmikmod.a" \
83    -DSDLMIXER_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
84    \
85    -DSDLNET_LIBRARY:FILEPATH="${prefix}/lib/libSDL_net.a" \
86    -DSDLNET_INCLUDE_DIR:PATH="${prefix}/include/SDL" \
87    \
88    -DINTL_LIBRARY:STRING="-Wl,${prefix}/lib/libiconv.a  -Wl,${prefix}/lib/libintl.a" \
89    -DINTL_INCLUDE_DIR:PATH="${prefix}/include" \
90    \
91    -DGLEW_LIBRARY:FILEPATH="${prefix}/lib/libGLEW.a" \
92    -DGLEW_INCLUDE_DIR:PATH="${prefix}/include/gl" \
93    \
94    -DZLIB_LIBRARY:FILEPATH="${prefix}/lib/libz.a" \
95    -DZLIB_INCLUDE_DIR:PATH="${prefix}/include" \
96    \
97    -DLUA_LIBRARIES:STRING="${prefix}/lib/liblua.a" \
98    -DLUA_INCLUDE_DIR:PATH="${prefix}/include" \
99    -DLUA_LIBRARY:FILEPATH="${prefix}/lib/liblua.a"
100}