pyfasttextureutils

This commit is contained in:
Sarah Ottinger
2021-03-27 17:46:20 -07:00
parent f2d06f72fa
commit 4f80dcce79
3 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1 @@
PyFastTextureUtils/

View File

@@ -0,0 +1,44 @@
# Maintainer: Sarah Ottinger <schalaalexiazeal@gmail.com>
_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"
}

View File

@@ -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 <Python.h>
+#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) {