diff options
Diffstat (limited to 'system/exa/exa.SlackBuild')
-rw-r--r-- | system/exa/exa.SlackBuild | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/system/exa/exa.SlackBuild b/system/exa/exa.SlackBuild index 48b039ed4b..578e021306 100644 --- a/system/exa/exa.SlackBuild +++ b/system/exa/exa.SlackBuild @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for exa -# Copyright 2017-2019 Andrew Clemons, Wellington New Zealand +# Copyright 2017-2021 Andrew Clemons, Wellington New Zealand +# Copyright 2022-2023 Andrew Clemons, Tokyo Japan # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +23,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=exa -VERSION=${VERSION:-0.9.0} -BUILD=${BUILD:-1} +VERSION=${VERSION:-0.10.1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -41,7 +45,11 @@ if [ -z "$ARCH" ]; then fi fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -49,15 +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="" @@ -130,23 +138,31 @@ 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 {} \; +sed -i "s/version = \"0.11.0-pre\"/version = \"$VERSION\"/" Cargo.lock + +CARGO_HOME=.cargo \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ -cargo build --release --no-default-features --features default $CARGOTARGET +cargo build --offline --release $CARGOTARGET mkdir -p $PKG/usr/bin -find target -name exa -exec install -m 755 {} $PKG/usr/bin/exa \; -mkdir -p $PKG/usr/share/bash-completion/completions -mkdir -p $PKG/usr/share/zsh/site-functions -make install-man install-bash-completions install-zsh-completions DESTDIR=$PKG PREFIX=/usr BASHDIR=/usr/share/bash-completion/completions ZSHDIR=/usr/share/zsh/site-functions +find target -name $PRGNAM -exec install -m 755 {} $PKG/usr/bin/$PRGNAM \; + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +unzip -q -d accoutrements $CWD/$PRGNAM-accoutrements-v$VERSION.zip + +install -Dm644 accoutrements/man/exa.1 $PKG/usr/man/man1/exa.1 +install -Dm644 accoutrements/man/exa_colors.5 $PKG/usr/man/man5/exa_colors.5 -mv $PKG/usr/share/man/ $PKG/usr 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 -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +install -Dm644 accoutrements/completions/*.bash $PKG/usr/share/bash-completion/completions/exa +install -Dm644 accoutrements/completions/*.fish $PKG/usr/share/fish/completions/exa.fish +install -Dm644 accoutrements/completions/*.zsh $PKG/usr/share/zsh/site-functions/_exa mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENCE README.md $PKG/usr/doc/$PRGNAM-$VERSION @@ -156,4 +172,4 @@ mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |