source: trunk/dports/games/simutrans/Portfile

Last change on this file was 115075, checked in by jmr@…, 4 years ago

simutrans: does not link with libpng

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
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 115075 2013-12-23 22:57:09Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                simutrans
7version             112.0
8set branch          [join [lrange [split ${version} .] 0 1] .]
9set my_version      [strsed ${version} {g/\./-/}]
10set my_branch       [strsed ${branch} {g/\./-/}]
11categories          games
12license             Artistic-1 MIT
13platforms           darwin
14maintainers         nomaintainer
15description         Simutrans is a freeware transport simulation game.
16long_description    Simutrans Transport Simulator (short: Simutrans) is a \
17                    freeware simulation game for Windows, BeOS, Mac OS X and \
18                    Linux that focuses on the transporting of goods, people, \
19                    mail and power. It was originally written by Hansjörg \
20                    Malthaner, and is now maintained and developed by a \
21                    small team.
22
23homepage            http://www.simutrans.com/
24use_zip             yes
25
26extract.mkdir       yes
27
28use_configure       no
29
30set data_dir        ${prefix}/share/${name}
31
32if {${name} eq ${subport}} {
33    PortGroup           app 1.0
34   
35    revision            1
36   
37    master_sites        sourceforge:project/simutrans/simutrans/${my_version}
38   
39    distname            ${name}-src-${my_version}
40   
41    checksums           rmd160  82352f6509e4f9d8402cefb31b7fa7e4dbc228b7 \
42                        sha256  1f8c067290c7a286ddddbae41ba3cc4997a0e51d1d0dcbe57120a715d904791e
43   
44    depends_build       port:pkgconfig
45   
46    depends_lib         port:libsdl \
47                        port:zlib
48   
49    post-extract {
50        copy -force ${worksrcpath}/config.template ${worksrcpath}/config.default
51        copy -force ${filespath}/simutrans.in ${worksrcpath}/simutrans-wrapper
52    }
53   
54    patchfiles          patch-config.default.diff \
55                        patch-Makefile.diff \
56                        patch-simtypes.h.diff
57   
58    post-patch {
59        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Makefile
60        reinplace "s|__DATA_DIR__|${data_dir}|g" ${worksrcpath}/simutrans-wrapper
61    }
62   
63    build.args          CC="${configure.cc} [get_canonical_archflags cc]" \
64                        CXX="${configure.cxx} [get_canonical_archflags cxx]"
65   
66    destroot {
67        # Install the simutrans data.
68        copy ${worksrcpath}/${name} ${destroot}${data_dir}
69       
70        # Install the simutrans binary. It has to be in the same directory
71        # as the data.
72        xinstall ${worksrcpath}/build/default/sim ${destroot}${data_dir}
73   
74        # Install the wrapper script.
75        xinstall ${worksrcpath}/simutrans-wrapper ${destroot}${prefix}/bin/simutrans
76    }
77   
78    app.icon            simutrans.ico
79   
80    # Legacy compatibility variant added 2012-04-22
81    variant enable_music requires music description {legacy compatibility variant} {}
82    variant music description {allow listening to simutrans music while playing (may reduce speed)} {
83        depends_lib-append  port:libsdl_mixer
84        post-patch {
85            reinplace "s|#BACKEND = mixer_sdl|BACKEND = mixer_sdl|g" \
86                ${worksrcpath}/config.default
87        }
88    }
89   
90    variant pak64 description {Install the 64x64 graphics pak} {
91        depends_run-append port:simutrans-pak64
92        notes-append "
93${name} is installed with the default pak64 image set.\
94If you want to use another pak, download it (for example from\
95http://www.simutrans.com/paksets.htm) and put it into\
96${data_dir}.
97"
98    }
99   
100    if {![variant_isset pak64]} {
101        default_variants +pak64
102    }
103   
104    platform powerpc {
105        patchfiles-append patch-powerpc.diff
106    }
107}
108
109subport simutrans-pak64 {
110    version             ${branch}
111    revision            0
112    supported_archs     noarch
113   
114    description         Standard 64x64 graphics for simutrans
115   
116    long_description    ${description}
117   
118    master_sites        sourceforge:project/simutrans/pak64/${my_branch}
119   
120    distname            simupak64-${my_branch}
121   
122    checksums           rmd160  ec268f1367d3b07f93b59a31e34f4b6be531f63e \
123                        sha256  a58052627e4f4257a8b0abd1622507aa5893ab13ebf38407bf43533b3b228719
124   
125    post-extract {
126        fs-traverse item ${worksrcpath} {
127            if {[file isdirectory ${item}]} {
128                file attributes ${item} -permissions 0755
129            } elseif {[file isfile ${item}]} {
130                file attributes ${item} -permissions 0644
131            }
132        }
133    }
134   
135    build {}
136   
137    destroot {
138        copy ${worksrcpath}/${name} ${destroot}${data_dir}
139    }
140   
141    # Deactivate old simutrans port that had an integrated pak64 that would conflict.
142    # Legacy port deactivation hack added 2012-04-22.
143    pre-activate {
144        if {[file exists ${prefix}/bin/simutrans]
145            && ![catch {set vers [lindex [registry_active simutrans] 0]}]
146            && [vercmp [lindex $vers 1] 111.2.2] < 0} {
147            registry_deactivate_composite simutrans "" [list ports_nodepcheck 1]
148        }
149    }
150}
151
152livecheck.version       ${my_version}
153livecheck.regex         /${name}-src-(\[0-9.-\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.