blob: 73a876ef58db32c9c80ba7a20a51236d49216896 (
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
|
# Maintainer: ilovemikael <itsmeguys2247 at gmail dot com>
pkgname=ripgrep-git
pkgver=15.1.0.r4.57c190d5
pkgrel=1
pkgdesc="A search tool that combines the usability of The Silver Searcher with the raw speed of grep."
arch=('i686' 'x86_64')
url="https://github.com/BurntSushi/ripgrep"
license=('UNLICENSE' 'MIT')
provides=("ripgrep")
makedepends=('cargo' 'git')
optdepends=('fish: fish completions' 'zsh: zsh completions')
depends=('pcre2')
conflicts=('ripgrep')
source=("$pkgname::git+https://github.com/BurntSushi/ripgrep")
sha1sums=('SKIP')
build() {
cd "$pkgname"
if command -v rustup > /dev/null 2>&1; then
RUSTFLAGS="-C target-cpu=native" rustup run nightly \
cargo build --release --features pcre2
elif rustc --version | grep -q nightly; then
RUSTFLAGS="-C target-cpu=native" \
cargo build --release --features pcre2
else
cargo build --release --features pcre2
fi
}
pkgver() {
cd "$pkgname"
local tag=$(git tag --sort=-v:refname | grep '^[0-9]' | head -1)
local commits_since=$(git rev-list $tag..HEAD --count)
echo "$tag.r$commits_since.$(git log --pretty=format:'%h' -n 1)"
}
package() {
cd "$pkgname"
install -Dm755 "target/release/rg" "$pkgdir/usr/bin/rg"
mkdir -vp "$pkgdir/usr/share/zsh/site-functions"
target/release/rg --generate complete-zsh > "$pkgdir/usr/share/zsh/site-functions/_rg"
mkdir -vp "$pkgdir/usr/share/bash-completion/completions"
target/release/rg --generate complete-bash > "$pkgdir/usr/share/bash-completion/completions/rg"
mkdir -vp "$pkgdir/usr/share/fish/vendor_completions.d"
target/release/rg --generate complete-fish > "$pkgdir/usr/share/fish/vendor_completions.d/rg.fish"
mkdir -vp "$pkgdir/usr/share/man/man1"
target/release/rg --generate man > "$pkgdir/usr/share/man/man1/rg.1"
install -Dm644 "README.md" "$pkgdir/usr/share/doc/${pkgname}/README.md"
install -Dm644 "COPYING" "$pkgdir/usr/share/licenses/${pkgname}/COPYING"
install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE-MIT"
install -Dm644 "UNLICENSE" "$pkgdir/usr/share/licenses/${pkgname}/UNLICENSE"
}
|