Add python-bcrypt3 for clang32 and clangarm64

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2022-09-22 12:15:23 +01:00
parent 04b6eeec1d
commit d18f8aac8a
2 changed files with 88 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
--- a/src/_csrc/sha2.c
+++ b/src/_csrc/sha2.c
@@ -34,6 +34,7 @@
* $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $
*/
+#include <stdlib.h>
#include "pycabcrypt.h"
#include "sha2.h"

View File

@@ -0,0 +1,78 @@
# Maintainer: Smo <smo@xpra.org>
_realname=bcrypt
pkgbase=mingw-w64-python-${_realname}3
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}3")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=3.2.2
pkgrel=2
pkgdesc="Modern password hashing for your software and your servers (mingw-w64)"
arch=('any')
mingw_arch=('clang32' 'clangarm64')
url='https://github.com/pyca/bcrypt/'
license=('spdx:Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-cffi"
"${MINGW_PACKAGE_PREFIX}-python-six")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "${MINGW_PACKAGE_PREFIX}-cc")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/pyca/bcrypt/archive/${pkgver}.tar.gz"
001-fix-undeclared-function.patch)
sha512sums=('2aa5cf2a1c117cb6c7c92cbd41515da332f2bec1d37c36e0732add12e61fb2e83837e3c980f7f77ffc454b3a85ecb6829981d77662218aa4e56efba07d9d7070'
'6a04c6f20b733360709caa323e8690afe859a02763a9349722c676c3f3b0539f0c0a063791f098f1f1c9fd2a546918a9d7437e87a2b28170512e058740d9e195')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
apply_patch_with_msg \
001-fix-undeclared-function.patch
cd "${srcdir}"
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
}
check() {
msg "Python test for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py check
}
package() {
cd "${srcdir}/python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/COPYING"
}