summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 56f8991607a2b4124c73d03f7240fb833df07873 (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
# Maintainer: Tokyob0t <tokyob0t.business[at]proton.me>

_pkgname=fht-share-picker
pkgname="$_pkgname-git"
pkgver=25.10.0.r784.7b500b1
pkgrel=1
pkgdesc='A Wayland XDG screencast output picker'
groups=('fht-desktop')
arch=('x86_64')
url="https://github.com/nferhat/fht-compositor"
license=('GPL-3.0-or-later')
source=("git+${url}.git")
sha256sums=('SKIP')

makedepends=(
    'git'
    'cargo'
    'cairo'
    'pango'
    'graphene'
    'gdk-pixbuf2'
)

depends=(
    'gtk4'
    'glibc'
    'glib2'
    'gcc-libs'
    'libadwaita'
)

provides=("$_pkgname")
conflicts=("$_pkgname")

_srcpath="fht-compositor/fht-share-picker"

pkgver() {
    cd "$srcdir/$_srcpath"

    printf "%s.r%s.%s" \
        "$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml)" \
        "$(git rev-list --count HEAD)" \
        "$(git rev-parse --short=7 HEAD)"
}

prepare() {
    cd "$srcdir/$_srcpath"
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "$srcdir/$_srcpath"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release
}

package() {
    cd "$srcdir/$_srcpath"

    install -Dm755 "target/release/$_pkgname" \
        "$pkgdir/usr/bin/$_pkgname"

    # install -Dm644 README.md \
    #     "$pkgdir/usr/share/doc/$pkgname/README.md"

    # install -Dm644 LICENSE \
    #     "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}