From 46b6464013b828eb130bb653402551809f682c86 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Mon, 12 Oct 2020 14:32:19 -0400 Subject: [PATCH] blender: update to 2.90.1. [ci skip] --- srcpkgs/blender/patches/disable_werror.patch | 10 +- srcpkgs/blender/patches/musl.patch | 149 ++++++++++-------- srcpkgs/blender/patches/py39.patch | 28 ++++ srcpkgs/blender/patches/python39.patch | 153 ------------------- srcpkgs/blender/template | 26 ++-- 5 files changed, 131 insertions(+), 235 deletions(-) create mode 100644 srcpkgs/blender/patches/py39.patch delete mode 100644 srcpkgs/blender/patches/python39.patch diff --git a/srcpkgs/blender/patches/disable_werror.patch b/srcpkgs/blender/patches/disable_werror.patch index 635956f2aa9..9fada907e1c 100644 --- a/srcpkgs/blender/patches/disable_werror.patch +++ b/srcpkgs/blender/patches/disable_werror.patch @@ -6,8 +6,8 @@ index f22688f..c32aad1 100644 # Warnings if(CMAKE_COMPILER_IS_GNUCXX) -- ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion") -- ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion") - ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_no_error_unused_macros "-Wno-error=unused-macros") - unset(_has_cxxflag_float_conversion) - unset(_has_cxxflag_double_promotion) +- ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_float_conversion "-Werror=float-conversion") +- ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_cxxflag_double_promotion "-Werror=double-promotion") + ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS _has_no_error_unused_macros "-Wno-error=unused-macros") + unset(_has_cxxflag_float_conversion) + unset(_has_cxxflag_double_promotion) diff --git a/srcpkgs/blender/patches/musl.patch b/srcpkgs/blender/patches/musl.patch index c095171df1b..5cfded1586d 100644 --- a/srcpkgs/blender/patches/musl.patch +++ b/srcpkgs/blender/patches/musl.patch @@ -1,90 +1,111 @@ -diff -ru blender-2.82.org/CMakeLists.txt blender-2.82/CMakeLists.txt ---- blender-2.82.org/CMakeLists.txt 2020-02-13 01:42:10.000000000 -0800 -+++ blender-2.82/CMakeLists.txt 2020-02-28 03:28:50.491903370 -0800 -@@ -848,6 +848,19 @@ - endif() - endif() +From 8f2b2e92ffdec658d4eb999f41acf6c74a5b32ed Mon Sep 17 00:00:00 2001 +From: Leon Marz +Date: Tue, 1 Sep 2020 09:09:50 +0200 +Subject: [PATCH 1/2] musl fixes + +[ Taken from https://git.alpinelinux.org/aports/plain/testing/blender/0001-musl-fixes.patch ] + +Original Patch by Nathanael Copa + +--- + CMakeLists.txt | 13 +++++++++++++ + intern/guardedalloc/intern/mallocn_intern.h | 2 +- + intern/libc_compat/libc_compat.c | 2 -- + source/blender/blenlib/intern/system.c | 4 +++- + source/creator/creator_signals.c | 2 +- + 5 files changed, 18 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cee8675..111e6e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -138,6 +138,19 @@ get_blender_version() + #----------------------------------------------------------------------------- + # Options -+# musl-libc related checks (missing execinfo.h, and feenableexcept()) ++# musl-libc related checks (missing execinfo.h and feenableexcept()) +include(CheckIncludeFiles) +check_include_files(execinfo.h HAVE_EXECINFO_H) -+if (HAVE_EXECINFO_H) ++if(HAVE_EXECINFO_H) + add_definitions(-DHAVE_EXECINFO_H) +endif() + +include(CheckLibraryExists) +check_library_exists(m feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) -+if (HAVE_FEENABLEEXCEPT) ++if(HAVE_FEENABLEEXCEPT) + add_definitions(-DHAVE_FEENABLEEXCEPT) +endif() + - # See TEST_SSE_SUPPORT() for how this is defined. - - # Do it globally, SSE2 is required for quite some time now. -diff -ru blender-2.78.orig/source/blender/blenlib/intern/system.c blender-2.78a/source/blender/blenlib/intern/system.c ---- blender-2.78.orig/source/blender/blenlib/intern/system.c 2016-10-25 09:59:23.000000000 +0000 -+++ blender-2.78a/source/blender/blenlib/intern/system.c 2017-02-07 14:44:35.213040733 +0000 -@@ -77,7 +77,7 @@ - { - /* ------------- */ - /* Linux / Apple */ --#if defined(__linux__) || defined(__APPLE__) -+#if (defined(__linux__) && defined(HAVE_EXECINFO_H)) || defined(__APPLE__) - - #define SIZE 100 - void *buffer[SIZE]; -diff -ru blender-2.78.orig/source/creator/creator_signals.c blender-2.78a/source/creator/creator_signals.c ---- blender-2.78.orig/source/creator/creator_signals.c 2016-10-24 14:13:56.000000000 +0000 -+++ blender-2.78a/source/creator/creator_signals.c 2017-02-07 14:47:01.888625973 +0000 -@@ -309,7 +309,7 @@ - * set breakpoints on sig_handle_fpe */ - signal(SIGFPE, sig_handle_fpe); - --# if defined(__linux__) && defined(__GNUC__) -+# if defined(__linux__) && defined(__GNUC__) && defined(HAVE_FEENABLEEXCEPT) - feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); - # endif /* defined(__linux__) && defined(__GNUC__) */ - # if defined(OSX_SSE_FPE) ---- a/source/blender/blenlib/intern/system.c 2019-07-30 21:05:30.702224608 +0200 -+++ - 2019-07-30 21:13:21.535328709 +0200 -@@ -38,10 +38,13 @@ - # include - # pragma warning(pop) - #else --# include - # include - #endif - -+#if (defined(__linux__) && defined(HAVE_EXECINFO_H)) || defined(__APPLE__) -+# include -+#endif -+ - int BLI_cpu_support_sse2(void) - { - #if defined(__x86_64__) || defined(_M_X64) ---- a/intern/guardedalloc/intern/mallocn_intern.h 2019-07-24 09:41:39.000000000 +0200 -+++ - 2019-10-20 00:03:13.450031866 +0200 -@@ -40,7 +40,7 @@ + # Blender internal features + option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON) + mark_as_advanced(WITH_BLENDER) +diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h +index 8fc3e43..ee443c4 100644 +--- a/intern/guardedalloc/intern/mallocn_intern.h ++++ b/intern/guardedalloc/intern/mallocn_intern.h +@@ -33,7 +33,7 @@ #undef HAVE_MALLOC_STATS #define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */ -#if defined(__linux__) || (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \ -+#if (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \ ++#if defined(__linux__) && defined(HAVE_EXECINFO_H) || (defined(__FreeBSD_kernel__) && !defined(__FreeBSD__)) || \ defined(__GLIBC__) # include # define HAVE_MALLOC_STATS +diff --git a/intern/libc_compat/libc_compat.c b/intern/libc_compat/libc_compat.c +index 78e387e..d21c281 100644 --- a/intern/libc_compat/libc_compat.c +++ b/intern/libc_compat/libc_compat.c -@@ -21,10 +21,10 @@ - * incompatible with the system libraries that Blender is built on. To solve - * this we add a few -ffast-math symbols that can be missing. */ - --#ifdef __linux__ +@@ -25,7 +25,6 @@ # include # include -+#ifdef __GLIBC__ - # if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31) +-# if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31) double __exp_finite(double x); + double __exp2_finite(double x); +@@ -124,5 +123,4 @@ float __powf_finite(float x, float y) + return powf(x, y); + } + +-# endif /* __GLIBC_PREREQ */ + #endif /* __linux__ */ +diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c +index 20edbb9..6e856cd 100644 +--- a/source/blender/blenlib/intern/system.c ++++ b/source/blender/blenlib/intern/system.c +@@ -35,7 +35,9 @@ + + # include "BLI_winstuff.h" + #else ++#if defined(HAVE_EXECINFO_H) + # include ++#endif + # include + #endif + +@@ -80,7 +82,7 @@ void BLI_system_backtrace(FILE *fp) + { + /* ------------- */ + /* Linux / Apple */ +-# if defined(__linux__) || defined(__APPLE__) ++# if defined(__linux__) && defined(HAVE_EXECINFO_H) || defined(__APPLE__) + + # define SIZE 100 + void *buffer[SIZE]; +diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c +index ad0b7b2..01d5e37 100644 +--- a/source/creator/creator_signals.c ++++ b/source/creator/creator_signals.c +@@ -269,7 +269,7 @@ void main_signal_setup_fpe(void) + * set breakpoints on sig_handle_fpe */ + signal(SIGFPE, sig_handle_fpe); +-# if defined(__linux__) && defined(__GNUC__) ++# if defined(__linux__) && defined(__GNUC__) && defined(HAVE_FEENABLEEXCEPT) + feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); + # endif /* defined(__linux__) && defined(__GNUC__) */ + # if defined(OSX_SSE_FPE) +-- +2.28.0 + diff --git a/srcpkgs/blender/patches/py39.patch b/srcpkgs/blender/patches/py39.patch new file mode 100644 index 00000000000..b97f240623c --- /dev/null +++ b/srcpkgs/blender/patches/py39.patch @@ -0,0 +1,28 @@ +The PyEval_ReleaseLock function is deprecated and triggers a segfault with +Python 3.9.0. The apparent fix is documented in + + https://developer.blender.org/T81688 + +as adapted from + + https://src.fedoraproject.org/rpms/gdb/blob/28b99d9981ec195cc7dfedc33f8ec859607af381/f/gdb-rhbz1829702-fix-python39.patch + +and used in the `py39.patch` in the Void gdb template. + +--- a/source/blender/python/generic/bpy_threads.c 2020-10-13 15:29:16.708347045 -0400 ++++ b/source/blender/python/generic/bpy_threads.c 2020-10-13 15:29:43.123345331 -0400 +@@ -29,13 +29,7 @@ + /* 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(); +- } +- ++ PyThreadState *tstate = PyEval_SaveThread(); + return (BPy_ThreadStatePtr)tstate; + } + diff --git a/srcpkgs/blender/patches/python39.patch b/srcpkgs/blender/patches/python39.patch deleted file mode 100644 index 9c87fa95c6f..00000000000 --- a/srcpkgs/blender/patches/python39.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 56d0df51a36fdce7ec2d1fbb7b47b1d95b591b5f Mon Sep 17 00:00:00 2001 -From: Campbell Barton -Date: Mon, 22 Jun 2020 14:51:20 +1000 -Subject: [PATCH] Python: support building again version 3.9 (unreleased) - -Resolves T78089, no functional changes. ---- - .../blender/python/mathutils/mathutils_Matrix.c | 16 +++++++++------- - .../python/mathutils/mathutils_Quaternion.c | 14 ++++++++------ - .../blender/python/mathutils/mathutils_Vector.c | 6 +++--- - 3 files changed, 20 insertions(+), 16 deletions(-) - -diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c -index 327ee4dd1c3..63137e094b7 100644 ---- a/source/blender/python/mathutils/mathutils_Matrix.c -+++ b/source/blender/python/mathutils/mathutils_Matrix.c -@@ -42,7 +42,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) -@@ -395,14 +396,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); -@@ -1738,7 +1740,7 @@ PyDoc_STRVAR( - " .. note:: When the matrix cant be adjugated a :exc:`ValueError` exception is raised.\n"); - 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( -@@ -1946,7 +1948,7 @@ PyDoc_STRVAR(Matrix_transposed_doc, - " :rtype: :class:`Matrix`\n"); - 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() ------------------*/ -@@ -1992,7 +1994,7 @@ PyDoc_STRVAR(Matrix_normalized_doc, - " :rtype: :class:`Matrix`\n"); - 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 39d84c1ac96..7ce0ea5f249 100644 ---- a/source/blender/python/mathutils/mathutils_Quaternion.c -+++ b/source/blender/python/mathutils/mathutils_Quaternion.c -@@ -34,7 +34,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); -@@ -463,7 +464,7 @@ PyDoc_STRVAR(Quaternion_normalized_doc, - " :rtype: :class:`Quaternion`\n"); - 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, -@@ -490,7 +491,7 @@ PyDoc_STRVAR(Quaternion_inverted_doc, - " :rtype: :class:`Quaternion`\n"); - 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, -@@ -553,7 +554,7 @@ PyDoc_STRVAR(Quaternion_conjugated_doc, - " :rtype: :class:`Quaternion`\n"); - 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, -@@ -1385,10 +1386,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 ace7480ee81..15ae811fd91 100644 ---- a/source/blender/python/mathutils/mathutils_Vector.c -+++ b/source/blender/python/mathutils/mathutils_Vector.c -@@ -96,10 +96,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; -@@ -376,7 +376,7 @@ PyDoc_STRVAR(Vector_normalized_doc, - " :rtype: :class:`Vector`\n"); - 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/srcpkgs/blender/template b/srcpkgs/blender/template index 731f4af9f68..b724ef01318 100644 --- a/srcpkgs/blender/template +++ b/srcpkgs/blender/template @@ -1,15 +1,17 @@ # Template file for 'blender' pkgname=blender -version=2.83.6 -revision=3 -archs="x86_64* i686* ppc64*" +version=2.90.1 +revision=1 +archs="x86_64* ppc64*" build_style="cmake" pycompile_dirs="/usr/share/blender/${version%.*}/scripts" -configure_args="-DWITH_INSTALL_PORTABLE=OFF -DWITH_PYTHON_INSTALL=OFF -DWITH_JACK=ON -DWITH_CODEC_FFMPEG=ON - -DWITH_CODEC_SNDFILE=ON -DWITH_OPENMP=ON -DWITH_FFTW3=ON -DWITH_MOD_OCEANSIM=ON -DWITH_CYCLES=ON - -DWITH_OPENCOLORIO=ON -DWITH_IMAGE_OPENEXR=ON -DWITH_IMAGE_OPENJPEG=ON -DWITH_OPENSUBDIV=ON - -DWITH_OPENCOLLADA=ON -DWITH_SYSTEM_GLEW=ON -DWITH_OPENVDB=ON -DWITH_ALEMBIC=ON -DWITH_BUILDINFO=OFF - -DPYTHON_VERSION=$py3_ver -DPYTHON_LIBPATH=/usr/lib -DPYTHON_LIBRARY='python${py3_ver}${py3_abiver}' +configure_args="-DWITH_INSTALL_PORTABLE=OFF -DWITH_PYTHON_INSTALL=OFF + -DWITH_JACK=ON -DWITH_CODEC_FFMPEG=ON -DWITH_CODEC_SNDFILE=ON -DWITH_OPENMP=ON + -DWITH_FFTW3=ON -DWITH_MOD_OCEANSIM=ON -DWITH_CYCLES_EMBREE=OFF -DWITH_OPENCOLORIO=ON + -DWITH_IMAGE_OPENEXR=ON -DWITH_IMAGE_OPENJPEG=ON -DWITH_OPENSUBDIV=ON + -DWITH_OPENCOLLADA=ON -DWITH_SYSTEM_GLEW=ON -DWITH_OPENVDB=ON -DWITH_ALEMBIC=ON + -DWITH_BUILDINFO=OFF -DPYTHON_VERSION=$py3_ver -DPYTHON_LIBPATH=/usr/lib + -DPYTHON_LIBRARY='python${py3_ver}${py3_abiver}' -DPYTHON_INCLUDE_DIRS=/$py3_inc" makedepends="libgomp-devel libpng-devel tiff-devel python3-devel glu-devel glew-devel freetype-devel jack-devel libopenal-devel libsndfile-devel @@ -23,15 +25,13 @@ maintainer="Enno Boland " license="GPL-2.0-or-later" homepage="http://www.blender.org" distfiles="http://download.blender.org/source/${pkgname}-${version}.tar.xz" -checksum=2338297d6061efd98c05878e954450ef26ba2dfe49658d6156f6b3eaf9b92de0 +checksum=e78dcc946c823ad1bd89bcc6938fc6b375540ec3eff58649586acf1f6a653d99 python_version=3 patch_args="-Np1" case "$XBPS_TARGET_MACHINE" in -*-musl) # crashes at startup in jemallocs free() - ;; -*) makedepends+=" jemalloc-devel" - ;; + *-musl) ;; + *) makedepends+=" jemalloc-devel" ;; esac case "$XBPS_TARGET_MACHINE" in