source: trunk/dports/games/moria/Portfile

Last change on this file was 146295, checked in by khindenburg@…, 21 months ago

moria: add patch to fix crash #43896

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 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 146295 2016-03-04 02:41:52Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                moria
7version             5.5.2
8revision            5
9categories          games
10platforms           darwin
11license             Restrictive/Distributable
12maintainers         nomaintainer
13
14description         Moria is a Rogue-like dungeon exploration game
15long_description    Moria is a Rogue-like dungeon exploration game similar to Angband.
16
17homepage            http://www-math.bgsu.edu/~grabine/moria.html
18master_sites        http://www.nic.funet.fi/pub/unix/games/${name}/source/
19
20checksums           rmd160  1556c76f151d7ea29da79071a57398f63d0b138b \
21                    sha256  fffab65703c77058a1aadd8647cc1f44bd4349065af0b334702986f36007b2ed
22
23extract.suffix      .tar.Z
24distname            um${version}
25worksrcdir          umoria
26
27patchfiles          patch-files.c.diff \
28                    patch-source_config.h.diff \
29                    patch-signals.c.diff \
30                    patch-types.h.diff
31
32build.dir           ${worksrcpath}/source
33build.target
34
35use_parallel_build  yes
36use_configure       no
37
38depends_lib-append  port:ncurses
39
40variant singleuser description {Disables system-wide scoreboards and allows local user installation without root privileges} {}
41
42pre-build {
43    if {![variant_isset singleuser]} {
44         addgroup games
45    }
46
47    xinstall -m 644 -W ${worksrcpath}/unix Makefile unix.c ${build.dir}
48
49    reinplace "s|^CC = cc|CC = ${configure.cc}|" ${build.dir}/Makefile
50    reinplace "s|CFLAGS = -O|CFLAGS = -O -I${prefix}/include -I${prefix}/include/ncurses|" ${build.dir}/Makefile
51    reinplace "s|LFLAGS =|LFLAGS = -L${prefix}/lib|" ${build.dir}/Makefile
52    reinplace "s|CURSES = -lcurses -ltermcap|CURSES = -lncurses|" ${build.dir}/Makefile
53    reinplace "s|/home/math/grabiner/moria/files|${prefix}/var/games/moria|" \
54        ${worksrcpath}/source/config.h
55}
56
57destroot {
58    if {![variant_isset singleuser]} {
59        xinstall -m 775 -g games -d ${destroot}${prefix}/var/games/moria
60        xinstall -m 2755 -g games -c ${worksrcpath}/source/moria ${destroot}${prefix}/bin
61    } else {
62        xinstall -m 775 -d ${destroot}${prefix}/var/games/moria
63        xinstall -m 755 -c ${worksrcpath}/source/moria ${destroot}${prefix}/bin
64    }
65
66    xinstall -m 444 -c ${worksrcpath}/files/hours ${destroot}${prefix}/var/games/moria
67    xinstall -m 444 -c ${worksrcpath}/files/news ${destroot}${prefix}/var/games/moria
68    xinstall -m 644 -c ${worksrcpath}/files/origcmds.hlp ${destroot}${prefix}/var/games/moria
69    xinstall -m 644 -c ${worksrcpath}/files/owizcmds.hlp ${destroot}${prefix}/var/games/moria
70    xinstall -m 644 -c ${worksrcpath}/files/roglcmds.hlp ${destroot}${prefix}/var/games/moria
71    xinstall -m 644 -c ${worksrcpath}/files/rwizcmds.hlp ${destroot}${prefix}/var/games/moria
72    xinstall -m 644 -c ${worksrcpath}/files/version.hlp ${destroot}${prefix}/var/games/moria
73    xinstall -m 644 -c ${worksrcpath}/files/welcome.hlp ${destroot}${prefix}/var/games/moria
74   
75    # Files required by license
76    xinstall -m 644 -c ${worksrcpath}/util/mergemem/README ${destroot}${prefix}/var/games/moria
77    xinstall -m 644 -c ${worksrcpath}/util/mergemem/moriadecode.c ${destroot}${prefix}/var/games/moria
78    xinstall -m 644 -c ${worksrcpath}/util/mergemem/moriaencode.c ${destroot}${prefix}/var/games/moria
79    xinstall -m 644 -c ${worksrcpath}/util/mergemem/moriamerge.c ${destroot}${prefix}/var/games/moria
80   
81}
82
83post-activate {
84    if {![file exists ${prefix}/var/games/moria/scores]} {
85        if {![variant_isset singleuser]} {
86            xinstall -m 464 -g games -c ${worksrcpath}/files/scores ${prefix}/var/games/moria/scores
87        } else {
88            xinstall -m 664 -c ${worksrcpath}/files/scores ${prefix}/var/games/moria/scores
89        }
90    }
91}
92
93livecheck.type      none
Note: See TracBrowser for help on using the repository browser.