diff options
author | Erich Ritz <erich.public@protonmail.com> | 2021-10-14 08:42:44 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-14 21:51:21 +0700 |
commit | 9af8e1f2931e2d216896ab9f3bee70ad6b954ad0 (patch) | |
tree | fc287a0433226afc7e40cc3c6efabadd0f3cc670 /system/bat/bat.SlackBuild | |
parent | aac57a69d9ee9ad6709b635f48282cd884cb1faa (diff) |
system/bat: New maintainer + update to 0.18.3
See
https://lists.slackbuilds.org/pipermail/slackbuilds-users/2021-October/025913.html
for email documenting transfer of maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/bat/bat.SlackBuild')
-rw-r--r-- | system/bat/bat.SlackBuild | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/system/bat/bat.SlackBuild b/system/bat/bat.SlackBuild index 2d57c20192e57..7d1ec4ac0c2be 100644 --- a/system/bat/bat.SlackBuild +++ b/system/bat/bat.SlackBuild @@ -3,6 +3,7 @@ # Slackware build script for bat # Copyright 2019-2021 Benjamin Trigona-Harany <slackbuilds@jaxartes.net> +# Copyright 2021 Erich Ritz, Jenks, Oklahoma, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=bat -VERSION=${VERSION:-0.18.1} +VERSION=${VERSION:-0.18.3} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -87,13 +88,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 @@ -101,15 +102,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 @@ -124,9 +141,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 @@ -153,7 +168,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a -r \ - LICENSE-APACHE LICENSE-MIT README.md \ + LICENSE-APACHE LICENSE-MIT README.md CHANGELOG.md CONTRIBUTING.md \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild |