diff options
author | Arn0 <yth@ythogtha.org> | 2023-03-08 15:43:40 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-03-12 08:48:15 +0700 |
commit | e35b4618d3ee651fa3c1a600224edcef69527cea (patch) | |
tree | 422b95a9c99fafe77db30ad1c758babcc568ffcb | |
parent | f90f6999c9bb02bbbbbff6940afe02711a4d75f8 (diff) |
python/python3-bcrypt: Updated for version 4.0.1.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | python/python3-bcrypt/python3-bcrypt.SlackBuild | 100 | ||||
-rw-r--r-- | python/python3-bcrypt/python3-bcrypt.info | 106 |
2 files changed, 198 insertions, 8 deletions
diff --git a/python/python3-bcrypt/python3-bcrypt.SlackBuild b/python/python3-bcrypt/python3-bcrypt.SlackBuild index c2155df029a01..f0658054f27d4 100644 --- a/python/python3-bcrypt/python3-bcrypt.SlackBuild +++ b/python/python3-bcrypt/python3-bcrypt.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=python3-bcrypt SRCNAM=${PRGNAM#python3-*} -VERSION=${VERSION:-3.2.2} +VERSION=${VERSION:-4.0.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -35,11 +35,14 @@ if [ -z "$ARCH" ]; then arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac + + if [ "$ARCH" = "i586" ]; then + if rustc -Vv | grep host | grep i686 > /dev/null ; then + ARCH=i686 + fi + fi fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -49,6 +52,24 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" + CARGOTARGET="--target $ARCH-unknown-linux-gnu" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" + CARGOTARGET="--target $ARCH-unknown-linux-gnu" +elif [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + CARGOTARGET="--target $ARCH-unknown-linux-gnu" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + CARGOTARGET="" +fi + set -e rm -rf $PKG @@ -57,6 +78,71 @@ cd $TMP rm -rf $SRCNAM-$VERSION tar xvf $CWD/$SRCNAM-$VERSION.tar.gz cd $SRCNAM-$VERSION + +# build offline +# configuration tells cargo to use the configured directory +# for dependencies intead of downloading from crates.io +mkdir .cargo +cat << EOF >> .cargo/config.toml +[source] +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" +EOF + +# deps and versions come from Cargo.lock +mkdir vendor +( + cd vendor + + grep -h -A 4 "\[\[package\]\]" \ + $(find "../" -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)" + + 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 + + # 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/,$//' + + printf " },\n" + printf ' "package": "%s"' "$cksum" + + printf "}\n" + } > $dep-$ver/.cargo-checksum.json + done +) + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -64,8 +150,14 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +CARGO_HOME=.cargo \ +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ python3 setup.py install --root=$PKG +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a README.rst LICENSE MANIFEST.in $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild diff --git a/python/python3-bcrypt/python3-bcrypt.info b/python/python3-bcrypt/python3-bcrypt.info index 8ad5e61f5e087..b3d7192e1e7d9 100644 --- a/python/python3-bcrypt/python3-bcrypt.info +++ b/python/python3-bcrypt/python3-bcrypt.info @@ -1,10 +1,108 @@ PRGNAM="python3-bcrypt" -VERSION="3.2.2" +VERSION="4.0.1" HOMEPAGE="https://github.com/pyca/bcrypt/" -DOWNLOAD="https://pypi.python.org/packages/source/b/bcrypt/bcrypt-3.2.2.tar.gz" -MD5SUM="3978ac76158b6241d1c2ca140dac1b56" +DOWNLOAD="https://pypi.python.org/packages/source/b/bcrypt/bcrypt-4.0.1.tar.gz \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/autocfg/autocfg-1.1.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/base64/base64-0.13.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/bcrypt/bcrypt-0.13.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/bcrypt-pbkdf/bcrypt-pbkdf-0.8.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/bitflags/bitflags-1.3.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/block-buffer/block-buffer-0.10.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/blowfish/blowfish-0.9.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/byteorder/byteorder-1.4.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/cfg-if/cfg-if-1.0.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/cipher/cipher-0.4.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/cpufeatures/cpufeatures-0.2.5.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/crypto-common/crypto-common-0.1.6.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/digest/digest-0.10.5.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/generic-array/generic-array-0.14.6.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/getrandom/getrandom-0.2.7.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/indoc/indoc-0.3.6.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/indoc-impl/indoc-impl-0.3.6.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/inout/inout-0.1.3.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/instant/instant-0.1.12.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/libc/libc-0.2.134.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/lock_api/lock_api-0.4.9.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/once_cell/once_cell-1.15.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/parking_lot/parking_lot-0.11.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/parking_lot_core/parking_lot_core-0.8.5.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/paste/paste-0.1.18.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/paste-impl/paste-impl-0.1.18.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/pbkdf2/pbkdf2-0.10.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/proc-macro-hack/proc-macro-hack-0.5.19.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/proc-macro2/proc-macro2-1.0.46.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/pyo3/pyo3-0.15.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/pyo3-build-config/pyo3-build-config-0.15.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/pyo3-macros/pyo3-macros-0.15.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/pyo3-macros-backend/pyo3-macros-backend-0.15.2.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/quote/quote-1.0.21.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/redox_syscall/redox_syscall-0.2.16.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/scopeguard/scopeguard-1.1.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/sha2/sha2-0.10.6.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/smallvec/smallvec-1.10.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/subtle/subtle-2.4.1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/syn/syn-1.0.102.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/typenum/typenum-1.15.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/unicode-ident/unicode-ident-1.0.4.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/unindent/unindent-0.1.10.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/version_check/version_check-0.9.4.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/wasi/wasi-0.11.0+wasi-snapshot-preview1.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi/winapi-0.3.9.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-i686-pc-windows-gnu/winapi-i686-pc-windows-gnu-0.4.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/winapi-x86_64-pc-windows-gnu/winapi-x86_64-pc-windows-gnu-0.4.0.crate \ + https://crates-io.s3-us-west-1.amazonaws.com/crates/zeroize/zeroize-1.5.7.crate" +MD5SUM="a98a2232a8e2af6980000a31ef14d48d \ + 05d77ef52e90ad161fdd41b252420467 \ + 80a2c27647a6acb1890a3a7de8fded72 \ + 4b2010e24660e5b48cbb96511099d629 \ + c0e8a8eb1c989831503b47a3382101a4 \ + a295edb6953237ebbdfa8e731229f9a3 \ + 7caa371ca22e7a14288920a69c081d40 \ + c0d5296acca72ce01a0058b7b8f56e55 \ + 1e704be5ddde9d6b5383ef1035309f91 \ + 74634128440dbc3766bda76fdf0aaa05 \ + 29ee89d95bc0cef2a5bf730e4efe7ac6 \ + ebdc1f779823eaad615501b1cd3822b1 \ + 89e88633cab0e4b6f3d3878b84dffe8b \ + ebf95279270dfefc495cdf5192faaf4c \ + e3480971fb7f7462149056fd70df74e2 \ + 62864db03072aaae4f855126d502b8c7 \ + 2c56a546f0522e89a14f361e364d8921 \ + 9273d518c1b6082859f526fe56c9cd7c \ + 5f3fd38b7aefc1ca48efe279994953f8 \ + 5f153f7135dceb02f88266121c836b4e \ + 906dbb2baf63d05371775a545bb4e980 \ + 426eb9e22cbb36480e13fd265be87b4c \ + 81bd380ba31052f9c84f5e71e8c0ee52 \ + 12e4ba5909e1f30b9142932571eaa4da \ + 233dee08f26c9cbe78f29b66c0c20ccd \ + fe25af78df7a9c06f85cb07b336871fc \ + 22030e124dbac93658e25bb2753d93db \ + f6984103b5729fd3ee8a7d718639c71b \ + c7c38eb603bed6f42edbc4294806a44a \ + ebdf8b160c0945f25087762c9de2a3ff \ + 109be3a18231631535377c6aa0ce7089 \ + 31e29b0181adb24a507832b343828e11 \ + f3230d205e69f924dbf6c7f4cebc57c1 \ + 9f88e7edadde0f80a64bdd467ca822f1 \ + 1de20a0fc1cfdf5e332cbdb2e0899a2b \ + 16111f31a29feae4ce4a324b83dc0189 \ + b4a0a98a54439a5a37952c8879187ee3 \ + e3e93a5606f450c13fcad764fa1c4bed \ + a8014a7c865aa54f305e8cda3ef02019 \ + 8e053c23f1d36fbf3f276fbf501e3e35 \ + 6ad88312d782df53181894f7b74b5533 \ + 7b38b145ae3f6d7d09a1a7a98396f1a2 \ + c12056f5fc11f0d69b92b1d1d4799c80 \ + a193567f36be2b82c0fe122a67d3c1fb \ + d18d362345c4fe512ef67b738b239fb8 \ + e972ea58ec203bfa6c79c1207852298b \ + 0498c4a11448bfc35dc7bb2caa64c753 \ + db96b50050277bf05a3c68534bbb9586 \ + 09de9d01e7331ff3da11f58be8bef0df \ + a72e719c29bea6a044b0ff01cad88cfb" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="" +REQUIRES="python3-setuptools-rust" MAINTAINER="Yth - Arnaud" EMAIL="yth@ythogtha.org" |