summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2021-01-06 01:23:12 +0100
committerbartus2021-01-06 01:40:00 +0100
commit98c7478a5c8a2360cee7c7fe218b215a96fe7491 (patch)
treeb28e8813b06f12bfcedb58cf09fdcc3767a6c7f1
parentb5c376b560e1ba10dd23e9a23aa95fff1452310c (diff)
downloadaur-98c7478a5c8a2360cee7c7fe218b215a96fe7491.tar.gz
Patches for python:3.9, openvdb8
thanks CYBERDEViL fix #2
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD14
-rw-r--r--openvdb7.patch29
-rw-r--r--openvdb8.patch16
-rw-r--r--python3.9.patch141
-rw-r--r--python3.9_2.patch23
6 files changed, 228 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 853d5d3c8de5..b904739b1315 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -49,6 +49,10 @@ pkgbase = blender-fracture_modifier-git
source = Cleanup-use-PyImport_GetModuleDict.patch
source = python3.8.patch
source = addon_path.patch
+ source = python3.9.patch
+ source = python3.9_2.patch
+ source = openvdb7.patch
+ source = openvdb8.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
@@ -65,6 +69,10 @@ pkgbase = blender-fracture_modifier-git
sha256sums = f4fea95b9d27fb5c30a13cd57ae22d8f3091d456719377e28572091793e941c2
sha256sums = 229853b98bb62e1dec835aea6b2eab4c3dabbc8be591206573a3c1b85f10be59
sha256sums = e959c2ae13baa35e9ee6d9ff8f30fea55a60ccd59a0b8d047df134aee4b5424e
+ sha256sums = d106248d55045f5ef913bf6243ad74a76f6282264d9ee4c9b87ec4a3d2e2064b
+ sha256sums = b2a2bc5de8d3b730e49d1f50cb025c1dfdbcb66c58ead573322585b6a887d3a7
+ sha256sums = c4079c4c142516d9cd476f5a3cafddf4068f0950c3c11ea4da9cf999c5ccc1f9
+ sha256sums = edfd784f8497417660c0b9fdc97893fd0d77764d0bc10f4cb92a9082f41bae75
pkgname = blender-fracture_modifier-git
diff --git a/PKGBUILD b/PKGBUILD
index 15e6ce3b325d..2d088e043130 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -49,6 +49,10 @@ source=("git://git.blender.org/blender.git${_fragment}"
Cleanup-use-PyImport_GetModuleDict.patch
python3.8.patch
addon_path.patch
+ 'python3.9.patch' # ::https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/56d0df51a36fdce7ec2d1fbb7b47b1d95b591b5f
+ 'python3.9_2.patch' # ::https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/5edba9b42f684bf8b99894bb6988e7f46180e12c
+ openvdb7.patch
+ openvdb8.patch # ::https://git.blender.org/gitweb/gitweb.cgi/blender.git/patch/37889011070ff2ec52159690f652238d2b325185
)
sha256sums=('SKIP'
'SKIP'
@@ -65,7 +69,11 @@ sha256sums=('SKIP'
'5ff48d0e35025f21ee45274b56d1788b2e1768fa4d86b5032a40941057695176'
'f4fea95b9d27fb5c30a13cd57ae22d8f3091d456719377e28572091793e941c2'
'229853b98bb62e1dec835aea6b2eab4c3dabbc8be591206573a3c1b85f10be59'
- 'e959c2ae13baa35e9ee6d9ff8f30fea55a60ccd59a0b8d047df134aee4b5424e')
+ 'e959c2ae13baa35e9ee6d9ff8f30fea55a60ccd59a0b8d047df134aee4b5424e'
+ 'd106248d55045f5ef913bf6243ad74a76f6282264d9ee4c9b87ec4a3d2e2064b'
+ 'b2a2bc5de8d3b730e49d1f50cb025c1dfdbcb66c58ead573322585b6a887d3a7'
+ 'c4079c4c142516d9cd476f5a3cafddf4068f0950c3c11ea4da9cf999c5ccc1f9'
+ 'edfd784f8497417660c0b9fdc97893fd0d77764d0bc10f4cb92a9082f41bae75')
pkgver() {
blender_version=$(grep -Po "BLENDER_VERSION\s+\K[0-9]{3}" "$srcdir"/blender/source/blender/blenkernel/BKE_blender_version.h)
@@ -86,8 +94,8 @@ prepare() {
if [[ -v _suffix ]]; then
git apply -v <(sed "s/@@_suffix@@/${_suffix}/g" "${srcdir}/addon_path.patch")
fi
- git -C "$srcdir/blender" apply -v "${srcdir}"/{gcc{8,9},ffmpeg,openvdb,collada1668,oiio-2.0,Cleanup-use-PyImport_GetModuleDict}.patch
- git -C "$srcdir/blender" apply -v "${srcdir}"/python3.8.patch
+ git -C "$srcdir/blender" apply -v "${srcdir}"/{gcc{8,9},ffmpeg,openvdb{,7,8},collada1668,oiio-2.0,Cleanup-use-PyImport_GetModuleDict}.patch
+ git -C "$srcdir/blender" apply -v "${srcdir}"/python3.{8,9,9_2}.patch
}
build() {
diff --git a/openvdb7.patch b/openvdb7.patch
new file mode 100644
index 000000000000..630605a6c353
--- /dev/null
+++ b/openvdb7.patch
@@ -0,0 +1,29 @@
+diff --git a/intern/openvdb/CMakeLists.txt b/intern/openvdb/CMakeLists.txt
+index 9ac0817903b..e60d45b7f64 100644
+--- a/intern/openvdb/CMakeLists.txt
++++ b/intern/openvdb/CMakeLists.txt
+@@ -23,6 +23,8 @@
+ #
+ # ***** END GPL LICENSE BLOCK *****
+
++set (CMAKE_CXX_STANDARD 14)
++
+ set(INC
+ .
+ intern
+diff --git a/intern/openvdb/intern/openvdb_writer.cc b/intern/openvdb/intern/openvdb_writer.cc
+index 900c5371682..f209ec758b6 100644
+--- a/intern/openvdb/intern/openvdb_writer.cc
++++ b/intern/openvdb/intern/openvdb_writer.cc
+@@ -39,11 +39,7 @@ void OpenVDBWriter::insert(const openvdb::GridBase::Ptr &grid)
+
+ void OpenVDBWriter::insert(const openvdb::GridBase &grid)
+ {
+-#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER <= 3) || defined(OPENVDB_3_ABI_COMPATIBLE)
+- m_grids->push_back(grid.copyGrid());
+-#else
+ m_grids->push_back(grid.copyGridWithNewTree());
+-#endif
+ }
+
+ void OpenVDBWriter::insertFloatMeta(const openvdb::Name &name, const float value)
diff --git a/openvdb8.patch b/openvdb8.patch
new file mode 100644
index 000000000000..bb44c7946cdf
--- /dev/null
+++ b/openvdb8.patch
@@ -0,0 +1,16 @@
+diff --git a/intern/openvdb/openvdb_util.cc b/intern/openvdb/openvdb_util.cc
+index a221a537851..899b41ff09b 100644
+--- a/intern/openvdb/openvdb_util.cc
++++ b/intern/openvdb/openvdb_util.cc
+@@ -27,5 +27,10 @@ ScopeTimer::ScopeTimer(const std::string &message) : m_message(message), m_timer
+
+ ScopeTimer::~ScopeTimer()
+ {
+- std::printf("%s: %fms\n", m_message.c_str(), m_timer.delta());
++#if OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER >= 7
++ double delta = m_timer.milliseconds();
++#else
++ double delta = m_timer.delta(); /* Deprecated in OpenVDB 7. */
++#endif
++ std::printf("%s: %fms\n", m_message.c_str(), delta);
+ }
diff --git a/python3.9.patch b/python3.9.patch
new file mode 100644
index 000000000000..f4d7869d09f3
--- /dev/null
+++ b/python3.9.patch
@@ -0,0 +1,141 @@
+diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
+index 19fc05e66ea..5e10baa43ac 100644
+--- a/source/blender/python/mathutils/mathutils_Matrix.c
++++ b/source/blender/python/mathutils/mathutils_Matrix.c
+@@ -43,7 +43,8 @@ static PyObject *Matrix_copy_notest(MatrixObject *self, const float *matrix);
+ static PyObject *Matrix_copy(MatrixObject *self);
+ static PyObject *Matrix_deepcopy(MatrixObject *self, PyObject *args);
+ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value);
+-static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self);
++static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *),
++ MatrixObject *self);
+ static PyObject *MatrixAccess_CreatePyObject(MatrixObject *matrix, const eMatrixAccess_t type);
+
+ static int matrix_row_vector_check(MatrixObject *mat, VectorObject *vec, int row)
+@@ -380,14 +381,15 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ return NULL;
+ }
+
+-static PyObject *matrix__apply_to_copy(PyNoArgsFunction matrix_func, MatrixObject *self)
++static PyObject *matrix__apply_to_copy(PyObject *(*matrix_func)(MatrixObject *),
++ MatrixObject *self)
+ {
+ PyObject *ret = Matrix_copy(self);
+ if (ret) {
+- PyObject *ret_dummy = matrix_func(ret);
++ PyObject *ret_dummy = matrix_func((MatrixObject *)ret);
+ if (ret_dummy) {
+ Py_DECREF(ret_dummy);
+- return (PyObject *)ret;
++ return ret;
+ }
+ else { /* error */
+ Py_DECREF(ret);
+@@ -1593,7 +1595,7 @@ PyDoc_STRVAR(Matrix_adjugated_doc,
+ );
+ static PyObject *Matrix_adjugated(MatrixObject *self)
+ {
+- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_adjugate, self);
++ return matrix__apply_to_copy(Matrix_adjugate, self);
+ }
+
+ PyDoc_STRVAR(Matrix_rotate_doc,
+@@ -1799,7 +1801,7 @@ PyDoc_STRVAR(Matrix_transposed_doc,
+ );
+ static PyObject *Matrix_transposed(MatrixObject *self)
+ {
+- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_transpose, self);
++ return matrix__apply_to_copy(Matrix_transpose, self);
+ }
+
+ /*---------------------------matrix.normalize() ------------------*/
+@@ -1846,7 +1848,7 @@ PyDoc_STRVAR(Matrix_normalized_doc,
+ );
+ static PyObject *Matrix_normalized(MatrixObject *self)
+ {
+- return matrix__apply_to_copy((PyNoArgsFunction)Matrix_normalize, self);
++ return matrix__apply_to_copy(Matrix_normalize, self);
+ }
+
+ /*---------------------------matrix.zero() -----------------------*/
+diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
+index 7255c0028d7..89c448d6413 100644
+--- a/source/blender/python/mathutils/mathutils_Quaternion.c
++++ b/source/blender/python/mathutils/mathutils_Quaternion.c
+@@ -35,7 +35,8 @@
+
+ #define QUAT_SIZE 4
+
+-static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self);
++static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *),
++ QuaternionObject *self);
+ static void quat__axis_angle_sanitize(float axis[3], float *angle);
+ static PyObject *Quaternion_copy(QuaternionObject *self);
+ static PyObject *Quaternion_deepcopy(QuaternionObject *self, PyObject *args);
+@@ -376,7 +377,7 @@ PyDoc_STRVAR(Quaternion_normalized_doc,
+ );
+ static PyObject *Quaternion_normalized(QuaternionObject *self)
+ {
+- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_normalize, self);
++ return quat__apply_to_copy(Quaternion_normalize, self);
+ }
+
+ PyDoc_STRVAR(Quaternion_invert_doc,
+@@ -404,7 +405,7 @@ PyDoc_STRVAR(Quaternion_inverted_doc,
+ );
+ static PyObject *Quaternion_inverted(QuaternionObject *self)
+ {
+- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_invert, self);
++ return quat__apply_to_copy(Quaternion_invert, self);
+ }
+
+ PyDoc_STRVAR(Quaternion_identity_doc,
+@@ -468,7 +469,7 @@ PyDoc_STRVAR(Quaternion_conjugated_doc,
+ );
+ static PyObject *Quaternion_conjugated(QuaternionObject *self)
+ {
+- return quat__apply_to_copy((PyNoArgsFunction)Quaternion_conjugate, self);
++ return quat__apply_to_copy(Quaternion_conjugate, self);
+ }
+
+ PyDoc_STRVAR(Quaternion_copy_doc,
+@@ -1143,10 +1144,11 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
+ return Quaternion_CreatePyObject(quat, type);
+ }
+
+-static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObject *self)
++static PyObject *quat__apply_to_copy(PyObject *(*quat_func)(QuaternionObject *),
++ QuaternionObject *self)
+ {
+ PyObject *ret = Quaternion_copy(self);
+- PyObject *ret_dummy = quat_func(ret);
++ PyObject *ret_dummy = quat_func((QuaternionObject *)ret);
+ if (ret_dummy) {
+ Py_DECREF(ret_dummy);
+ return ret;
+diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
+index b3bba79280d..626eaa6505f 100644
+--- a/source/blender/python/mathutils/mathutils_Vector.c
++++ b/source/blender/python/mathutils/mathutils_Vector.c
+@@ -94,10 +94,10 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ return Vector_CreatePyObject_alloc(vec, size, type);
+ }
+
+-static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *self)
++static PyObject *vec__apply_to_copy(PyObject *(*vec_func)(VectorObject *), VectorObject *self)
+ {
+ PyObject *ret = Vector_copy(self);
+- PyObject *ret_dummy = vec_func(ret);
++ PyObject *ret_dummy = vec_func((VectorObject *)ret);
+ if (ret_dummy) {
+ Py_DECREF(ret_dummy);
+ return (PyObject *)ret;
+@@ -380,7 +380,7 @@ PyDoc_STRVAR(Vector_normalized_doc,
+ );
+ static PyObject *Vector_normalized(VectorObject *self)
+ {
+- return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
++ return vec__apply_to_copy(Vector_normalize, self);
+ }
+
+ PyDoc_STRVAR(Vector_resize_doc,
diff --git a/python3.9_2.patch b/python3.9_2.patch
new file mode 100644
index 000000000000..a1de7b401485
--- /dev/null
+++ b/python3.9_2.patch
@@ -0,0 +1,23 @@
+diff --git a/source/blender/python/generic/bpy_threads.c b/source/blender/python/generic/bpy_threads.c
+index 5507aa73183..4807c1f5071 100644
+--- a/source/blender/python/generic/bpy_threads.c
++++ b/source/blender/python/generic/bpy_threads.c
+@@ -29,14 +29,11 @@
+ /* analogue of PyEval_SaveThread() */
+ BPy_ThreadStatePtr BPY_thread_save(void)
+ {
+- PyThreadState *tstate = PyThreadState_Swap(NULL);
+- /* note: tstate can be NULL when quitting Blender */
+-
+- if (tstate && PyEval_ThreadsInitialized()) {
+- PyEval_ReleaseLock();
++ /* The thread-state can be NULL when quitting Blender. */
++ if (_PyThreadState_UncheckedGet()) {
++ return (BPy_ThreadStatePtr)PyEval_SaveThread();
+ }
+-
+- return (BPy_ThreadStatePtr)tstate;
++ return NULL;
+ }
+
+ /* analogue of PyEval_RestoreThread() */