python/python3-pydantic-core: Updated for version 2.10.1, with fixes.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
fourtysixandtwo 2023-09-27 02:18:46 -06:00 committed by Willy Sudiarto Raharjo
parent 7048ab9705
commit 0d48d3fc73
No known key found for this signature in database
GPG key ID: 3F617144D7238786
3 changed files with 15 additions and 100 deletions

View file

@ -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"
if [ -f /usr/bin/cargo-mkvendored.sh ]; then
/usr/bin/cargo-mkvendored.sh
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
echo " ERROR: cargo-mkvendored.sh script is not available!!
ERROR: Install the cargo-vendor-filterer slackbuild."
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
else
echo "WARNING: Creating unfiltered vendor libs tarball!"
cargo vendor
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

View file

@ -3,7 +3,6 @@
# Slackware build script for python3-pydantic-core
# Copyright 2023 fourtysixandtwo <fourtysixandtwo@sliderr.net>
# Copyright 2022-2023 fourtysixandtwo <fourtysixandtwo@sliderr.net>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -27,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=python3-pydantic-core
SRCNAM=pydantic_core
VERSION=${VERSION:-2.6.3}
VERSION=${VERSION:-2.10.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

View file

@ -1,10 +1,10 @@
PRGNAM="python3-pydantic-core"
VERSION="2.6.3"
VERSION="2.10.1"
HOMEPAGE="https://github.com/pydantic/pydantic-core"
DOWNLOAD="https://files.pythonhosted.org/packages/source/p/pydantic-core/pydantic_core-2.6.3.tar.gz \
https://slackware.uk/~fourtysixandtwo/src/pydantic_core-vendored-sources-2.6.3-1.tar.xz"
MD5SUM="29a2f85463667001aa86c7c3393087a8 \
e0dc0577273bfaa0737c9e34446b03e2"
DOWNLOAD="https://files.pythonhosted.org/packages/source/p/pydantic-core/pydantic_core-2.10.1.tar.gz \
https://slackware.uk/~fourtysixandtwo/src/pydantic_core-vendored-sources-2.10.1-1.tar.xz"
MD5SUM="169352f09231705c31cdbf868879dee0 \
59c1b487bd26e9bfcfbdc381d2067314"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="python3-maturin python3-hatchling typing-extensions"