summaryrefslogtreecommitdiffstats
path: root/system/dust/dust.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/dust/dust.SlackBuild')
-rw-r--r--system/dust/dust.SlackBuild82
1 files changed, 60 insertions, 22 deletions
diff --git a/system/dust/dust.SlackBuild b/system/dust/dust.SlackBuild
index 38b03cb019..b5387e4c38 100644
--- a/system/dust/dust.SlackBuild
+++ b/system/dust/dust.SlackBuild
@@ -1,8 +1,9 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for dust
-# Copyright 2019-2020 Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
+# Copyright 2019-2021 Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
+# Copyright 2021-2024 Erich Ritz, Jenks, Oklahoma, USA
# 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=dust
-VERSION=${VERSION:-0.5.3}
+VERSION=${VERSION:-0.9.0}
BUILD=${BUILD:-1}
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}
@@ -77,13 +85,13 @@ cd $PRGNAM-$VERSION
# configuration tells cargo to use the configured directory
# for dependencies intead of downloading from crates.io
mkdir .cargo
-cat << EOF >> .cargo/config
+cat << EOF >> .cargo/config.toml
+[source]
[source.crates-io]
-registry = 'https://github.com/rust-lang/crates.io-index'
-replace-with = 'vendored-sources'
+replace-with = "vendored-sources"
[source.vendored-sources]
-directory = '$(pwd)/vendor'
+directory = "vendor"
EOF
# deps and versions come from Cargo.lock
@@ -91,15 +99,31 @@ mkdir vendor
(
cd vendor
- grep -h -A 3 "\[\[package\]\]" $(find ../ -maxdepth 1 -mindepth 1 -name Cargo.lock | tr '\n' ' ') | \
- sed 's/[[:space:]]*=[[:space:]]*/=/g;s/^--//;s/^\[\[/--\n[[/' | \
- awk 'BEGIN { RS = "--\n" ; FS="\n" } { print $2, $3, $4 }' | sed 's/"//g;s/name=//;s/ version=/=/' | \
- grep crates\.io-index | sed 's/ source=.*$//' | sort -u | while read -r dep ; do
-
+ grep -h -A 4 "\[\[package\]\]" \
+ $(find "../" -maxdepth 1 -mindepth 1 -name Cargo.lock | tr '\n' ' ') | \
+ sed 's/[[:space:]]*=[[:space:]]*/=/g;s/^--//;s/^\[\[/--\n[[/' | \
+ awk 'BEGIN { RS = "--\n" ; FS="\n" } { print $2, $3, $4, $5 }' | \
+ sed 's/"//g;s/name=//;s/ version=/=/' | \
+ grep " source=" | \
+ sed 's/ dependencies=.*$//' | \
+ sed 's/ source=[^ ]*//' | \
+ sed 's/ checksum=/=/' | \
+ sort -u | \
+ while read -r dep ; do
+
+ cksum="$(printf "%s\n" "$dep" | cut -d= -f3)"
ver="$(printf "%s\n" "$dep" | cut -d= -f2)"
dep="$(printf "%s\n" "$dep" | cut -d= -f1)"
- tar xvf $CWD/$dep-$ver.crate
+ CRATE_FILE=$CWD/$dep-$ver.crate
+
+ if [ -z "$cksum" ] ; then
+ mkdir $dep-$ver
+ tar xvf $CRATE_FILE -C $dep-$ver --strip-components=1
+ cksum="null"
+ else
+ tar xvf $CRATE_FILE
+ fi
touch $dep-$ver/.cargo-ok
@@ -114,9 +138,7 @@ mkdir vendor
) | sed '$ s/,$//'
printf " },\n"
- printf ' "package": "'
-
- sha256sum "$CWD/$dep-$ver.crate" | cut -f1 -d' ' | sed 's/$/"/'
+ printf ' "package": "%s"' "$cksum"
printf "}\n"
} | python -c "import sys, json; data = sys.stdin.read(); print json.dumps(json.loads(data), sort_keys=True, indent=4, separators=(',', ' : '))" > $dep-$ver/.cargo-checksum.json
@@ -130,6 +152,14 @@ 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
+
+CARGO_HOME=.cargo \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
cargo build --offline --release $CARGOTARGET
@@ -138,12 +168,20 @@ mkdir -p $PKG/usr/bin/
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
+mkdir -p $PKG/usr/share/bash-completion/completions
+mv completions/dust.bash $PKG/usr/share/bash-completion/completions/dust
+mkdir -p $PKG/usr/share/zsh/site-functions
+mv completions/_dust $PKG/usr/share/zsh/site-functions/
+mkdir -p $PKG/usr/share/fish/vendor_completions.d
+mv completions/dust.fish $PKG/usr/share/fish/vendor_completions.d/
+
+mkdir -p $PKG/usr/man/man1
+mv man-page/dust.1 $PKG/usr/man/man1/
+find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a -r \
- LICENSE README.md \
+cp -a \
+ LICENSE README.md config completions \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -151,4 +189,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