summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Kline2018-02-19 11:10:28 +0000
committerChris Nixon2018-02-19 11:17:16 +0000
commit5b8006fff15ad0f2285c62fcfd39ff255b9a8167 (patch)
tree824d46525e6426b68d9558a935a72966e98b1e08
parenta99deda761026fe9d6d838119b2e2d0e9aed1ff9 (diff)
downloadaur-5b8006fff15ad0f2285c62fcfd39ff255b9a8167.tar.gz
Add support for AVX on supporting machines
Signed-off-by: Chris Nixon <chris.nixon@sigma.me.uk>
-rw-r--r--PKGBUILD12
1 files changed, 9 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f680a2ae9cd5..80b3974bac2b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Chris Nixon <chris.nixon@sigma.me.uk>
pkgname=ripgrep-git
pkgver=0.8.0.r7.361698b
-pkgrel=1
+pkgrel=2
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"
@@ -13,13 +13,19 @@ source=("$pkgname::git+https://github.com/BurntSushi/ripgrep")
sha1sums=('SKIP')
build() {
+ if grep 'avx' /proc/cpuinfo >/dev/null 2>&1; then
+ cpufeatures="simd-accel avx-accel"
+ else
+ cpufeatures="simd-accel"
+ fi
+
cd "$pkgname"
if command -v rustup > /dev/null 2>&1; then
RUSTFLAGS="-C target-cpu=native" rustup run nightly \
- cargo build --release --features simd-accel
+ cargo build --release --features "$cpufeatures"
elif rustc --version | grep -q nightly; then
RUSTFLAGS="-C target-cpu=native" \
- cargo build --release --features simd-accel
+ cargo build --release --features "$cpufeatures"
else
cargo build --release
fi