summaryrefslogtreecommitdiff
path: root/development/cargo-vendor/cargo-vendor.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/cargo-vendor/cargo-vendor.SlackBuild')
-rw-r--r--development/cargo-vendor/cargo-vendor.SlackBuild54
1 files changed, 39 insertions, 15 deletions
diff --git a/development/cargo-vendor/cargo-vendor.SlackBuild b/development/cargo-vendor/cargo-vendor.SlackBuild
index 07901836f8..549b15c1e0 100644
--- a/development/cargo-vendor/cargo-vendor.SlackBuild
+++ b/development/cargo-vendor/cargo-vendor.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=cargo-vendor
-VERSION=${VERSION:-0.1.5}
+VERSION=${VERSION:-0.1.6}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -62,12 +62,6 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
-chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# build offline
# configuration tells cargo to use the configured directory
@@ -82,28 +76,28 @@ replace-with = 'vendored-sources'
directory = '$(pwd)/vendor'
EOF
-
if [ -e $CWD/$PRGNAM-$VERSION-vendor.tar.gz ] ; then
tar xvf $CWD/$PRGNAM-$VERSION-vendor.tar.gz
else
# deps and versions come from Cargo.lock
- # cargo vender can be used to generate the checksums
mkdir vendor
(
cd vendor
for dependency in advapi32-sys=0.2.0 \
aho-corasick=0.5.3 \
+ aho-corasick=0.6.3 \
bitflags=0.7.0 \
- cargo=0.16.0 \
+ cargo=0.17.0 \
cfg-if=0.1.0 \
cmake=0.1.20 \
- crates-io=0.5.0 \
+ crates-io=0.6.0 \
crossbeam=0.2.10 \
curl=0.4.4 \
curl-sys=0.3.7 \
docopt=0.6.86 \
env_logger=0.3.5 \
+ env_logger=0.4.2 \
error-chain=0.7.2 \
filetime=0.1.10 \
flate2=0.2.17 \
@@ -123,6 +117,7 @@ else
log=0.3.6 \
matches=0.1.4 \
memchr=0.1.11 \
+ memchr=1.0.1 \
metadeps=1.1.1 \
miniz-sys=0.1.9 \
miow=0.1.5 \
@@ -135,39 +130,68 @@ else
psapi-sys=0.1.0 \
rand=0.3.15 \
regex=0.1.80 \
+ regex=0.2.1 \
regex-syntax=0.3.9 \
+ regex-syntax=0.4.0 \
rustc-serialize=0.3.22 \
semver=0.5.1 \
semver-parser=0.6.2 \
+ shell-escape=0.1.3 \
strsim=0.5.2 \
tar=0.4.10 \
tempdir=0.3.5 \
term=0.4.4 \
thread-id=2.0.0 \
+ thread-id=3.0.0 \
thread_local=0.2.7 \
+ thread_local=0.3.3 \
toml=0.2.1 \
unicode-bidi=0.2.4 \
unicode-normalization=0.1.3 \
+ unreachable=0.1.1 \
url=1.4.0 \
user32-sys=0.2.0 \
utf8-ranges=0.1.3 \
+ utf8-ranges=1.0.0 \
+ void=1.0.2 \
winapi=0.2.8 \
winapi-build=0.1.1 \
ws2_32-sys=0.2.1 ; do
-
dep="$(echo "$dependency" | cut -d= -f1)"
ver="$(echo "$dependency" | cut -d= -f2)"
tar xvf $CWD/$dep-$ver.crate
- mv $dep-$ver $dep
+ touch $dep-$ver/.cargo-ok
+
+ # generate checksum
+ {
+ printf "{\n"
+ printf ' "files": {\n'
+
+ (
+ cd $dep-$ver
+ find . -type f -print0 | xargs -0 sha256sum | sed -n '/\.cargo-checksum\.json/!p' | sed 's/\.\///;s/^\([^ ]*\)[[:space:]][[:space:]]*\(.*\)$/"\2":"\1",/'
+ ) | sed '$ s/,$//'
- touch $dep/.cargo-ok
- zcat $CWD/checksums/$dep-cargo-checksum.json.gz > $dep/.cargo-checksum.json
+ printf " },\n"
+ printf ' "package": "'
+
+ sha256sum "$CWD/$dep-$ver.crate" | cut -f1 -d' ' | sed 's/$/"/'
+
+ 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
done
)
fi
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
cargo build --release
mkdir -p $PKG/usr/bin/