Krolyxon
Commit 8b10288

Branches

Tags

Refs →

remagecontribPKGBUILD

72 lines · 2.3 KB · Bourne Again Shell (bash)

1# Maintainer: krolyxon <me@krolyxon.com>
2pkgname=remage-git
3_pkgname=remage
4pkgver=0.1.0.r0.g0000000
5pkgrel=1
6pkgdesc='Keyboard-centric, GPU-rendered image viewer with vim keys and wallpaper theming'
7arch=('x86_64' 'aarch64')
8url='https://github.com/krolyxon/remage'
9license=('AGPL-3.0-only' 'OFL-1.1')
10depends=('gcc-libs' 'glibc' 'dav1d' 'libheif' 'libxkbcommon' 'wayland' 'vulkan-icd-loader')
11makedepends=('cargo' 'git' 'pkgconf')
12optdepends=(
13 'libx11: X11 support'
14 'libxcursor: X11 cursors'
15 'libxi: X11 input'
16 'libxrandr: X11 scaling'
17 'mesa: OpenGL fallback'
18 'imagemagick: [[decoders]] for PSD, XCF, JP2 and others'
19 'wl-clipboard: the example copy command'
20 'matugen: wallpaper theming'
21 'python-pywal: wallpaper theming'
22)
23provides=("$_pkgname")
24conflicts=("$_pkgname")
25options=('!lto')
26source=("git+$url.git")
27sha256sums=('SKIP')
28
29pkgver() {
30 cd "$_pkgname"
31 printf '%s.r%s.g%s' \
32 "$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)" \
33 "$(git rev-list --count HEAD)" \
34 "$(git rev-parse --short HEAD)"
35}
36
37prepare() {
38 cd "$_pkgname"
39 export RUSTUP_TOOLCHAIN=stable
40 cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
41}
42
43build() {
44 cd "$_pkgname"
45 export RUSTUP_TOOLCHAIN=stable
46 export CARGO_TARGET_DIR=target
47 cargo build --frozen --release
48 target/release/remage man > remage.1
49 target/release/remage completions zsh > _remage
50 target/release/remage completions bash > remage.bash
51 target/release/remage completions fish > remage.fish
52}
53
54check() {
55 cd "$_pkgname"
56 export RUSTUP_TOOLCHAIN=stable
57 cargo test --frozen --release
58}
59
60package() {
61 cd "$_pkgname"
62 install -Dm755 target/release/remage -t "$pkgdir/usr/bin/"
63 install -Dm644 remage.1 -t "$pkgdir/usr/share/man/man1/"
64 install -Dm644 _remage -t "$pkgdir/usr/share/zsh/site-functions/"
65 install -Dm644 remage.bash "$pkgdir/usr/share/bash-completion/completions/remage"
66 install -Dm644 remage.fish -t "$pkgdir/usr/share/fish/vendor_completions.d/"
67 install -Dm644 contrib/remage.desktop -t "$pkgdir/usr/share/applications/"
68 install -Dm644 README.md contrib/config.example.toml -t "$pkgdir/usr/share/doc/$_pkgname/"
69 cp -r contrib/matugen contrib/pywal "$pkgdir/usr/share/doc/$_pkgname/"
70 install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
71 install -Dm644 assets/fonts/OFL.txt "$pkgdir/usr/share/licenses/$pkgname/OFL-fonts.txt"
72}