summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e7b4d4a58f0dc4903777f0a9a69f7f3af5f7b166 (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
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=darktile-git
pkgver=0.0.11.r1.g159932f
pkgrel=1
pkgdesc="A GPU-rendered terminal emulator designed for tiling window managers"
arch=('x86_64')
url="https://github.com/liamg/darktile"
license=('MIT')
depends=('libgl' 'libx11' 'libxcursor' 'libxinerama' 'xorg-xinput')
makedepends=('go' 'git')
provides=('darktile')
conflicts=('darktile')
source=("${pkgname}::git+${url}")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"

    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

prepare() {
    cd "${srcdir}/${pkgname}"

    install -m755 -d "${srcdir}/go/src/github.com/liamg/"
    ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/liamg/darktile"
}

build() {
    cd "${srcdir}/go/src/github.com/liamg/darktile"

    _version="github.com/liamg/darktile/internal/app/darktile/version.Version=${pkgver}"

    export GOPATH="${srcdir}/go"
    go build -trimpath -modcacherw \
        -ldflags="-s -w -linkmode=external -X ${_version}" \
        -o darktile ./cmd/darktile
}

check() {
    cd "${srcdir}/go/src/github.com/liamg/darktile"

    export GOPATH="${srcdir}/go"
    go test ./...
}

package() {
    cd "${srcdir}/go/src/github.com/liamg/darktile"

    install -Dm 755 darktile -t "${pkgdir}/usr/bin/"
    install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
    install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
}