diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-21 20:19:29 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-21 20:19:29 -0400 |
commit | f462d092e7f5c4e9a9b6da0b6b6c240f6b776f9e (patch) | |
tree | a798b4419b82f76aea845d9494edd8cd36b56038 | |
parent | fe84928c855a04d345617993603565bbf92ae54b (diff) |
Add Archlinux AUR package.
-rw-r--r-- | README-NEW.md | 14 | ||||
-rw-r--r-- | ci/sha256.sh | 14 | ||||
-rw-r--r-- | pkg/archlinux/PKGBUILD | 35 |
3 files changed, 56 insertions, 7 deletions
diff --git a/README-NEW.md b/README-NEW.md index e2a1fca5..462f30f3 100644 --- a/README-NEW.md +++ b/README-NEW.md @@ -87,9 +87,6 @@ Summarizing, `ripgrep` is fast because: ### Installation -N.B. `ripgrep` is not yet available in any package repositories. I'd like to -fix that in the future. - [Binaries for `ripgrep` are available for Windows, Mac and Linux.](https://github.com/BurntSushi/ripgrep/releases) Linux binaries are static executables. Windows binaries are available either as built with MinGW @@ -99,7 +96,7 @@ but you'll need to have the Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) installed. -If you're a `brew` user, then you can install it with a custom formula +If you're a **Homebrew** user, then you can install it with a custom formula (N.B. `ripgrep` isn't actually in Homebrew yet. This just installs the binary directly): @@ -107,7 +104,14 @@ directly): $ brew install https://raw.githubusercontent.com/BurntSushi/ripgrep/master/pkg/brew/ripgrep.rb ``` -If you're a Rust programmer, `ripgrep` can be installed with `cargo`: +If you're an **Archlinux** user, then you can install `ripgrep` from the +[`ripgrep` AUR package](https://aur.archlinux.org/packages/ripgrep/), e.g., + +``` +$ yaourt -S ripgrep +``` + +If you're a **Rust programmer**, `ripgrep` can be installed with `cargo`: ``` $ cargo install ripgrep diff --git a/ci/sha256.sh b/ci/sha256.sh index 927c2e0f..670c9766 100644 --- a/ci/sha256.sh +++ b/ci/sha256.sh @@ -1,15 +1,25 @@ #!/bin/sh +set -e + if [ $# != 1 ]; then echo "Usage: $(basename $0) version" >&2 exit 1 fi version="$1" +# Linux and Darwin builds. for arch in i686 x86_64; do for target in apple-darwin unknown-linux-musl; do url="https://github.com/BurntSushi/ripgrep/releases/download/$version/ripgrep-$version-$arch-$target.tar.gz" - sha=$(curl -L -s "$url" | sha256sum) - echo $version-$arch-$target $sha + sha=$(curl -sfSL "$url" | sha256sum) + echo "$version-$arch-$target $sha" done done + +# Source. +for ext in zip tar.gz; do + url="https://github.com/BurntSushi/ripgrep/archive/$version.$ext" + sha=$(curl -sfSL "$url" | sha256sum) + echo "source.$ext $sha" +done diff --git a/pkg/archlinux/PKGBUILD b/pkg/archlinux/PKGBUILD new file mode 100644 index 00000000..92d23209 --- /dev/null +++ b/pkg/archlinux/PKGBUILD @@ -0,0 +1,35 @@ +# Contributor: Andrew Gallant <jamslam@gmail.com> +# Maintainer: Andrew Gallant +pkgname=ripgrep +pkgver=0.1.11 +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') +makedepends=('cargo') +source=("https://github.com/BurntSushi/$pkgname/archive/$pkgver.tar.gz") +sha256sums=('d29beb1a43a263d75ce4ef23a07253ed6ea306b14ffb5b37bc4972fb5d98238c') + +build() { + cd "$pkgname-$pkgver" + if command -v rustup > /dev/null 2>&1; then + RUSTFLAGS="-C target-cpu=native" rustup run nightly \ + cargo build --release --features simd-accel + elif rustc --version | grep -q nightly; then + RUSTFLAGS="-C target-cpu=native" \ + cargo build --release --features simd-accel + else + cargo build --release + fi +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm755 "target/release/rg" "$pkgdir/usr/bin/rg" + install -Dm644 "README-NEW.md" "$pkgdir/usr/share/doc/ripgrep/README.md" + install -Dm644 "COPYING" "$pkgdir/usr/share/doc/ripgrep/COPYING" + install -Dm644 "LICENSE-MIT" "$pkgdir/usr/share/doc/ripgrep/LICENSE-MIT" + install -Dm644 "UNLICENSE" "$pkgdir/usr/share/doc/ripgrep/UNLICENSE" +} |