* [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not)
@ 2022-09-21 17:00 sgn
2022-09-24 7:00 ` [PR PATCH] [Updated] " sgn
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: sgn @ 2022-09-21 17:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]
There is a new pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages blender-more-opcodes
https://github.com/void-linux/void-packages/pull/39402
blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not)
Also prepare for Python 3.11
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: *\*NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/39402.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-blender-more-opcodes-39402.patch --]
[-- Type: text/x-diff, Size: 26689 bytes --]
From af4ebf419e3b07278429e2abd8bfe1a7e44ded86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Wed, 21 Sep 2022 23:54:55 +0700
Subject: [PATCH] blender: backport more Python's opcodes whitelist
Also prepare for Python 3.11
---
srcpkgs/blender/patches/0001-musl-fixes.patch | 47 ++--
.../blender/patches/0001-python-3.11.patch | 95 ++++++++
.../patches/0002-fix-linking-issue.patch | 13 +-
.../blender/patches/0002-python-3.11.patch | 66 ++++++
.../blender/patches/0003-python-3.11.patch | 203 ++++++++++++++++++
.../blender/patches/0004-python-3.11.patch | 58 +++++
srcpkgs/blender/patches/altivec-all.patch | 6 +-
.../patches/no-Werror-double-promotion.patch | 6 +-
srcpkgs/blender/template | 4 +-
9 files changed, 458 insertions(+), 40 deletions(-)
create mode 100644 srcpkgs/blender/patches/0001-python-3.11.patch
create mode 100644 srcpkgs/blender/patches/0002-python-3.11.patch
create mode 100644 srcpkgs/blender/patches/0003-python-3.11.patch
create mode 100644 srcpkgs/blender/patches/0004-python-3.11.patch
diff --git a/srcpkgs/blender/patches/0001-musl-fixes.patch b/srcpkgs/blender/patches/0001-musl-fixes.patch
index 0e64369b4379..0c5112eaae40 100644
--- a/srcpkgs/blender/patches/0001-musl-fixes.patch
+++ b/srcpkgs/blender/patches/0001-musl-fixes.patch
@@ -15,10 +15,10 @@ Original patch by Nathanael Copa
source/creator/creator_signals.c | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
-diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h
-index aa95615..f7e347d 100644
---- a/intern/guardedalloc/intern/mallocn_intern.h
-+++ b/intern/guardedalloc/intern/mallocn_intern.h
+Index: blender-3.0.0/intern/guardedalloc/intern/mallocn_intern.h
+===================================================================
+--- blender-3.0.0.orig/intern/guardedalloc/intern/mallocn_intern.h
++++ blender-3.0.0/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() */
@@ -28,10 +28,10 @@ index aa95615..f7e347d 100644
defined(__GLIBC__)
# include <malloc.h>
# 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
+Index: blender-3.0.0/intern/libc_compat/libc_compat.c
+===================================================================
+--- blender-3.0.0.orig/intern/libc_compat/libc_compat.c
++++ blender-3.0.0/intern/libc_compat/libc_compat.c
@@ -25,7 +25,6 @@
# include <features.h>
# include <math.h>
@@ -46,10 +46,10 @@ index 78e387e..d21c281 100644
-# endif /* __GLIBC_PREREQ */
#endif /* __linux__ */
-diff --git a/source/blender/blenlib/intern/system.c b/source/blender/blenlib/intern/system.c
-index 8e3d489..4d0789b 100644
---- a/source/blender/blenlib/intern/system.c
-+++ b/source/blender/blenlib/intern/system.c
+Index: blender-3.0.0/source/blender/blenlib/intern/system.c
+===================================================================
+--- blender-3.0.0.orig/source/blender/blenlib/intern/system.c
++++ blender-3.0.0/source/blender/blenlib/intern/system.c
@@ -35,7 +35,9 @@
# include "BLI_winstuff.h"
@@ -69,11 +69,11 @@ index 8e3d489..4d0789b 100644
# define SIZE 100
void *buffer[SIZE];
-diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h
-index eeaebd3..93a77a2 100644
---- a/source/blender/gpu/GPU_vertex_buffer.h
-+++ b/source/blender/gpu/GPU_vertex_buffer.h
-@@ -118,7 +118,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GPUVertBufRaw *a)
+Index: blender-3.0.0/source/blender/gpu/GPU_vertex_buffer.h
+===================================================================
+--- blender-3.0.0.orig/source/blender/gpu/GPU_vertex_buffer.h
++++ blender-3.0.0/source/blender/gpu/GPU_vertex_buffer.h
+@@ -127,7 +127,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GP
{
unsigned char *data = a->data;
a->data += a->stride;
@@ -81,11 +81,11 @@ index eeaebd3..93a77a2 100644
return (void *)data;
}
-diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c
-index 29e12a9..d90da8f 100644
---- a/source/creator/creator_signals.c
-+++ b/source/creator/creator_signals.c
-@@ -269,7 +269,7 @@ void main_signal_setup_fpe(void)
+Index: blender-3.0.0/source/creator/creator_signals.c
+===================================================================
+--- blender-3.0.0.orig/source/creator/creator_signals.c
++++ blender-3.0.0/source/creator/creator_signals.c
+@@ -271,7 +271,7 @@ void main_signal_setup_fpe(void)
* set breakpoints on sig_handle_fpe */
signal(SIGFPE, sig_handle_fpe);
@@ -94,6 +94,3 @@ index 29e12a9..d90da8f 100644
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
# endif /* defined(__linux__) && defined(__GNUC__) */
# if defined(OSX_SSE_FPE)
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/0001-python-3.11.patch b/srcpkgs/blender/patches/0001-python-3.11.patch
new file mode 100644
index 000000000000..4033c6617ba9
--- /dev/null
+++ b/srcpkgs/blender/patches/0001-python-3.11.patch
@@ -0,0 +1,95 @@
+From 7537369498bf61f872554b0ce2efc439008165a4 Mon Sep 17 00:00:00 2001
+From: Campbell Barton <campbell@blender.org>
+Date: Tue, 5 Jul 2022 13:41:49 +1000
+Subject: [PATCH] Python: remove invalid Py_TPFLAGS_HAVE_GC usage
+
+Blender wouldn't start with Python 3.11 because of an error in
+Py_TPFLAGS_HAVE_GC usage for `bpy.app.handlers.persistent`.
+Remove this flag as it's not necessary.
+
+Part of fix for T99277.
+---
+ .../blender/python/intern/bpy_app_handlers.c | 70 +++++++++----------
+ 1 file changed, 35 insertions(+), 35 deletions(-)
+
+Index: blender-3.0.0/source/blender/python/intern/bpy_app_handlers.c
+===================================================================
+--- blender-3.0.0.orig/source/blender/python/intern/bpy_app_handlers.c
++++ blender-3.0.0/source/blender/python/intern/bpy_app_handlers.c
+@@ -151,41 +151,41 @@ static PyTypeObject BPyPersistent_Type =
+ 0, /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+- 0, /* tp_dealloc */
+- 0, /* tp_print */
+- 0, /* tp_getattr */
+- 0, /* tp_setattr */
+- 0, /* tp_reserved */
+- 0, /* tp_repr */
+- 0, /* tp_as_number */
+- 0, /* tp_as_sequence */
+- 0, /* tp_as_mapping */
+- 0, /* tp_hash */
+- 0, /* tp_call */
+- 0, /* tp_str */
+- 0, /* tp_getattro */
+- 0, /* tp_setattro */
+- 0, /* tp_as_buffer */
+- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, /* tp_flags */
+- 0, /* tp_doc */
+- 0, /* tp_traverse */
+- 0, /* tp_clear */
+- 0, /* tp_richcompare */
+- 0, /* tp_weaklistoffset */
+- 0, /* tp_iter */
+- 0, /* tp_iternext */
+- 0, /* tp_methods */
+- 0, /* tp_members */
+- 0, /* tp_getset */
+- 0, /* tp_base */
+- 0, /* tp_dict */
+- 0, /* tp_descr_get */
+- 0, /* tp_descr_set */
+- 0, /* tp_dictoffset */
+- 0, /* tp_init */
+- 0, /* tp_alloc */
+- bpy_app_handlers_persistent_new, /* tp_new */
+- 0, /* tp_free */
++ 0, /* tp_dealloc */
++ 0, /* tp_print */
++ 0, /* tp_getattr */
++ 0, /* tp_setattr */
++ 0, /* tp_reserved */
++ 0, /* tp_repr */
++ 0, /* tp_as_number */
++ 0, /* tp_as_sequence */
++ 0, /* tp_as_mapping */
++ 0, /* tp_hash */
++ 0, /* tp_call */
++ 0, /* tp_str */
++ 0, /* tp_getattro */
++ 0, /* tp_setattro */
++ 0, /* tp_as_buffer */
++ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
++ 0, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ 0, /* tp_iter */
++ 0, /* tp_iternext */
++ 0, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ 0, /* tp_init */
++ 0, /* tp_alloc */
++ bpy_app_handlers_persistent_new, /* tp_new */
++ 0, /* tp_free */
+ };
+
+ static PyObject *py_cb_array[BKE_CB_EVT_TOT] = {NULL};
diff --git a/srcpkgs/blender/patches/0002-fix-linking-issue.patch b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
index 28683714e126..ce6848b90080 100644
--- a/srcpkgs/blender/patches/0002-fix-linking-issue.patch
+++ b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
@@ -9,17 +9,14 @@ Subject: [PATCH 2/3] fix linking issue
intern/ghost/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
-index 1739659..d6b442b 100644
---- a/intern/ghost/CMakeLists.txt
-+++ b/intern/ghost/CMakeLists.txt
-@@ -484,5 +484,5 @@ if(WITH_XR_OPENXR)
+Index: blender-3.0.0/intern/ghost/CMakeLists.txt
+===================================================================
+--- blender-3.0.0.orig/intern/ghost/CMakeLists.txt
++++ blender-3.0.0/intern/ghost/CMakeLists.txt
+@@ -536,5 +536,5 @@ if(WITH_XR_OPENXR)
endif()
add_definitions(${GL_DEFINITIONS})
-
+list(APPEND LIB "-lX11" "-lXi" "-lXxf86vm" "-lXfixes" "-lXrender")
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/0002-python-3.11.patch b/srcpkgs/blender/patches/0002-python-3.11.patch
new file mode 100644
index 000000000000..6ebd6d2dcaf3
--- /dev/null
+++ b/srcpkgs/blender/patches/0002-python-3.11.patch
@@ -0,0 +1,66 @@
+From dfa52017638abdf59791e5588c439d3a558a191d Mon Sep 17 00:00:00 2001
+From: Campbell Barton <campbell@blender.org>
+Date: Tue, 5 Jul 2022 13:41:53 +1000
+Subject: [PATCH] Python: add opcodes for safe py-drivers
+
+New opcodes added since 3.7 meant some actions such as `len()`
+were disabled in safe py-driver execution.
+
+The following opcodes have been added, see [0] for details:
+
+- ROT_FOUR: similar to existing ROT_* opcodes, added v3.8.
+
+- ROT_N: similar to existing ROT_* opcodes, added v3.10.
+
+- GET_LEN: Push len(TOS) onto the stack, added v3.10.
+
+- IS_OP: for ternary operator, added v3.9.
+
+- BUILD_SLICE: access `slice` built-in, doesn't expose new
+ functionality beyond existing `__getitem__` access.
+
+[0]: https://docs.python.org/3.10/library/dis.html
+---
+ source/blender/python/intern/bpy_driver.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+Index: blender-3.0.0/source/blender/python/intern/bpy_driver.c
+===================================================================
+--- blender-3.0.0.orig/source/blender/python/intern/bpy_driver.c
++++ blender-3.0.0/source/blender/python/intern/bpy_driver.c
+@@ -281,6 +281,7 @@ static const char secure_opcodes[255] =
+ OK_OP(ROT_THREE),
+ OK_OP(DUP_TOP),
+ OK_OP(DUP_TOP_TWO),
++ OK_OP(ROT_FOUR),
+ OK_OP(NOP),
+ OK_OP(UNARY_POSITIVE),
+ OK_OP(UNARY_NEGATIVE),
+@@ -298,6 +299,7 @@ static const char secure_opcodes[255] =
+ OK_OP(BINARY_TRUE_DIVIDE),
+ OK_OP(INPLACE_FLOOR_DIVIDE),
+ OK_OP(INPLACE_TRUE_DIVIDE),
++ OK_OP(GET_LEN),
+ OK_OP(INPLACE_ADD),
+ OK_OP(INPLACE_SUBTRACT),
+ OK_OP(INPLACE_MULTIPLY),
+@@ -314,6 +316,7 @@ static const char secure_opcodes[255] =
+ OK_OP(INPLACE_XOR),
+ OK_OP(INPLACE_OR),
+ OK_OP(RETURN_VALUE),
++ OK_OP(ROT_N),
+ OK_OP(BUILD_TUPLE),
+ OK_OP(BUILD_LIST),
+ OK_OP(BUILD_SET),
+@@ -326,9 +329,11 @@ static const char secure_opcodes[255] =
+ OK_OP(POP_JUMP_IF_FALSE),
+ OK_OP(POP_JUMP_IF_TRUE),
+ OK_OP(LOAD_GLOBAL),
++ OK_OP(IS_OP),
+ OK_OP(LOAD_FAST),
+ OK_OP(STORE_FAST),
+ OK_OP(DELETE_FAST),
++ OK_OP(BUILD_SLICE),
+ OK_OP(LOAD_DEREF),
+ OK_OP(STORE_DEREF),
+
diff --git a/srcpkgs/blender/patches/0003-python-3.11.patch b/srcpkgs/blender/patches/0003-python-3.11.patch
new file mode 100644
index 000000000000..b3b118972009
--- /dev/null
+++ b/srcpkgs/blender/patches/0003-python-3.11.patch
@@ -0,0 +1,203 @@
+From 780c0ea097444c3be60314dffd203c099720badb Mon Sep 17 00:00:00 2001
+From: Campbell Barton <campbell@blender.org>
+Date: Tue, 5 Jul 2022 13:41:55 +1000
+Subject: [PATCH] Python: support v3.11 (beta) with changes to PyFrameObject &
+ opcodes
+
+- Use API calls to access frame-data as PyFrameObject is now opaque.
+- Update opcodes allowed for safe driver evaluation.
+
+**Details**
+
+Some opcodes have been added for safe-driver evaluation.
+Python 3.11 removes many opcodes - the number of accepted opcodes in
+Blender's listing dropped from 65 to 43) however some new opcodes
+also needed to be added. As this relates to security details about newly
+added opcodes have been noted below (see [0] for full documentation).
+
+Newly added opcodes:
+
+- CACHE:
+ Used to control caching instructions.
+
+- RESUME:
+ A no-op. Performs internal checks.
+
+- BINARY_OP:
+ Implements the binary and in-place operators,
+ replacing specific binary operations.
+
+- CALL, PRECALL, KW_NAMES:
+ Used for calling functions, replacing some existing opcodes.
+
+- POP_JUMP_{FORWARD/BACKWARD}_IF_{TRUE/FALSE/NONE/NOT_NONE}.
+ Manipulate the byte-code counter.
+
+- SWAP, PUSH_NULL.
+ Stack manipulation.
+
+Resolves T99277.
+
+[0]: https://docs.python.org/3.11/library/dis.html
+---
+ source/blender/python/generic/py_capi_utils.c | 8 ++-
+ source/blender/python/intern/bpy_driver.c | 62 ++++++++++++++++++-
+ source/blender/python/intern/bpy_interface.c | 19 +++---
+ source/blender/python/intern/bpy_traceback.c | 3 +-
+ 4 files changed, 79 insertions(+), 13 deletions(-)
+
+--- a/source/blender/python/generic/py_capi_utils.c
++++ b/source/blender/python/generic/py_capi_utils.c
+@@ -671,6 +671,7 @@ void PyC_StackSpit(void)
+ void PyC_FileAndNum(const char **r_filename, int *r_lineno)
+ {
+ PyFrameObject *frame;
++ PyCodeObject *code;
+
+ if (r_filename) {
+ *r_filename = NULL;
+@@ -679,13 +680,16 @@ void PyC_FileAndNum(const char **r_filen
+ *r_lineno = -1;
+ }
+
+- if (!(frame = PyThreadState_GET()->frame)) {
++ if (!(frame = PyEval_GetFrame())) {
++ return;
++ }
++ if (!(code = PyFrame_GetCode(frame))) {
+ return;
+ }
+
+ /* when executing a script */
+ if (r_filename) {
+- *r_filename = PyUnicode_AsUTF8(frame->f_code->co_filename);
++ *r_filename = PyUnicode_AsUTF8(code->co_filename);
+ }
+
+ /* when executing a module */
+--- a/source/blender/python/intern/bpy_driver.c
++++ b/source/blender/python/intern/bpy_driver.c
+@@ -276,6 +276,56 @@ static void pydriver_error(ChannelDriver
+ # define OK_OP(op) [op] = 1
+
+ static const char secure_opcodes[255] = {
++# if PY_VERSION_HEX >= 0x030b0000 /* Python 3.11 & newer. */
++
++ OK_OP(CACHE),
++ OK_OP(POP_TOP),
++ OK_OP(PUSH_NULL),
++ OK_OP(NOP),
++ OK_OP(UNARY_POSITIVE),
++ OK_OP(UNARY_NEGATIVE),
++ OK_OP(UNARY_NOT),
++ OK_OP(UNARY_INVERT),
++ OK_OP(BINARY_SUBSCR),
++ OK_OP(GET_LEN),
++ OK_OP(RETURN_VALUE),
++ OK_OP(SWAP),
++ OK_OP(BUILD_TUPLE),
++ OK_OP(BUILD_LIST),
++ OK_OP(BUILD_SET),
++ OK_OP(BUILD_MAP),
++ OK_OP(COMPARE_OP),
++ OK_OP(JUMP_FORWARD),
++ OK_OP(JUMP_IF_FALSE_OR_POP),
++ OK_OP(JUMP_IF_TRUE_OR_POP),
++ OK_OP(POP_JUMP_FORWARD_IF_FALSE),
++ OK_OP(POP_JUMP_FORWARD_IF_TRUE),
++ OK_OP(LOAD_GLOBAL),
++ OK_OP(IS_OP),
++ OK_OP(BINARY_OP),
++ OK_OP(LOAD_FAST),
++ OK_OP(STORE_FAST),
++ OK_OP(DELETE_FAST),
++ OK_OP(POP_JUMP_FORWARD_IF_NOT_NONE),
++ OK_OP(POP_JUMP_FORWARD_IF_NONE),
++ OK_OP(BUILD_SLICE),
++ OK_OP(LOAD_DEREF),
++ OK_OP(STORE_DEREF),
++ OK_OP(RESUME),
++ OK_OP(POP_JUMP_BACKWARD_IF_NOT_NONE),
++ OK_OP(POP_JUMP_BACKWARD_IF_NONE),
++ OK_OP(POP_JUMP_BACKWARD_IF_FALSE),
++ OK_OP(POP_JUMP_BACKWARD_IF_TRUE),
++
++ /* Special cases. */
++ OK_OP(LOAD_CONST), /* Ok because constants are accepted. */
++ OK_OP(LOAD_NAME), /* Ok, because `PyCodeObject.names` is checked. */
++ OK_OP(CALL), /* Ok, because we check its "name" before calling. */
++ OK_OP(KW_NAMES), /* Ok, because it's used for calling functions with keyword arguments. */
++ OK_OP(PRECALL), /* Ok, because it's used for calling. */
++
++# else /* Python 3.10 and older. */
++
+ OK_OP(POP_TOP),
+ OK_OP(ROT_TWO),
+ OK_OP(ROT_THREE),
+@@ -343,6 +393,8 @@ static const char secure_opcodes[255] =
+ OK_OP(CALL_FUNCTION), /* ok, because we check its 'name' before calling */
+ OK_OP(CALL_FUNCTION_KW),
+ OK_OP(CALL_FUNCTION_EX),
++
++# endif /* Python 3.10 and older. */
+ };
+
+ # undef OK_OP
+@@ -379,7 +431,15 @@ static bool bpy_driver_secure_bytecode_v
+ const _Py_CODEUNIT *codestr;
+ Py_ssize_t code_len;
+
+- PyBytes_AsStringAndSize(py_code->co_code, (char **)&codestr, &code_len);
++ PyObject *co_code;
++
++# if PY_VERSION_HEX >= 0x030b0000 /* Python 3.11 & newer. */
++ co_code = py_code->_co_code;
++# else
++ co_code = py_code->co_code;
++# endif
++
++ PyBytes_AsStringAndSize(co_code, (char **)&codestr, &code_len);
+ code_len /= sizeof(*codestr);
+
+ for (Py_ssize_t i = 0; i < code_len; i++) {
+--- a/source/blender/python/intern/bpy_interface.c
++++ b/source/blender/python/intern/bpy_interface.c
+@@ -605,16 +605,17 @@ void BPY_python_use_system_env(void)
+ void BPY_python_backtrace(FILE *fp)
+ {
+ fputs("\n# Python backtrace\n", fp);
+- PyThreadState *tstate = PyGILState_GetThisThreadState();
+- if (tstate != NULL && tstate->frame != NULL) {
+- PyFrameObject *frame = tstate->frame;
+- do {
+- const int line = PyCode_Addr2Line(frame->f_code, frame->f_lasti);
+- const char *filename = PyUnicode_AsUTF8(frame->f_code->co_filename);
+- const char *funcname = PyUnicode_AsUTF8(frame->f_code->co_name);
+- fprintf(fp, " File \"%s\", line %d in %s\n", filename, line, funcname);
+- } while ((frame = frame->f_back));
++ PyFrameObject *frame;
++ if (!(frame = PyEval_GetFrame())) {
++ return;
+ }
++ do {
++ PyCodeObject *code = PyFrame_GetCode(frame);
++ const int line = PyFrame_GetLineNumber(frame);
++ const char *filepath = PyUnicode_AsUTF8(code->co_filename);
++ const char *funcname = PyUnicode_AsUTF8(code->co_name);
++ fprintf(fp, " File \"%s\", line %d in %s\n", filepath, line, funcname);
++ } while ((frame = PyFrame_GetBack(frame)));
+ }
+
+ void BPY_DECREF(void *pyob_ptr)
+--- a/source/blender/python/intern/bpy_traceback.c
++++ b/source/blender/python/intern/bpy_traceback.c
+@@ -34,7 +34,8 @@
+
+ static const char *traceback_filepath(PyTracebackObject *tb, PyObject **coerce)
+ {
+- *coerce = PyUnicode_EncodeFSDefault(tb->tb_frame->f_code->co_filename);
++ PyCodeObject *code = PyFrame_GetCode(tb->tb_frame);
++ *coerce = PyUnicode_EncodeFSDefault(code->co_filename);
+ return PyBytes_AS_STRING(*coerce);
+ }
+
diff --git a/srcpkgs/blender/patches/0004-python-3.11.patch b/srcpkgs/blender/patches/0004-python-3.11.patch
new file mode 100644
index 000000000000..2ff495371ceb
--- /dev/null
+++ b/srcpkgs/blender/patches/0004-python-3.11.patch
@@ -0,0 +1,58 @@
+From 378f65f7d9843ea789a66623019163f935af141e Mon Sep 17 00:00:00 2001
+From: Campbell Barton <campbell@blender.org>
+Date: Thu, 7 Jul 2022 12:30:40 +1000
+Subject: [PATCH] Fix Py-driver byte code access with Python 3.11
+
+Error in [0] which assumed the struct member was renamed however
+byte-code access from PyCodeObject now requires an API call.
+
+Thanks to @music for pointing this out.
+
+[0]: 780c0ea097444c3be60314dffd203c099720badb
+---
+ source/blender/python/intern/bpy_driver.c | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+--- a/source/blender/python/intern/bpy_driver.c
++++ b/source/blender/python/intern/bpy_driver.c
+@@ -434,13 +434,19 @@ static bool bpy_driver_secure_bytecode_v
+ PyObject *co_code;
+
+ # if PY_VERSION_HEX >= 0x030b0000 /* Python 3.11 & newer. */
+- co_code = py_code->_co_code;
++ co_code = PyCode_GetCode(py_code);
++ if (UNLIKELY(!co_code)) {
++ PyErr_Print();
++ PyErr_Clear();
++ return false;
++ }
+ # else
+ co_code = py_code->co_code;
+ # endif
+
+ PyBytes_AsStringAndSize(co_code, (char **)&codestr, &code_len);
+ code_len /= sizeof(*codestr);
++ bool ok = true;
+
+ for (Py_ssize_t i = 0; i < code_len; i++) {
+ const int opcode = _Py_OPCODE(codestr[i]);
+@@ -449,11 +455,17 @@ static bool bpy_driver_secure_bytecode_v
+ "\tBPY_driver_eval() - restricted access disallows opcode '%d', "
+ "enable auto-execution to support\n",
+ opcode);
+- return false;
++ ok = false;
++ break;
+ }
+ }
+
+-# undef CODESIZE
++# if PY_VERSION_HEX >= 0x030b0000 /* Python 3.11 & newer. */
++ Py_DECREF(co_code);
++# endif
++ if (!ok) {
++ return false;
++ }
+ }
+
+ return true;
diff --git a/srcpkgs/blender/patches/altivec-all.patch b/srcpkgs/blender/patches/altivec-all.patch
index 115e1ea6fd03..bc6858b336d3 100644
--- a/srcpkgs/blender/patches/altivec-all.patch
+++ b/srcpkgs/blender/patches/altivec-all.patch
@@ -1,8 +1,10 @@
This applies a better workaround for C++ type conflicts
in AltiVec/C++, allowing it to build on BE ppc(64).
---- a/extern/clew/include/clew.h
-+++ b/extern/clew/include/clew.h
+Index: blender-3.0.0/extern/clew/include/clew.h
+===================================================================
+--- blender-3.0.0.orig/extern/clew/include/clew.h
++++ blender-3.0.0/extern/clew/include/clew.h
@@ -370,15 +370,18 @@ typedef unsigned int cl_GLenum;
/* Define basic vector types */
diff --git a/srcpkgs/blender/patches/no-Werror-double-promotion.patch b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
index 2d17a6da1818..94533140866d 100644
--- a/srcpkgs/blender/patches/no-Werror-double-promotion.patch
+++ b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
@@ -1,5 +1,7 @@
---- ./intern/cycles/CMakeLists.txt.orig 2021-04-16 20:47:50.466754473 +0200
-+++ ./intern/cycles/CMakeLists.txt 2021-04-16 20:48:06.199903232 +0200
+Index: blender-3.0.0/intern/cycles/CMakeLists.txt
+===================================================================
+--- blender-3.0.0.orig/intern/cycles/CMakeLists.txt
++++ blender-3.0.0/intern/cycles/CMakeLists.txt
@@ -336,7 +336,7 @@ endif()
# Warnings
if(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index 28befed1faf8..da38be21761a 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
# Template file for 'blender'
pkgname=blender
version=3.0.0
-revision=5
+revision=6
archs="x86_64* ppc64*"
build_style="cmake"
pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
@@ -28,8 +28,6 @@ homepage="https://www.blender.org"
distfiles="https://download.blender.org/source/blender-${version}.tar.xz"
checksum=50f0f32bcdf8825a12ba5c8d853b6e6c6b2da65ef01e858ea5900a06cccbf1cb
python_version=3
-CXXFLAGS="-DNDEBUG"
-CFLAGS="$CXXFLAGS"
LDFLAGS="-Wl,-z,stack-size=2097152"
# Blender tests are executed against a system installation of blender. This
# is currently not supported by xbps-src.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Updated] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not)
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
@ 2022-09-24 7:00 ` sgn
2022-09-25 2:00 ` blender: blender: update to 3.3.0 oreo639
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-09-24 7:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]
There is an updated pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages blender-more-opcodes
https://github.com/void-linux/void-packages/pull/39402
blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not)
Also prepare for Python 3.11
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: *\*NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/39402.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-blender-more-opcodes-39402.patch --]
[-- Type: text/x-diff, Size: 9857 bytes --]
From e2647a734a2e7128d045d48f58a59cb77409ad4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Sat, 24 Sep 2022 13:37:54 +0700
Subject: [PATCH] blender: update to 3.3.0.
---
srcpkgs/blender/patches/0001-musl-fixes.patch | 65 +++++++++----------
.../patches/0002-fix-linking-issue.patch | 13 ++--
srcpkgs/blender/patches/altivec-all.patch | 6 +-
.../patches/no-Werror-double-promotion.patch | 19 +++---
srcpkgs/blender/template | 15 ++---
5 files changed, 58 insertions(+), 60 deletions(-)
diff --git a/srcpkgs/blender/patches/0001-musl-fixes.patch b/srcpkgs/blender/patches/0001-musl-fixes.patch
index 0e64369b4379..330c91397349 100644
--- a/srcpkgs/blender/patches/0001-musl-fixes.patch
+++ b/srcpkgs/blender/patches/0001-musl-fixes.patch
@@ -15,11 +15,11 @@ Original patch by Nathanael Copa
source/creator/creator_signals.c | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
-diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h
-index aa95615..f7e347d 100644
---- a/intern/guardedalloc/intern/mallocn_intern.h
-+++ b/intern/guardedalloc/intern/mallocn_intern.h
-@@ -33,7 +33,7 @@
+Index: blender-3.3.0/intern/guardedalloc/intern/mallocn_intern.h
+===================================================================
+--- blender-3.3.0.orig/intern/guardedalloc/intern/mallocn_intern.h
++++ blender-3.3.0/intern/guardedalloc/intern/mallocn_intern.h
+@@ -17,7 +17,7 @@
#undef HAVE_MALLOC_STATS
#define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */
@@ -28,29 +28,31 @@ index aa95615..f7e347d 100644
defined(__GLIBC__)
# include <malloc.h>
# 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
-@@ -25,7 +25,6 @@
+Index: blender-3.3.0/intern/libc_compat/libc_compat.c
+===================================================================
+--- blender-3.3.0.orig/intern/libc_compat/libc_compat.c
++++ blender-3.3.0/intern/libc_compat/libc_compat.c
+@@ -13,8 +13,6 @@
# include <features.h>
# include <math.h>
--# if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31)
+-# if defined(__GLIBC_PREREQ)
+-# if __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)
+@@ -113,6 +111,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 8e3d489..4d0789b 100644
---- a/source/blender/blenlib/intern/system.c
-+++ b/source/blender/blenlib/intern/system.c
-@@ -35,7 +35,9 @@
+-# endif /* __GLIBC_PREREQ(2, 31) */
+-# endif /* __GLIBC_PREREQ */
+ #endif /* __linux__ */
+Index: blender-3.3.0/source/blender/blenlib/intern/system.c
+===================================================================
+--- blender-3.3.0.orig/source/blender/blenlib/intern/system.c
++++ blender-3.3.0/source/blender/blenlib/intern/system.c
+@@ -21,7 +21,9 @@
# include "BLI_winstuff.h"
#else
@@ -60,7 +62,7 @@ index 8e3d489..4d0789b 100644
# include <unistd.h>
#endif
-@@ -80,7 +82,7 @@ void BLI_system_backtrace(FILE *fp)
+@@ -63,7 +65,7 @@ void BLI_system_backtrace(FILE *fp)
{
/* ------------- */
/* Linux / Apple */
@@ -69,11 +71,11 @@ index 8e3d489..4d0789b 100644
# define SIZE 100
void *buffer[SIZE];
-diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h
-index eeaebd3..93a77a2 100644
---- a/source/blender/gpu/GPU_vertex_buffer.h
-+++ b/source/blender/gpu/GPU_vertex_buffer.h
-@@ -118,7 +118,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GPUVertBufRaw *a)
+Index: blender-3.3.0/source/blender/gpu/GPU_vertex_buffer.h
+===================================================================
+--- blender-3.3.0.orig/source/blender/gpu/GPU_vertex_buffer.h
++++ blender-3.3.0/source/blender/gpu/GPU_vertex_buffer.h
+@@ -133,7 +133,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GP
{
unsigned char *data = a->data;
a->data += a->stride;
@@ -81,11 +83,11 @@ index eeaebd3..93a77a2 100644
return (void *)data;
}
-diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c
-index 29e12a9..d90da8f 100644
---- a/source/creator/creator_signals.c
-+++ b/source/creator/creator_signals.c
-@@ -269,7 +269,7 @@ void main_signal_setup_fpe(void)
+Index: blender-3.3.0/source/creator/creator_signals.c
+===================================================================
+--- blender-3.3.0.orig/source/creator/creator_signals.c
++++ blender-3.3.0/source/creator/creator_signals.c
+@@ -258,7 +258,7 @@ void main_signal_setup_fpe(void)
* set breakpoints on sig_handle_fpe */
signal(SIGFPE, sig_handle_fpe);
@@ -94,6 +96,3 @@ index 29e12a9..d90da8f 100644
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
# endif /* defined(__linux__) && defined(__GNUC__) */
# if defined(OSX_SSE_FPE)
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/0002-fix-linking-issue.patch b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
index 28683714e126..139bc7fd1dbd 100644
--- a/srcpkgs/blender/patches/0002-fix-linking-issue.patch
+++ b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
@@ -9,17 +9,14 @@ Subject: [PATCH 2/3] fix linking issue
intern/ghost/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
-index 1739659..d6b442b 100644
---- a/intern/ghost/CMakeLists.txt
-+++ b/intern/ghost/CMakeLists.txt
-@@ -484,5 +484,5 @@ if(WITH_XR_OPENXR)
+Index: blender-3.3.0/intern/ghost/CMakeLists.txt
+===================================================================
+--- blender-3.3.0.orig/intern/ghost/CMakeLists.txt
++++ blender-3.3.0/intern/ghost/CMakeLists.txt
+@@ -562,5 +562,5 @@ if(WITH_XR_OPENXR)
endif()
add_definitions(${GL_DEFINITIONS})
-
+list(APPEND LIB "-lX11" "-lXi" "-lXxf86vm" "-lXfixes" "-lXrender")
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/altivec-all.patch b/srcpkgs/blender/patches/altivec-all.patch
index 115e1ea6fd03..a504207d2bcc 100644
--- a/srcpkgs/blender/patches/altivec-all.patch
+++ b/srcpkgs/blender/patches/altivec-all.patch
@@ -1,8 +1,10 @@
This applies a better workaround for C++ type conflicts
in AltiVec/C++, allowing it to build on BE ppc(64).
---- a/extern/clew/include/clew.h
-+++ b/extern/clew/include/clew.h
+Index: blender-3.3.0/extern/clew/include/clew.h
+===================================================================
+--- blender-3.3.0.orig/extern/clew/include/clew.h
++++ blender-3.3.0/extern/clew/include/clew.h
@@ -370,15 +370,18 @@ typedef unsigned int cl_GLenum;
/* Define basic vector types */
diff --git a/srcpkgs/blender/patches/no-Werror-double-promotion.patch b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
index 2d17a6da1818..0710abe513fe 100644
--- a/srcpkgs/blender/patches/no-Werror-double-promotion.patch
+++ b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
@@ -1,11 +1,14 @@
---- ./intern/cycles/CMakeLists.txt.orig 2021-04-16 20:47:50.466754473 +0200
-+++ ./intern/cycles/CMakeLists.txt 2021-04-16 20:48:06.199903232 +0200
-@@ -336,7 +336,7 @@ endif()
- # Warnings
- if(CMAKE_COMPILER_IS_GNUCXX)
+Index: blender-3.3.0/intern/cycles/kernel/CMakeLists.txt
+===================================================================
+--- blender-3.3.0.orig/intern/cycles/kernel/CMakeLists.txt
++++ blender-3.3.0/intern/cycles/kernel/CMakeLists.txt
+@@ -947,9 +947,7 @@ endif()
+ # Warnings to avoid using doubles in the kernel.
+ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
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_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)
+- unset(_has_cxxflag_double_promotion)
+ endif()
+
+ cycles_add_library(cycles_kernel "${LIB}"
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index 28befed1faf8..bf4c10732c62 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
# Template file for 'blender'
pkgname=blender
-version=3.0.0
-revision=5
+version=3.3.0
+revision=1
archs="x86_64* ppc64*"
build_style="cmake"
pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
@@ -26,19 +26,16 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://www.blender.org"
distfiles="https://download.blender.org/source/blender-${version}.tar.xz"
-checksum=50f0f32bcdf8825a12ba5c8d853b6e6c6b2da65ef01e858ea5900a06cccbf1cb
+checksum=22c51a4e66385cb14818aa4d76dcf7fa6d6e103afb0d36916e12ea15988d21f0
python_version=3
-CXXFLAGS="-DNDEBUG"
-CFLAGS="$CXXFLAGS"
LDFLAGS="-Wl,-z,stack-size=2097152"
# Blender tests are executed against a system installation of blender. This
# is currently not supported by xbps-src.
make_check=no
-case "$XBPS_TARGET_MACHINE" in
- *-musl) ;;
- *) makedepends+=" jemalloc-devel" ;;
-esac
+if [ "$XBPS_TARGET_LIBC" != musl ]; then
+ makedepends+=" jemalloc-devel"
+fi
case "$XBPS_TARGET_MACHINE" in
x86_64*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
2022-09-24 7:00 ` [PR PATCH] [Updated] " sgn
@ 2022-09-25 2:00 ` oreo639
2022-09-25 2:00 ` oreo639
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2022-09-25 2:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/39402#issuecomment-1257099708
Comment:
Can you add `gmp-devel`?
https://github.com/void-linux/void-packages/pull/36772
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
2022-09-24 7:00 ` [PR PATCH] [Updated] " sgn
2022-09-25 2:00 ` blender: blender: update to 3.3.0 oreo639
@ 2022-09-25 2:00 ` oreo639
2022-09-25 2:00 ` oreo639
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2022-09-25 2:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 243 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/39402#issuecomment-1257099708
Comment:
Can you add `gmp-devel` for higher precision?
https://github.com/void-linux/void-packages/pull/36772
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
` (2 preceding siblings ...)
2022-09-25 2:00 ` oreo639
@ 2022-09-25 2:00 ` oreo639
2022-09-25 2:02 ` oreo639
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2022-09-25 2:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/39402#issuecomment-1257099708
Comment:
Can you add `gmp-devel` to enable higher precision?
https://github.com/void-linux/void-packages/pull/36772
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
` (3 preceding siblings ...)
2022-09-25 2:00 ` oreo639
@ 2022-09-25 2:02 ` oreo639
2022-09-25 2:02 ` oreo639
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2022-09-25 2:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 267 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/39402#issuecomment-1257099708
Comment:
Can you add `gmp-devel` and `gmpxx-devel` to enable higher precision?
https://github.com/void-linux/void-packages/pull/36772
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
` (4 preceding siblings ...)
2022-09-25 2:02 ` oreo639
@ 2022-09-25 2:02 ` oreo639
2022-09-25 9:58 ` [PR PATCH] [Updated] " sgn
2022-09-26 14:20 ` [PR PATCH] [Merged]: " sgn
7 siblings, 0 replies; 9+ messages in thread
From: oreo639 @ 2022-09-25 2:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/39402#issuecomment-1257099708
Comment:
Can you add `gmp-devel` and `gmpxx-devel` to enable higher precision?
https://github.com/void-linux/void-packages/pull/36772
https://www.reddit.com/r/voidlinux/comments/u5j1nm/blender_compiled_without_gmp/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Updated] blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
` (5 preceding siblings ...)
2022-09-25 2:02 ` oreo639
@ 2022-09-25 9:58 ` sgn
2022-09-26 14:20 ` [PR PATCH] [Merged]: " sgn
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-09-25 9:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]
There is an updated pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages blender-more-opcodes
https://github.com/void-linux/void-packages/pull/39402
blender: blender: update to 3.3.0.
Also prepare for Python 3.11
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: *\*NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/39402.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-blender-more-opcodes-39402.patch --]
[-- Type: text/x-diff, Size: 10321 bytes --]
From b7f587bb0ab6c2fa78b188dc7fb446c8ae7d74a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Sat, 24 Sep 2022 13:37:54 +0700
Subject: [PATCH] blender: update to 3.3.0.
---
srcpkgs/blender/patches/0001-musl-fixes.patch | 65 +++++++++----------
.../patches/0002-fix-linking-issue.patch | 13 ++--
srcpkgs/blender/patches/altivec-all.patch | 6 +-
.../patches/no-Werror-double-promotion.patch | 19 +++---
srcpkgs/blender/template | 17 ++---
5 files changed, 59 insertions(+), 61 deletions(-)
diff --git a/srcpkgs/blender/patches/0001-musl-fixes.patch b/srcpkgs/blender/patches/0001-musl-fixes.patch
index 0e64369b4379..330c91397349 100644
--- a/srcpkgs/blender/patches/0001-musl-fixes.patch
+++ b/srcpkgs/blender/patches/0001-musl-fixes.patch
@@ -15,11 +15,11 @@ Original patch by Nathanael Copa
source/creator/creator_signals.c | 2 +-
5 files changed, 5 insertions(+), 6 deletions(-)
-diff --git a/intern/guardedalloc/intern/mallocn_intern.h b/intern/guardedalloc/intern/mallocn_intern.h
-index aa95615..f7e347d 100644
---- a/intern/guardedalloc/intern/mallocn_intern.h
-+++ b/intern/guardedalloc/intern/mallocn_intern.h
-@@ -33,7 +33,7 @@
+Index: blender-3.3.0/intern/guardedalloc/intern/mallocn_intern.h
+===================================================================
+--- blender-3.3.0.orig/intern/guardedalloc/intern/mallocn_intern.h
++++ blender-3.3.0/intern/guardedalloc/intern/mallocn_intern.h
+@@ -17,7 +17,7 @@
#undef HAVE_MALLOC_STATS
#define USE_MALLOC_USABLE_SIZE /* internal, when we have malloc_usable_size() */
@@ -28,29 +28,31 @@ index aa95615..f7e347d 100644
defined(__GLIBC__)
# include <malloc.h>
# 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
-@@ -25,7 +25,6 @@
+Index: blender-3.3.0/intern/libc_compat/libc_compat.c
+===================================================================
+--- blender-3.3.0.orig/intern/libc_compat/libc_compat.c
++++ blender-3.3.0/intern/libc_compat/libc_compat.c
+@@ -13,8 +13,6 @@
# include <features.h>
# include <math.h>
--# if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 31)
+-# if defined(__GLIBC_PREREQ)
+-# if __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)
+@@ -113,6 +111,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 8e3d489..4d0789b 100644
---- a/source/blender/blenlib/intern/system.c
-+++ b/source/blender/blenlib/intern/system.c
-@@ -35,7 +35,9 @@
+-# endif /* __GLIBC_PREREQ(2, 31) */
+-# endif /* __GLIBC_PREREQ */
+ #endif /* __linux__ */
+Index: blender-3.3.0/source/blender/blenlib/intern/system.c
+===================================================================
+--- blender-3.3.0.orig/source/blender/blenlib/intern/system.c
++++ blender-3.3.0/source/blender/blenlib/intern/system.c
+@@ -21,7 +21,9 @@
# include "BLI_winstuff.h"
#else
@@ -60,7 +62,7 @@ index 8e3d489..4d0789b 100644
# include <unistd.h>
#endif
-@@ -80,7 +82,7 @@ void BLI_system_backtrace(FILE *fp)
+@@ -63,7 +65,7 @@ void BLI_system_backtrace(FILE *fp)
{
/* ------------- */
/* Linux / Apple */
@@ -69,11 +71,11 @@ index 8e3d489..4d0789b 100644
# define SIZE 100
void *buffer[SIZE];
-diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h
-index eeaebd3..93a77a2 100644
---- a/source/blender/gpu/GPU_vertex_buffer.h
-+++ b/source/blender/gpu/GPU_vertex_buffer.h
-@@ -118,7 +118,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GPUVertBufRaw *a)
+Index: blender-3.3.0/source/blender/gpu/GPU_vertex_buffer.h
+===================================================================
+--- blender-3.3.0.orig/source/blender/gpu/GPU_vertex_buffer.h
++++ blender-3.3.0/source/blender/gpu/GPU_vertex_buffer.h
+@@ -133,7 +133,6 @@ GPU_INLINE void *GPU_vertbuf_raw_step(GP
{
unsigned char *data = a->data;
a->data += a->stride;
@@ -81,11 +83,11 @@ index eeaebd3..93a77a2 100644
return (void *)data;
}
-diff --git a/source/creator/creator_signals.c b/source/creator/creator_signals.c
-index 29e12a9..d90da8f 100644
---- a/source/creator/creator_signals.c
-+++ b/source/creator/creator_signals.c
-@@ -269,7 +269,7 @@ void main_signal_setup_fpe(void)
+Index: blender-3.3.0/source/creator/creator_signals.c
+===================================================================
+--- blender-3.3.0.orig/source/creator/creator_signals.c
++++ blender-3.3.0/source/creator/creator_signals.c
+@@ -258,7 +258,7 @@ void main_signal_setup_fpe(void)
* set breakpoints on sig_handle_fpe */
signal(SIGFPE, sig_handle_fpe);
@@ -94,6 +96,3 @@ index 29e12a9..d90da8f 100644
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
# endif /* defined(__linux__) && defined(__GNUC__) */
# if defined(OSX_SSE_FPE)
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/0002-fix-linking-issue.patch b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
index 28683714e126..139bc7fd1dbd 100644
--- a/srcpkgs/blender/patches/0002-fix-linking-issue.patch
+++ b/srcpkgs/blender/patches/0002-fix-linking-issue.patch
@@ -9,17 +9,14 @@ Subject: [PATCH 2/3] fix linking issue
intern/ghost/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
-index 1739659..d6b442b 100644
---- a/intern/ghost/CMakeLists.txt
-+++ b/intern/ghost/CMakeLists.txt
-@@ -484,5 +484,5 @@ if(WITH_XR_OPENXR)
+Index: blender-3.3.0/intern/ghost/CMakeLists.txt
+===================================================================
+--- blender-3.3.0.orig/intern/ghost/CMakeLists.txt
++++ blender-3.3.0/intern/ghost/CMakeLists.txt
+@@ -562,5 +562,5 @@ if(WITH_XR_OPENXR)
endif()
add_definitions(${GL_DEFINITIONS})
-
+list(APPEND LIB "-lX11" "-lXi" "-lXxf86vm" "-lXfixes" "-lXrender")
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
---
-2.30.1
-
diff --git a/srcpkgs/blender/patches/altivec-all.patch b/srcpkgs/blender/patches/altivec-all.patch
index 115e1ea6fd03..a504207d2bcc 100644
--- a/srcpkgs/blender/patches/altivec-all.patch
+++ b/srcpkgs/blender/patches/altivec-all.patch
@@ -1,8 +1,10 @@
This applies a better workaround for C++ type conflicts
in AltiVec/C++, allowing it to build on BE ppc(64).
---- a/extern/clew/include/clew.h
-+++ b/extern/clew/include/clew.h
+Index: blender-3.3.0/extern/clew/include/clew.h
+===================================================================
+--- blender-3.3.0.orig/extern/clew/include/clew.h
++++ blender-3.3.0/extern/clew/include/clew.h
@@ -370,15 +370,18 @@ typedef unsigned int cl_GLenum;
/* Define basic vector types */
diff --git a/srcpkgs/blender/patches/no-Werror-double-promotion.patch b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
index 2d17a6da1818..0710abe513fe 100644
--- a/srcpkgs/blender/patches/no-Werror-double-promotion.patch
+++ b/srcpkgs/blender/patches/no-Werror-double-promotion.patch
@@ -1,11 +1,14 @@
---- ./intern/cycles/CMakeLists.txt.orig 2021-04-16 20:47:50.466754473 +0200
-+++ ./intern/cycles/CMakeLists.txt 2021-04-16 20:48:06.199903232 +0200
-@@ -336,7 +336,7 @@ endif()
- # Warnings
- if(CMAKE_COMPILER_IS_GNUCXX)
+Index: blender-3.3.0/intern/cycles/kernel/CMakeLists.txt
+===================================================================
+--- blender-3.3.0.orig/intern/cycles/kernel/CMakeLists.txt
++++ blender-3.3.0/intern/cycles/kernel/CMakeLists.txt
+@@ -947,9 +947,7 @@ endif()
+ # Warnings to avoid using doubles in the kernel.
+ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
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_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)
+- unset(_has_cxxflag_double_promotion)
+ endif()
+
+ cycles_add_library(cycles_kernel "${LIB}"
diff --git a/srcpkgs/blender/template b/srcpkgs/blender/template
index 28befed1faf8..2a59b9c32599 100644
--- a/srcpkgs/blender/template
+++ b/srcpkgs/blender/template
@@ -1,7 +1,7 @@
# Template file for 'blender'
pkgname=blender
-version=3.0.0
-revision=5
+version=3.3.0
+revision=1
archs="x86_64* ppc64*"
build_style="cmake"
pycompile_dirs="/usr/share/blender/${version%.*}/scripts"
@@ -19,26 +19,23 @@ makedepends="libgomp-devel libpng-devel tiff-devel python3-devel glu-devel
libopenexr-devel libopenjpeg2-devel libXi-devel openimageio-devel
opencolorio-devel opencollada-devel python3-numpy libXrender-devel
OpenSubdiv-devel tbb-devel libxml2-devel openvdb-devel alembic-devel
- pugixml-devel libXxf86vm-devel"
+ pugixml-devel libXxf86vm-devel gmp-devel gmpxx-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="3D graphics creation suite"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://www.blender.org"
distfiles="https://download.blender.org/source/blender-${version}.tar.xz"
-checksum=50f0f32bcdf8825a12ba5c8d853b6e6c6b2da65ef01e858ea5900a06cccbf1cb
+checksum=22c51a4e66385cb14818aa4d76dcf7fa6d6e103afb0d36916e12ea15988d21f0
python_version=3
-CXXFLAGS="-DNDEBUG"
-CFLAGS="$CXXFLAGS"
LDFLAGS="-Wl,-z,stack-size=2097152"
# Blender tests are executed against a system installation of blender. This
# is currently not supported by xbps-src.
make_check=no
-case "$XBPS_TARGET_MACHINE" in
- *-musl) ;;
- *) makedepends+=" jemalloc-devel" ;;
-esac
+if [ "$XBPS_TARGET_LIBC" != musl ]; then
+ makedepends+=" jemalloc-devel"
+fi
case "$XBPS_TARGET_MACHINE" in
x86_64*)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Merged]: blender: blender: update to 3.3.0.
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
` (6 preceding siblings ...)
2022-09-25 9:58 ` [PR PATCH] [Updated] " sgn
@ 2022-09-26 14:20 ` sgn
7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-09-26 14:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]
There's a merged pull request on the void-packages repository
blender: blender: update to 3.3.0.
https://github.com/void-linux/void-packages/pull/39402
Description:
Also prepare for Python 3.11
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: *\*NO**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-09-26 14:20 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 17:00 [PR PATCH] blender: backport more Python's opcodes whitelist (better to update to 3.3, but this is not) sgn
2022-09-24 7:00 ` [PR PATCH] [Updated] " sgn
2022-09-25 2:00 ` blender: blender: update to 3.3.0 oreo639
2022-09-25 2:00 ` oreo639
2022-09-25 2:00 ` oreo639
2022-09-25 2:02 ` oreo639
2022-09-25 2:02 ` oreo639
2022-09-25 9:58 ` [PR PATCH] [Updated] " sgn
2022-09-26 14:20 ` [PR PATCH] [Merged]: " sgn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).