diff options
Diffstat (limited to 'system/ripgrep/ripgrep.SlackBuild')
-rw-r--r-- | system/ripgrep/ripgrep.SlackBuild | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/system/ripgrep/ripgrep.SlackBuild b/system/ripgrep/ripgrep.SlackBuild index 879ed3e8f4f63..5fc860a545cde 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 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 +BINNAM=rg VERSION=${VERSION:-13.0.0} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} 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,19 +57,15 @@ OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" - LIBDIRSUFFIX="" - CARGOTARGET="--target i586-unknown-linux-gnu" + CARGOTARGET="--target $ARCH-unknown-linux-gnu" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" - CARGOTARGET="--target i686-unknown-linux-gnu" -elif [ "$ARCH" = "x86_64" ]; then + CARGOTARGET="--target $ARCH-unknown-linux-gnu" +elif [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ] ; then SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" - CARGOTARGET="--target x86_64-unknown-linux-gnu" + CARGOTARGET="--target $ARCH-unknown-linux-gnu" else SLKCFLAGS="-O2" - LIBDIRSUFFIX="" CARGOTARGET="" fi @@ -85,10 +80,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' @@ -149,16 +142,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 \; +find target -name $BINNAM.bash -exec install -m644 {} $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 \; +find target -name _$BINNAM.ps1 -exec install -m644 {} $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 \; +find target -name $BINNAM.1 -exec install -m644 {} $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 |