| 1 | # Maintainer: krolyxon <me@krolyxon.com> |
| 2 | pkgname=remage-git |
| 3 | _pkgname=remage |
| 4 | pkgver=0.1.0.r0.g0000000 |
| 5 | pkgrel=1 |
| 6 | pkgdesc='Keyboard-centric, GPU-rendered image viewer with vim keys and wallpaper theming' |
| 7 | arch=('x86_64' 'aarch64') |
| 8 | url='https://github.com/krolyxon/remage' |
| 9 | license=('AGPL-3.0-only' 'OFL-1.1') |
| 10 | depends=('gcc-libs' 'glibc' 'dav1d' 'libheif' 'libxkbcommon' 'wayland' 'vulkan-icd-loader') |
| 11 | makedepends=('cargo' 'git' 'pkgconf') |
| 12 | optdepends=( |
| 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 | ) |
| 23 | provides=("$_pkgname") |
| 24 | conflicts=("$_pkgname") |
| 25 | options=('!lto') |
| 26 | source=("git+$url.git") |
| 27 | sha256sums=('SKIP') |
| 28 | |
| 29 | pkgver() { |
| 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 | |
| 37 | prepare() { |
| 38 | cd "$_pkgname" |
| 39 | export RUSTUP_TOOLCHAIN=stable |
| 40 | cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" |
| 41 | } |
| 42 | |
| 43 | build() { |
| 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 | |
| 54 | check() { |
| 55 | cd "$_pkgname" |
| 56 | export RUSTUP_TOOLCHAIN=stable |
| 57 | cargo test --frozen --release |
| 58 | } |
| 59 | |
| 60 | package() { |
| 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 | } |