summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ab10f985d47f06dec2bd6a859ceef1d5ccc33de4 (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
# Maintainer: Trevor Last <trevorclast at gmail dot com>
pkgname=fir-git
pkgver=0.1.0
pkgrel=2
pkgdesc='Simple image viewer for Wayland.'
arch=('x86_64')
url='https://github.com/Treecase/fir'
license=('GPL-3.0-or-later')
groups=()
depends=(
    'gcc-libs'
    'glibc'
    'hicolor-icon-theme'
    'sdl2'
)
makedepends=(
    'cargo'
    'git'
    'jq'
)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=('!debug')
install=
source=('git+https://github.com/Treecase/fir.git')
noextract=()
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/${pkgname%-git}"
    cargo metadata --no-deps --format-version=1 | jq -r .packages[0].version
}

prepare() {
    cd "$srcdir/${pkgname%-git}"
    export RUSTUP_TOOLCHAIN=stable
    cargo update
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "$srcdir/${pkgname%-git}"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release --all-features
}

package() {
    cd "$srcdir/${pkgname%-git}"
    install -Dm0755 -t "${pkgdir}/usr/bin/" "target/release/${pkgname%-git}"
    install -Dm0644 -t "${pkgdir}/usr/share/applications" "data/com.github.treecase.fir.desktop"
    install -Dm0644 -t "${pkgdir}/usr/share/icons/hicolor/48x48/apps" "data/com.github.treecase.fir.png"
    install -Dm0644 -t "${pkgdir}/usr/share/icons/hicolor/scalable/apps" "data/com.github.treecase.fir.svg"
}