summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5cd545a30311a9686650fbda3890451ca37f8870 (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
# Maintainer: Rafael Fontenelle <rafaelff@gnome.org>

pkgname=ddnet
pkgver=11.3.1
pkgrel=1
pkgdesc="DDraceNetwork, a mod of Teeworlds"
arch=('x86_64')
url="https://ddnet.tw"
license=('custom:BSD' 'CCPL:by-nc-sa')
depends=('sdl2' 'freetype2' 'opusfile' 'curl' 'glew' 'wavpack')
makedepends=('cmake' 'python')
checkdepends=('gtest')
optdepends=('ddnet-skins: more skins for your tee'
            'ddnet-maps-git: have all DDNet maps available offline')
provides=('teeworlds-ddnet')
conflicts=('teeworlds-ddnet')
replaces=('teeworlds-ddnet')
source=("https://ddnet.tw/downloads/DDNet-$pkgver.tar.xz"
        'ddnet.desktop' 'ddnet-server.desktop'
        'DDNet.png' 'DDNet-Server.png')
sha256sums=('2c360f206c9d791714617fcd84c4cefc3ba71e59e4d4e47b6cbadf38ac761d93'
            'c60de83f47b5981e79dc0d028c1fe239c898f6319653b94bb74e578cf699a216'
            'fc8c27e129f92c5dddf96a079306a2439c8cc14d4b8ce719c5fa2f59aceee367'
            '1dc83efd9fdab2597fc4d41358628422a9550d4d23b60d273f2f30cf7b76dfaa'
            'e4083f1c40569146caabd21b8f24fdd7862e2f3040552e9c6a260df603249274')

build() {
    [ -d build ] && rm -rf build
    mkdir build

    cd build
    cmake ../DDNet-$pkgver -DCMAKE_BUILD_TYPE=Release
    make all tools
}

check() {
    cd build
    make -k run_tests
}

package() {
    cd build

      # Install DDNet client/server binaries
    install -d -m755 "$pkgdir/usr/bin"
    install -m755 DDNet                "$pkgdir/usr/bin/"
    install -m755 DDNet-Server         "$pkgdir/usr/bin/"

      # Install extra tools
    install -d -m755 "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 config_retrieve      "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 config_store         "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 confusables          "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 crapnet              "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 dilate               "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 dummy_map            "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 fake_server          "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 map_diff             "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 map_extract          "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 map_replace_image    "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 map_resave           "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 packetgen            "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 tileset_borderadd    "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 tileset_borderfix    "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 tileset_borderrem    "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 tileset_borderset    "$pkgdir/usr/lib/ddnet/tools/"
    install -m755 uuid                 "$pkgdir/usr/lib/ddnet/tools/"

      # Install data files
    install -d -m755 "$pkgdir/usr/share/ddnet/data/"
    cp -r data/* "$pkgdir/usr/share/ddnet/data/"
    rm -rf "$pkgdir/usr/share/ddnet/data/languages/scripts/"

      # Install desktop and icon files
    install -d -m755 "$pkgdir/usr/share/applications/"
    install -d -m755 "$pkgdir/usr/share/pixmaps/"
    install -m644 "$srcdir/ddnet.desktop"        "$pkgdir/usr/share/applications/"
    install -m644 "$srcdir/ddnet-server.desktop" "$pkgdir/usr/share/applications/"
    install -m644 "$srcdir/DDNet.png"            "$pkgdir/usr/share/pixmaps/"
    install -m644 "$srcdir/DDNet-Server.png"     "$pkgdir/usr/share/pixmaps/"

      # Install license files
    install -Dm644 ../DDNet-$pkgver/license.txt "$pkgdir/usr/share/licenses/$pkgname/license.txt"
}