Skip to content
Snippets Groups Projects
APKBUILD 1.3 KiB
Newer Older
Hoang Nguyen's avatar
Hoang Nguyen committed
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=felix
pkgver=2.8.1
pkgrel=0
Hoang Nguyen's avatar
Hoang Nguyen committed
pkgdesc="Simple TUI file manager with vim-like key mapping"
url="https://kyoheiu.dev/felix/"
# s390x: nix crate doesn't build yet
arch="all !s390x"
license="MIT"
makedepends="
	bzip2-dev
	cargo
	cargo-auditable
	oniguruma-dev
	zlib-ng-dev
	zstd-dev
	"
Hoang Nguyen's avatar
Hoang Nguyen committed
checkdepends="zoxide"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/kyoheiu/felix/archive/refs/tags/v$pkgver.tar.gz
	use-system-libs.patch
	"

export RUSTONIG_DYNAMIC_LIBONIG=1

Hoang Nguyen's avatar
Hoang Nguyen committed
prepare() {
	default_prepare

	# Rust target triple.
	local target=$(rustc -vV | sed -n 's/host: //p')

	# Build against system-provided libz-ng.
	mkdir -p .cargo
	cat >> .cargo/config.toml <<-EOF
		[target.$target]
		z-ng = { rustc-link-lib = ["z-ng"], rustc-cfg = ["zng"] }
	EOF

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
Hoang Nguyen's avatar
Hoang Nguyen committed
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/fx -t "$pkgdir"/usr/bin/
}

sha512sums="
7ca339be09a16306894a25a0d773bd3109048363743276629cf1749ac99f9b242616699cd22e02bf35ce53273c69628769f9633ecce2be3aea48ba0d868418c1  felix-2.8.1.tar.gz
7bfedbc4c161e6d92e661aeb43de5e8bcc9f490f5f39e7e0778559af57f798cb92e57c808feaa76e54dea5f889b1dc9d18b37c9e599cb85187e881cf074db04a  use-system-libs.patch