aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ripgrep/APKBUILD
blob: a3a83fa3c07e58ac0e166864219871ae23244c5c (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
57
58
59
60
61
# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ripgrep
pkgver=11.0.2
pkgrel=0
pkgdesc="ripgrep combines the usability of The Silver Searcher with the raw speed of grep"
url="https://github.com/BurntSushi/ripgrep"
arch="x86_64 armhf armv7" # limited by cargo pkg
license="MIT public-domain"
makedepends="cargo asciidoc pcre2-dev"
subpackages="$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/BurntSushi/$pkgname/archive/$pkgver.tar.gz"

build() {
	cargo build --release --features 'pcre2'
}

check() {
	cargo test
}

package() {
	install -Dm755 "target/release/rg" "$pkgdir/usr/bin/rg"
	install -Dm644 "target/release/build/ripgrep-"*/out/rg.1 \
		"$pkgdir/usr/share/man/man1/rg.1"
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/
	install -Dm644 "$builddir/target/release/build/ripgrep-"*/out/rg.bash \
		"$subpkgdir/usr/share/bash-completion/completions/rg"
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions/
	install -Dm644 "$builddir/complete/_rg" \
		"$subpkgdir/usr/share/zsh/site-functions/_rg"
}

fishcomp() {
	depends=""
	pkgdesc="Fish completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	mkdir -p "$subpkgdir"/usr/share/fish/completions/
	install -Dm644 "$builddir/target/release/build/ripgrep-"*/out/rg.fish \
		"$subpkgdir/usr/share/fish/completions/rg.fish"
}

sha512sums="62b5bcceac2ca4899e797799e67a8e45730f1bcb5115b48e9ebfe12d3b0e43921020f368e4328b0f5060ccdf0dedb8935857ece7126e05d9cbcca535cee68a92  ripgrep-11.0.2.tar.gz"