archrelease: copy trunk to community-any
[ArchLinux/community.git] / xplr / repos / community-x86_64 / PKGBUILD
blob383aa277875c3f75bcd3724f88710bc90345b8c7
1 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
2 # Maintainer: Maxim Baz <$pkgname at maximbaz dot com>
4 pkgname=xplr
5 pkgver=0.21.1
6 pkgrel=2
7 pkgdesc="A hackable, minimal, fast TUI file explorer"
8 arch=('x86_64')
9 url="https://github.com/sayanarijit/xplr"
10 license=('MIT')
11 depends=('gcc-libs' 'hicolor-icon-theme' 'luajit')
12 makedepends=('cargo')
13 source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
14         "$pkgname-$pkgver.tar.gz.asc::$url/releases/download/v${pkgver}/source.tar.gz.asc"
15         use-system-luajit.patch)
16 sha512sums=('75cb1781106516ba53b937577e6c05de46eb3f770505808c72e4aae7ed68fb53a1c4079d4f42724ad9765c8ba11eb149c53c9785c9144d19816891f4762aa883'
17             'SKIP'
18             '9c2154f3023da17ce1edab91913308f06fd0d6e618dc477a2f1b2742cc4ffb78459263df7df3cf6217967e2b2bbbb5334e725c4778fdd91d8415039dd067860e')
19 validpgpkeys=('D59CA14710C17C6B24717AF90F8EF5258DC38077') # Arijit Basu (June 3, 2021)
20 options=('!lto')
22 prepare() {
23   cd "$pkgname-$pkgver"
24   patch -p0 -i ../use-system-luajit.patch
25   cargo update -p mlua
28 build() {
29   cd "$pkgname-$pkgver"
30   cargo build --locked --release
33 check() {
34   cd "$pkgname-$pkgver"
36   # unit tests need the binary, so build it first.
37   # building in debug mode (both bin and tests) in order to not overwrite the binary produced in build() that we will later package
38   cargo build --locked
39   cargo test --locked
42 package() {
43   cd "$pkgname-$pkgver"
44   install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
45   install -Dm 644 docs/en/src/* -t "$pkgdir/usr/share/doc/$pkgname"
46   install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
47   install -Dm 644 src/init.lua -t "$pkgdir/usr/share/$pkgname/examples"
48   install -Dm 644 "assets/desktop/$pkgname.desktop" -t "$pkgdir/usr/share/applications"
49   for i in 128 16 32 64; do
50     install -Dm 644 "assets/icon/${pkgname}${i}.png" "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png"
51   done
52   install -Dm 644 "assets/icon/$pkgname.svg" -t "$pkgdir/usr/share/icons/hicolor/scalable/apps"
55 # vim:set ts=2 sw=2 et: