diff --git a/mingw-w64-python-pyfasttextureutils-git/.gitignore b/mingw-w64-python-pyfasttextureutils-git/.gitignore new file mode 100644 index 0000000000..3fcbfe9b98 --- /dev/null +++ b/mingw-w64-python-pyfasttextureutils-git/.gitignore @@ -0,0 +1 @@ +PyFastTextureUtils/ diff --git a/mingw-w64-python-pyfasttextureutils-git/PKGBUILD b/mingw-w64-python-pyfasttextureutils-git/PKGBUILD new file mode 100644 index 0000000000..f8b774d232 --- /dev/null +++ b/mingw-w64-python-pyfasttextureutils-git/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Sarah Ottinger + +_realname=pyfasttextureutils +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}-git") +pkgver=2.8fd8558 +pkgrel=1 +pkgdesc='Python module for quickly making certain modifications to images (mingw-w64)' +arch=('any') +url="https://github.com/LagoLunatic/PyFastTextureUtils" +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "git" "patch") +source=("git+https://github.com/LagoLunatic/PyFastTextureUtils" +"minmax.patch") +sha256sums=('SKIP' + 'fc49c27aca6cfc6778dee41bca7aa2ef670117ed181e6eef7a0250bf2e16ab56') + +pkgver() { + cd $srcdir/PyFastTextureUtils + printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$srcdir" + rm -rf python-build-${CARCH} | true + cp -r "PyFastTextureUtils" "python-build-${CARCH}" + cd "${srcdir}/python-build-${CARCH}" + patch -Np2 -i ../minmax.patch +} + +build() { + msg "Python build for ${CARCH}" + cd "${srcdir}/python-build-${CARCH}" + ${MINGW_PREFIX}/bin/python setup.py build +} + +package() { + cd "${srcdir}/python-build-${CARCH}" + 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.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.txt" +} diff --git a/mingw-w64-python-pyfasttextureutils-git/minmax.patch b/mingw-w64-python-pyfasttextureutils-git/minmax.patch new file mode 100644 index 0000000000..c4b5449cb7 --- /dev/null +++ b/mingw-w64-python-pyfasttextureutils-git/minmax.patch @@ -0,0 +1,12 @@ +--- src/PyFastTextureUtils/pyfasttextureutils.c.old 2021-03-27 17:27:59.851176000 -0700 ++++ src/PyFastTextureUtils/pyfasttextureutils.c 2021-03-27 17:40:35.107339300 -0700 +@@ -1,6 +1,9 @@ + #define PY_SSIZE_T_CLEAN + #include + ++#define min(X,Y) (((X) < (Y)) ? (X) : (Y)) ++#define max(X,Y) (((X) > (Y)) ? (X) : (Y)) ++ + int pyfasttextureutils_color_tuple_one_value_to_int(PyObject* tuple, int index, int* val_int) { + PyObject* val_obj = PyTuple_GetItem(tuple, index); + if (val_obj == NULL) {