summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2019-11-16 21:20:15 +0100
committerbartus2019-11-16 22:38:26 +0100
commita22b04c5d9a15e57602a3a229654edfcf049744f (patch)
tree291a3dd69c17fd2d208c3259697977de5aa924f1
parent02740e10a654f37a6674d27c73b6c53ddf0b7df5 (diff)
downloadaur-a22b04c5d9a15e57602a3a229654edfcf049744f.tar.gz
Add python 3.8 support.
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD22
-rw-r--r--python3.8.patch73
3 files changed, 96 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 13b9cebb6c7..92ba5958e34 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -44,15 +44,17 @@ pkgbase = blender-2.7
source = SelectCudaComputeArch.patch
source = stl_export_iter.patch
source = python3.7.patch
- md5sums = SKIP
- md5sums = SKIP
- md5sums = SKIP
- md5sums = SKIP
- md5sums = SKIP
- md5sums = cef7a015d4ab57592b424ea06c8b576e
- md5sums = 8b22ddc71fb3a766029dc460bba49a0a
- md5sums = f21e971208232d8d78d1a4c41013a101
- md5sums = e0d4a0a876bcf48969613912f3463c01
+ source = python3.8.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 5d489f24c7401574e79b755aead07c779449ae50a1c3299ad182588127697de1
+ sha256sums = 73d878d55434d535d4a8cc2b9b633a43e822812531213a97ac64ade3497b03d6
+ sha256sums = 649c21a12a1bfc0207078e1e58b4813a3e898c6dbbbb35d21e1de7c9e8f1985a
+ sha256sums = 47811284f080e38bcfbfb1f7346279245815a064df092989336b0bf3fe4530e9
+ sha256sums = 229853b98bb62e1dec835aea6b2eab4c3dabbc8be591206573a3c1b85f10be59
pkgname = blender-2.7
diff --git a/PKGBUILD b/PKGBUILD
index 100f493bc34..91055cceaf8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -38,16 +38,18 @@ source=("git://git.blender.org/blender.git${_fragment}"
SelectCudaComputeArch.patch
stl_export_iter.patch
python3.7.patch
+ python3.8.patch
)
-md5sums=('SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'cef7a015d4ab57592b424ea06c8b576e'
- '8b22ddc71fb3a766029dc460bba49a0a'
- 'f21e971208232d8d78d1a4c41013a101'
- 'e0d4a0a876bcf48969613912f3463c01')
+sha256sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ '5d489f24c7401574e79b755aead07c779449ae50a1c3299ad182588127697de1'
+ '73d878d55434d535d4a8cc2b9b633a43e822812531213a97ac64ade3497b03d6'
+ '649c21a12a1bfc0207078e1e58b4813a3e898c6dbbbb35d21e1de7c9e8f1985a'
+ '47811284f080e38bcfbfb1f7346279245815a064df092989336b0bf3fe4530e9'
+ '229853b98bb62e1dec835aea6b2eab4c3dabbc8be591206573a3c1b85f10be59')
pkgver() {
cd "$srcdir/blender"
@@ -61,7 +63,7 @@ prepare() {
if [ -z "$_cuda_capability" ] && grep -q nvidia <(lsmod); then
git apply -v ${srcdir}/SelectCudaComputeArch.patch
fi
- git apply -v ${srcdir}/{python3.7,stl_export_iter}.patch
+ git apply -v ${srcdir}/{python3.7,stl_export_iter,python3.8}.patch
}
build() {
diff --git a/python3.8.patch b/python3.8.patch
new file mode 100644
index 00000000000..ffaa3e2a914
--- /dev/null
+++ b/python3.8.patch
@@ -0,0 +1,73 @@
+From 4b663ecf264020b1d7003a137ce84b06d7ec4ce6 Mon Sep 17 00:00:00 2001
+From: bartus <szczepaniak.bartek+github@gmail.com>
+Date: Sat, 16 Nov 2019 20:29:30 +0100
+Subject: [PATCH] Add python 3.8 support.
+
+---
+ source/blender/python/generic/py_capi_utils.c | 27 +++++++++++++++----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
+index 545e0506f84..a7eab70600b 100644
+--- a/source/blender/python/generic/py_capi_utils.c
++++ b/source/blender/python/generic/py_capi_utils.c
+@@ -696,9 +696,16 @@ PyObject *PyC_UnicodeFromByte(const char *str)
+ ****************************************************************************/
+ PyObject *PyC_DefaultNameSpace(const char *filename)
+ {
++ #if PY_VERSION_HEX >= 0x03080000
++ PyObject *modules = PyImport_GetModuleDict();
++ PyObject *builtins = PyEval_GetBuiltins();
++ #else
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
++ PyObject *modules = interp->modules;
++ PyObject *builtins = interp->builtins;
++ #endif
+ PyObject *mod_main = PyModule_New("__main__");
+- PyDict_SetItemString(interp->modules, "__main__", mod_main);
++ PyDict_SetItemString(modules, "__main__", mod_main);
+ Py_DECREF(mod_main); /* sys.modules owns now */
+ PyModule_AddStringConstant(mod_main, "__name__", "__main__");
+ if (filename) {
+@@ -706,8 +713,8 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
+ * note: this wont map to a real file when executing text-blocks and buttons. */
+ PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename));
+ }
+- PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
+- Py_INCREF(interp->builtins); /* AddObject steals a reference */
++ PyModule_AddObject(mod_main, "__builtins__", builtins);
++ Py_INCREF(builtins); /* AddObject steals a reference */
+ return PyModule_GetDict(mod_main);
+ }
+
+@@ -734,15 +741,25 @@ bool PyC_NameSpace_ImportArray(PyObject *py_dict, const char *imports[])
+ /* restore MUST be called after this */
+ void PyC_MainModule_Backup(PyObject **main_mod)
+ {
++ #if PY_VERSION_HEX >= 0x03080000
++ PyObject *modules = PyImport_GetModuleDict();
++ #else
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+- *main_mod = PyDict_GetItemString(interp->modules, "__main__");
++ PyObject *modules = interp->modules;
++ #endif
++ *main_mod = PyDict_GetItemString(modules, "__main__");
+ Py_XINCREF(*main_mod); /* don't free */
+ }
+
+ void PyC_MainModule_Restore(PyObject *main_mod)
+ {
++ #if PY_VERSION_HEX >= 0x03080000
++ PyObject *modules = PyImport_GetModuleDict();
++ #else
+ PyInterpreterState *interp = PyThreadState_GET()->interp;
+- PyDict_SetItemString(interp->modules, "__main__", main_mod);
++ PyObject *modules = interp->modules;
++ #endif
++ PyDict_SetItemString(modules, "__main__", main_mod);
+ Py_XDECREF(main_mod);
+ }
+
+--
+2.24.0
+