summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd0b12f693c959f6c3f9226929cfd5306277f22c (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
# Maintainer: GalaxyLJGD <pentestian [at] airmail [dot] com>
pkgname=('harmonist' 'harmonist-tiles')
pkgbase=harmonist
pkgver=0.4.1
pkgrel=2
pkgdesc="A stealth coffee-break roguelike game."
arch=('x86_64')
url='https://harmonist.tuxfamily.org/index.html'
license=('ISC')
depends=('sdl2')
makedepends=('go')
source=("https://download.tuxfamily.org/${pkgbase}/releases/${pkgbase}-${pkgver}.tar.gz"
        "${pkgname[1]}.desktop")
sha256sums=('9adbef7629b408db5d33efd55368fe144da82e9b744f3d7fb4d4daf47fc54ba5'
            'd9bc5d56e9209ae19504185f9aea92ea47d6a9009f242041f5a3be9973c37e26')

prepare() {
    mkdir -p "$srcdir/${pkgbase}-$pkgver/build"
}

build() {
    export GO_EXTLINK_ENABLED=1
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-extldflags=$LDFLAGS -mod=readonly -modcacherw"
    export GOPATH="$srcdir"

    cd "$srcdir/${pkgbase}-$pkgver"
    go build -o build/$pkgbase ./...
    go build -o build/${pkgname[1]} --tags sdl ./...
}

package_harmonist() {
    depends=('glibc')
    cd "$srcdir/${pkgbase}-$pkgver"
    install -Dm644 ${pkgbase}.6 "$pkgdir/usr/share/man/man6/${pkgbase}.6"
    install -Dm755 build/$pkgbase "$pkgdir/usr/bin/$pkgbase"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgbase/LICENSE"
}

package_harmonist-tiles() {
    pkgdesc="$pkgdesc (Tiles version)"
    replaces=('harmonist-tk')
    cd "$srcdir/${pkgbase}-$pkgver"
    install -Dm644 ${pkgbase}.6 "$pkgdir/usr/share/man/man6/${pkgname[1]}.6"
    install -Dm755 build/${pkgname[1]} "$pkgdir/usr/bin/${pkgname[1]}"
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname[1]}/LICENSE"
    install -Dm644 "$srcdir/${pkgname[1]}.desktop" \
             "$pkgdir/usr/share/applications/${pkgname[1]}.desktop"
}