development/cargo-vendor-filterer: Build fixes.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
fourtysixandtwo 2024-01-02 14:53:47 -07:00 committed by Willy Sudiarto Raharjo
parent 730bddd703
commit 12bb975fbc
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 17 additions and 9 deletions

View File

@ -1,12 +1,16 @@
#!/bin/bash
# Create $PRGNAM-vendored-sources-$VERSION-$BUILD.tar.xz
# Create $PRGNAM-vendored-sources-$VERSION-$VSBUILD.tar.xz
# Requires network access, but does not require root privilege.
# Requires that $PRGNAM's REQUIRES need to be installed first (rust16)
# and cargo-vendor-filterer installed to include just the linux deps
#
# Expects to be run within a slackbuild dir with the source archive
# already downloaded.
#
# Variables to use in your SlackBuild:
# VSBUILD # same use as BUILD but for vendored sources
# VSDIR=/sub/dir/ # (optional) alternate location in src for vendor dir
INFO="$( echo *.info )"
if [ ! -e "$INFO" ]; then
@ -35,14 +39,14 @@ cd $WORKDIR
mkdir -p cargohome
export CARGO_HOME=$(pwd)/cargohome
egrep "^BUILD=|^SRCNAM=" $CWD/$SBUILD > sbvars
egrep "^BUILD=|^VSBUILD=|^VSDIR=|^SRCNAM=" $CWD/$SBUILD > sbvars
source ./sbvars
# if no SRCNAM in slackbuild set to PRGNAM
SRCNAM=${SRCNAM:-$PRGNAM}
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$VERSION || exit 1
cd $SRCNAM-$VERSION/$VSDIR || exit 1
if [ ! -e "Cargo.toml" ]; then
echo "No Cargo.toml file in $SRCNAM-$VERSION dir" 1>&2
@ -122,8 +126,8 @@ EOF
cd -
cd $WORKDIR
tar cvfJ $CWD/$SRCNAM-vendored-sources-$VERSION-$BUILD.tar.xz \
$SRCNAM-$VERSION/{vendor,.cargo}
md5sum $CWD/$SRCNAM-vendored-sources-$VERSION-$BUILD.tar.xz
tar cvfJ $CWD/$SRCNAM-vendored-sources-$VERSION-$VSBUILD.tar.xz \
$SRCNAM-$VERSION/$VSDIR/{vendor,.cargo}
md5sum $CWD/$SRCNAM-vendored-sources-$VERSION-$VSBUILD.tar.xz
cd $CWD
rm -rf $WORKDIR

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2023 fourtysixandtwo <fourtysixandtwo@sliderr.net>
# Copyright 2023-2024 fourtysixandtwo <fourtysixandtwo@sliderr.net>
# Copyright 2022 Patrick J. Volkerding, Sebeka, MN, USA
# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands
# All rights reserved.
@ -24,14 +24,18 @@
# 20230925 46and2: Bump build, changes to mkvendored script.
# 20230927 46and2: 32-bit fix thanks to Eugene Carlson. Min ARCH=i686.
# 20240102 46and2: modify to use VSBUILD instead of BUILD for vendored sources
# above requested by Andrew Clemons to avoid CI issues
# -also added VSDIR option to included script, see cargo-mkvendored.sh
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=cargo-vendor-filterer
VERSION=${VERSION:-0.5.12}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
VSBUILD=${VSBUILD:-1}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@ -74,7 +78,7 @@ mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
tar xvf $CWD/$PRGNAM-vendored-sources-$VERSION-$BUILD.tar.?z
tar xvf $CWD/$PRGNAM-vendored-sources-$VERSION-$VSBUILD.tar.?z
cd $PRGNAM-$VERSION
chown -R root:root .