summaryrefslogtreecommitdiffstats
path: root/system/ripgrep/ripgrep.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/ripgrep/ripgrep.SlackBuild')
-rw-r--r--system/ripgrep/ripgrep.SlackBuild49
1 files changed, 30 insertions, 19 deletions
diff --git a/system/ripgrep/ripgrep.SlackBuild b/system/ripgrep/ripgrep.SlackBuild
index 879ed3e8f4..387a36fa8d 100644
--- a/system/ripgrep/ripgrep.SlackBuild
+++ b/system/ripgrep/ripgrep.SlackBuild
@@ -3,6 +3,7 @@
# Slackware build script for ripgrep
# Copyright 2017-2021 Andrew Clemons, Wellington New Zealand
+# Copyright 2023-2024 Andrew Clemons, Toyko Japan
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,8 +26,9 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ripgrep
-VERSION=${VERSION:-13.0.0}
-BUILD=${BUILD:-2}
+BINNAM=rg
+VERSION=${VERSION:-14.1.0}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -44,9 +46,6 @@ if [ -z "$ARCH" ]; then
fi
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -58,20 +57,24 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
LIBDIRSUFFIX=""
- CARGOTARGET="--target i586-unknown-linux-gnu"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
LIBDIRSUFFIX=""
- CARGOTARGET="--target i686-unknown-linux-gnu"
-elif [ "$ARCH" = "x86_64" ]; then
+elif [ "$ARCH" = "x86_64" ] ; then
SLKCFLAGS="-O2 -fPIC"
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "aarch64" ] ; then
+ SLKCFLAGS="-O2 -fPIC"
+ CARGOTARGET="--target $ARCH-unknown-linux-gnu"
LIBDIRSUFFIX="64"
- CARGOTARGET="--target x86_64-unknown-linux-gnu"
else
SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
CARGOTARGET=""
+ LIBDIRSUFFIX=""
fi
set -e
@@ -85,10 +88,8 @@ cd $PRGNAM-$VERSION
# build offline
# configuration tells cargo to use the configured directory
-# for dependencies intead of downloading from crates.io
-rm -rf .cargo
-mkdir .cargo
-cat << EOF >> .cargo/config
+# for dependencies instead of downloading from crates.io
+cat << EOF > .cargo/config
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
@@ -141,6 +142,16 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+export PATH="/opt/rust16/bin:$PATH"
+if [ -z "$LD_LIBRARY_PATH" ]; then
+ export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX"
+else
+ export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH"
+fi
+
+rm -f .cargo/config.toml
+sed -i 's/debug = "none"/debug = 0/g' Cargo.toml
+
CARGO_HOME=.cargo \
PCRE2_SYS_STATIC=0 \
CFLAGS="$SLKCFLAGS" \
@@ -149,16 +160,16 @@ cargo build --features 'pcre2' --release $CARGOTARGET
mkdir -p $PKG/usr/bin/
-find target -name rg -exec install -m 755 {} $PKG/usr/bin/rg \;
+find target -name $BINNAM -exec install -m 755 {} $PKG/usr/bin/$BINNAM \;
mkdir -p $PKG/usr/share/bash-completion/completions/
-find target -name rg.bash -exec install -m644 {} $PKG/usr/share/bash-completion/completions/rg \;
+$PKG/usr/bin/$BINNAM --generate complete-bash > $PKG/usr/share/bash-completion/completions/$BINNAM
mkdir -p $PKG/usr/share/zsh/site-functions/
-find target -name _rg.ps1 -exec install -m644 {} $PKG/usr/share/zsh/site-functions/_rg \;
+$PKG/usr/bin/$BINNAM --generate complete-zsh > $PKG/usr/share/zsh/site-functions/_$BINNAM
mkdir -p $PKG/usr/man/man1
-find target -name rg.1 -exec install -m644 {} $PKG/usr/man/man1/rg.1 \;
+$PKG/usr/bin/$BINNAM --generate man > $PKG/usr/man/man1/$BINNAM.1
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
@@ -167,7 +178,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a CHANGELOG.md COPYING FAQ.md GUIDE.md LICENSE-MIT README.md RELEASE-CHECKLIST.md UNLICENSE $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a CHANGELOG.md COPYING FAQ.md GUIDE.md LICENSE-MIT README.md UNLICENSE $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install