summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce9f695151dbef291246d09fa3cf278160ff5f60 (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
# Maintainer: Pi-Yueh Chuang <pychuang@pm.me>
# Contributor: Ben Widawsky <ben@bwidawsk.net>
pkgname=kanshi-git
pkgver=r92.dabd7a2
pkgrel=2
pkgdesc="Dynamic output configuration for Wayland WMs"
arch=(x86_64)
url="https://github.com/emersion/kanshi"
license=('MIT')
groups=()
depends=('wayland')
makedepends=('git' 'meson' 'ninja' 'scdoc' 'wlroots>=0.7')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
install=
source=(
    'kanshi::git+https://github.com/emersion/kanshi.git'
    'kanshi.service'
)
noextract=()
md5sums=('SKIP' '204747a0d0e0dd77d0e4f88f229c9c28')

pkgver() {
    cd "$srcdir/${pkgname%-git}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    # arch-meson automatically sets prefix and other options
    arch-meson --buildtype=release "${srcdir}/build" "${srcdir}/${pkgname%-git}"
    # compile
    meson compile -C "${srcdir}/build" -j 0 --verbose
}

package() {
    # install to $pkgdir
    DESTDIR="$pkgdir/" meson install -C "${srcdir}/build"
    # install the systemd unit file
    install -Dm644 kanshi.service -t "$pkgdir/usr/lib/systemd/user"
    # to shut up namcap's warning, even though it's a MIT license
    install -Dm644 "$srcdir/${pkgname%-git}/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
    # Arch's official Kanshi package installs README, so we do the same
    install -Dm644 "$srcdir/${pkgname%-git}/README.md" -t "$pkgdir/usr/share/doc/$pkgname"
}