summaryrefslogtreecommitdiffstats
path: root/python/python3-pydantic-core/mkvendored.sh
diff options
context:
space:
mode:
author fourtysixandtwo2023-09-27 10:18:46 +0200
committer Willy Sudiarto Raharjo2023-09-30 06:16:32 +0200
commit0d48d3fc735a4c9d81aac59e3c7797d4a6af27d3 (patch)
tree8b42426e89809050c96fb86b9ee73886bae347e2 /python/python3-pydantic-core/mkvendored.sh
parent7048ab9705d8ea95114fae91254d5e89673942ee (diff)
downloadslackbuilds-0d48d3fc735a4c9d81aac59e3c7797d4a6af27d3.tar.gz
python/python3-pydantic-core: Updated for version 2.10.1, with fixes.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python3-pydantic-core/mkvendored.sh')
-rw-r--r--python/python3-pydantic-core/mkvendored.sh102
1 files changed, 9 insertions, 93 deletions
diff --git a/python/python3-pydantic-core/mkvendored.sh b/python/python3-pydantic-core/mkvendored.sh
index 43ca29c7c2..252d469ea9 100644
--- a/python/python3-pydantic-core/mkvendored.sh
+++ b/python/python3-pydantic-core/mkvendored.sh
@@ -1,101 +1,17 @@
#!/bin/bash
+# This is a wrapper script for cargo-mkvendored.sh which is
+# included in the cargo-vendor-filterer slackbuild and needs to be
+# installed. It is only needed if you are upgrading the version and
+# need new vendored rust libs.
+#
# create $PRGNAM-vendored-sources-$VERSION-$BUILD.tar.xz
# requires network access, but does not require root privilege.
# requires that $PRGNAM's REQUIRES need to be installed first
-# and cargo-vendor-filterer if you want just the linux ones
-CWD=$(pwd)
-PRGNAM=${CWD##*/} #basename $CWD equivalent
-source ./$PRGNAM.info
-
-set -e
-WORKDIR=$( mktemp -d )
-cd $WORKDIR
-
-# don't depend on user's ~/.cargo
-mkdir -p cargohome
-export CARGO_HOME=$(pwd)/cargohome
-
-egrep "^BUILD=|^SRCNAM=" $CWD/$PRGNAM.SlackBuild > 1
-source ./1
-
-if [ -z $SRCNAM ]; then
- echo "no SRCNAM"
- SRCNAM=$PRGNAM
-fi
-
-tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
-cd $SRCNAM-$VERSION
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-elif [ "$ARCH" = "aarch64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
-# check if rust16 is installed
-if [ ! -d /opt/rust16/bin ]; then
- echo "ERROR: The rust16 slackbuild is required to be installed"
- exit 1
-else
- 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
-fi
-
-# Configure cargo-vendor-filterer
- cat << EOF >> Cargo.toml
-[package.metadata.vendor-filter]
-platforms = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
-all-features = true
-EOF
-
-if [ -f /usr/bin/cargo-vendor-filterer ] || [ -f ~/.cargo/bin/cargo-vendor-filterer ]; then
- echo "INFO: Creating filtered vendor libs tarball..."
- /usr/bin/cargo-vendor-filterer || ~/.cargo/bin/cargo-vendor-filterer
+if [ -f /usr/bin/cargo-mkvendored.sh ]; then
+ /usr/bin/cargo-mkvendored.sh
else
- echo "WARNING: Creating unfiltered vendor libs tarball!"
- cargo vendor
+ echo " ERROR: cargo-mkvendored.sh script is not available!!
+ ERROR: Install the cargo-vendor-filterer slackbuild."
fi
-
-# build would fail if the .a files were removed
-#find vendor -type f -a -name \*.a -print0 | xargs -0 rm -f
-
-mkdir -p .cargo
- cat <<EOF >.cargo/config.toml
-[source.crates-io]
-replace-with = "vendored-sources"
-
-[source.vendored-sources]
-directory = "vendor"
-EOF
-cd -
-
-cd $WORKDIR
-tar cvfJ $CWD/$SRCNAM-vendored-sources-$VERSION-$BUILD.tar.xz \
- $SRCNAM-$VERSION/{vendor,.cargo}
-cd $CWD
-rm -rf $WORKDIR