summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 05a31f7b00ddfcbc4a43195cdb4a197a5bdc284b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Dmitry Kharitonov <arch[at]nano-model[dot]com>

pkgname=bcrawl-git
_pkgname=bcrawl
pkgver=1.34.4.r820.g4a8afe7
pkgrel=2
pkgdesc='Continuation of X-Crawl fork of Dungeon Crawl Stone Soup roguelike with new content (Git version)'
arch=('i686' 'x86_64')
url='https://github.com/b-crawl/bcrawl'
depends=('lua51' 'sdl2_image' 'sqlite' 'glu' 'ttf-dejavu' 'freetype2')
makedepends=('git' 'flex' 'gendesk' 'mesa')
optdepends=('advancecomp: for recompressing the tilesheets'
            'pngcrush: for recompressing the tilesheets')
conflicts=('crawl' 'stone-soup-tile' 'bcrawl')
provides=('bcrawl')
license=('GPL' 'BSD' 'MIT' 'ZLIB' 'APACHE' 'custom:CC0' 'custom')
source=("git+https://github.com/b-crawl/bcrawl.git")
sha256sums=('SKIP')

# used by gendesk to create .desktop file
_exec=('bcrawl-tiles')
_name=('Dungeon Crawl Stone Soup (bcrawl fork)')

pkgver() {
    cd "$srcdir"/bcrawl
    git describe --long --abbrev=7 | sed 's/^bcrawl-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
    cd "$srcdir"
    gendesk -f -n --pkgname "$_pkgname" --pkgdesc "$pkgdesc" \
            --exec 'bcrawl-tiles' --name 'Dungeon Crawl Stone Soup (bcrawl fork)' PKGBUILD

    cd "$srcdir/bcrawl/crawl-ref/source"

    # 0.16.0 weirdness
    sed -i 's|SDL_main.h|SDL2/&|' main.cc

    # git tarball weirdness
    echo "$pkgver" > util/release_ver

    # adjust makefile to use /usr/bin, owner root:root,
    # disable setgid on executable

    sed -i 's|bin_prefix    := bin|bin_prefix    := usr/bin|' Makefile
    sed -i 's/INSTALL_UGRP := games:games/INSTALL_UGRP := root:root/' Makefile
    sed -i 's|MCHMOD := 2755|MCHMOD := 755|' Makefile

    # first build and install tiles version

    make GAME=bcrawl \
         DESTDIR="${pkgdir}" \
         DATADIR="/usr/share/${_pkgname}/data" \
         SAVEDIR="~/.bcrawl" \
         USE_UNICODE=y \
         TILES=y \
         install

    # rename tiles executable to avoid clashing with console crawl

    mv "${pkgdir}/usr/bin/bcrawl" "${pkgdir}/usr/bin/bcrawl-tiles"

    # then build and install console version

    make GAME=bcrawl \
         DESTDIR="${pkgdir}" \
         DATADIR="/usr/share/${_pkgname}/data" \
         SAVEDIR="~/.bcrawl" \
         USE_UNICODE=y \
         install

    # install crawl license

    install -D -m644 ../../LICENSE \
        "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
    install -D -m644 ../docs/license/* \
        "${pkgdir}/usr/share/licenses/${_pkgname}"

    # install icon and .desktop file

    install -D -m644 dat/tiles/stone_soup_icon-32x32.png \
        "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
    install -D -m644 "${srcdir}/${_pkgname}.desktop" \
        "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

}