aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorbartus2023-07-17 17:15:03 +0200
committerbartus2023-07-17 17:43:46 +0200
commit093e7a40382b619f6ddb3e5501662963fcd0e189 (patch)
treeb7cf51477d775785c37b603a5565eb23b89ad5f1
parentd02edb066910a161206e18840c9ea2571478fce4 (diff)
downloadaur-093e7a40382b619f6ddb3e5501662963fcd0e189.tar.gz
Enable draco, workaround blender.1.py libpath
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD19
-rw-r--r--force-draco1.patch16
-rw-r--r--force-draco2.patch21
4 files changed, 57 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 24ce51fe12f7..b9e28ae1c1b6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -58,6 +58,8 @@ pkgbase = blender-develop-git
source = usd_python.patch
source = embree.patch
source = blender-sycl-path.patch
+ source = force-draco1.patch
+ source = force-draco2.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
@@ -67,5 +69,7 @@ pkgbase = blender-develop-git
sha256sums = 333b6fd864d55da2077bc85c55af1a27d4aee9764a1a839df26873a9f19b8703
sha256sums = d587135fd9b815d60e8b7f48976aa835472922fc8f64c256dc397bfcd3c2642a
sha256sums = 05e83a1c06790594fcd96f86bac7912d67c91ce9076cfc7088203b37f65949b1
+ sha256sums = e3ff41269ab26f34e7762ee2754d238af375761131178917f61a97763f60ee0d
+ sha256sums = a7c809d2b979e097a1853d42ad0edb6d9fa2ef51c99424257e5ec083ef76bb03
pkgname = blender-develop-git
diff --git a/PKGBUILD b/PKGBUILD
index 5b4e8eca1852..3c9f8563dcb6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -59,6 +59,8 @@ source=("blender::git+https://github.com/blender/blender${_fragment}"
usd_python.patch #add missing python headers when building against python enabled usd.
embree.patch #add missing embree link.
blender-sycl-path.patch
+ force-draco1.patch
+ force-draco2.patch
)
sha256sums=('SKIP'
'SKIP'
@@ -68,7 +70,9 @@ sha256sums=('SKIP'
'87c5ee85032bab83510db426ab28f7acfba893aefea2b523f2fd78f3b62c5348'
'333b6fd864d55da2077bc85c55af1a27d4aee9764a1a839df26873a9f19b8703'
'd587135fd9b815d60e8b7f48976aa835472922fc8f64c256dc397bfcd3c2642a'
- '05e83a1c06790594fcd96f86bac7912d67c91ce9076cfc7088203b37f65949b1')
+ '05e83a1c06790594fcd96f86bac7912d67c91ce9076cfc7088203b37f65949b1'
+ 'e3ff41269ab26f34e7762ee2754d238af375761131178917f61a97763f60ee0d'
+ 'a7c809d2b979e097a1853d42ad0edb6d9fa2ef51c99424257e5ec083ef76bb03')
pkgver() {
blender_version=$(grep -Po "BLENDER_VERSION \K[0-9]{3}" "$srcdir"/blender/source/blender/blenkernel/BKE_blender_version.h)
@@ -87,6 +91,8 @@ prepare() {
fi
((DISABLE_USD)) || git -C "$srcdir/blender" apply -v "${srcdir}"/usd_python.patch
git -C "$srcdir/blender" apply -v "${srcdir}"/embree.patch
+ ((DISABLE_DRACO)) || git -C "$srcdir/blender" apply -v "${srcdir}"/force-draco1.patch
+ ((DISABLE_DRACO)) || git -C "$srcdir/blender/scripts/addons" apply -v "${srcdir}"/force-draco2.patch
}
build() {
@@ -127,7 +133,14 @@ build() {
package() {
_suffix=${pkgver%%.r*}
_pyver=$(python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))')
- BLENDER_SYSTEM_PYTHON=/usr/lib/python${_pyver} BLENDER_SYSTEM_RESOURCES="${pkgdir}/usr/share/blender/${_suffix}" DESTDIR="${pkgdir}" cmake --install build
+ BLENDER_SYSTEM_PYTHON=/usr/lib/python${_pyver} BLENDER_SYSTEM_RESOURCES="${pkgdir}/usr/share/blender/${_suffix}" DESTDIR="${pkgdir}" cmake --install build || ((DISABLE_DRACO)) && true
+
+ # Manually install draco bindings (See FS#73415)
+ ((DISABLE_DRACO)) || {
+ mkdir -p "${pkgdir}/usr/lib/python${_pyver}"/
+ mv "${pkgdir}"/usr/share/blender/4*/python/lib/* "${pkgdir}"/usr/lib/
+ rm -r "${pkgdir}"/usr/share/blender/4*/python
+ }
# Move OneAPI AOT lib to proper place
# mv "${pkgdir}"/usr/share/blender/lib/libcycles_kernel_oneapi_aot.so "${pkgdir}"/usr/lib/
@@ -145,7 +158,7 @@ package() {
mv "${pkgdir}/usr/share/doc/blender" "${pkgdir}/usr/share/doc/blender-${_suffix}"
msg "add -${_suffix} suffix to man page"
- mv "${pkgdir}/usr/share/man/man1/blender.1" "${pkgdir}/usr/share/man/man1/blender-${_suffix}.1"
+ ((DISABLE_DRACO)) && mv "${pkgdir}/usr/share/man/man1/blender.1" "${pkgdir}/usr/share/man/man1/blender-${_suffix}.1"
msg "add -${_suffix} suffix to all icons"
while read -r icon
diff --git a/force-draco1.patch b/force-draco1.patch
new file mode 100644
index 000000000000..dbf8b24119cd
--- /dev/null
+++ b/force-draco1.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 113ec61655a..ef246dd7c34 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -898,11 +898,6 @@ set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF)
+ set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF)
+ set_and_warn_dependency(WITH_PYTHON WITH_MOD_FLUID OFF)
+
+-if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
+- message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now")
+- set(WITH_DRACO OFF)
+-endif()
+-
+ # enable boost for cycles, audaspace or i18n
+ # otherwise if the user disabled
+
diff --git a/force-draco2.patch b/force-draco2.patch
new file mode 100644
index 000000000000..7aacc6473886
--- /dev/null
+++ b/force-draco2.patch
@@ -0,0 +1,21 @@
+diff --git a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
+index 58f81125..25e3897b 100644
+--- a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
++++ b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
+@@ -3,6 +3,7 @@
+ # SPDX-License-Identifier: Apache-2.0
+
+ import os
++import site
+ import sys
+ from pathlib import Path
+ import bpy
+@@ -20,7 +21,7 @@ def dll_path() -> Path:
+ python_lib = Path('{v[0]}.{v[1]}/python/lib'.format(v=bpy.app.version))
+ python_version = 'python{v[0]}.{v[1]}'.format(v=sys.version_info)
+
+- path = os.environ.get('BLENDER_EXTERN_DRACO_LIBRARY_PATH')
++ path = f"{site.getsitepackages()[0]}/libextern_draco.so"
+ if path is None:
+ path = {
+ 'win32': blender_root / python_lib / 'site-packages',