Skip to content

Commit

Permalink
blender: shift to lts version (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
termux-pacman-bot committed May 10, 2024
1 parent 049d0be commit 5c6b7df
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 75 deletions.
34 changes: 34 additions & 0 deletions tur-on-device/blender/blender_android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff '--color=auto' -uNr blender/intern/cycles/kernel/CMakeLists.txt blender.mod/intern/cycles/kernel/CMakeLists.txt
--- blender/intern/cycles/kernel/CMakeLists.txt 2024-04-15 12:57:33.000000000 +0530
+++ blender.mod/intern/cycles/kernel/CMakeLists.txt 2024-05-08 22:48:33.069855396 +0530
@@ -1144,12 +1144,12 @@
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")
- unset(_has_cxxflag_float_conversion)
- unset(_has_cxxflag_double_promotion)
-endif()
+# 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")
+# unset(_has_cxxflag_float_conversion)
+# unset(_has_cxxflag_double_promotion)
+# endif()

cycles_add_library(cycles_kernel "${LIB}"
${SRC_KERNEL_DEVICE_CPU}
diff '--color=auto' -uNr blender/source/blender/blenlib/intern/uuid.cc blender.mod/source/blender/blenlib/intern/uuid.cc
--- blender/source/blender/blenlib/intern/uuid.cc 2024-04-15 12:57:33.000000000 +0530
+++ blender.mod/source/blender/blenlib/intern/uuid.cc 2024-05-08 22:47:26.255901812 +0530
@@ -29,7 +29,7 @@
static_assert(std::mt19937_64::max() == 0xffffffffffffffffLL);

struct timespec ts;
-#ifdef __APPLE__
+#ifdef __ANDROID__
/* `timespec_get()` is only available on macOS 10.15+, so until that's the minimum version
* supported by Blender, use another function to get the timespec.
*
48 changes: 15 additions & 33 deletions tur-on-device/blender/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@ TERMUX_PKG_HOMEPAGE=https://www.blender.org
TERMUX_PKG_DESCRIPTION="A fully integrated 3D graphics creation suite"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@T-Dynamos"
BLENDER_MAJOR_VERSION=4
BLENDER_MINOR_VERSION=0
BLENDER_ADDONS_COMMIT=92dd274c0bf08ad4786e7dfe715dee327f3ee43f
_COMMIT=63e9cead5ff002921eb4921037971e24d1c61abc
_COMMIT_DATE=2023.12.18
TERMUX_PKG_REVISION=1
TERMUX_PKG_VERSION=${BLENDER_MAJOR_VERSION}.${BLENDER_MINOR_VERSION}-${_COMMIT:0:8}-${_COMMIT_DATE}
TERMUX_PKG_SRCURL=git+https://github.com/blender/blender
TERMUX_PKG_GIT_BRANCH=blender-v4.0-release
TERMUX_PKG_VERSION=1:3.6.11
TERMUX_PKG_SRCURL=git+https://github.com/blender/blender.git
TERMUX_PKG_GIT_BRANCH=blender-v3.6-release

# Blender does not support 32bit
TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686"

TERMUX_PKG_DEPENDS="libpng, libtiff, python, python-pip, python-numpy, openexr, desktop-file-utils, potrace, shared-mime-info, hicolor-icon-theme, glew, openjpeg, freetype, ffmpeg, fftw, alembic, libsndfile, ptex, sdl2, libspnav, openal-soft, opencolorio, libblosc, sse2neon, libandroid-execinfo, brotli, libepoxy, openimageio, pybind11, openvdb, libraw, libpugixml, shaderc"
TERMUX_PKG_BUILD_DEPENDS="subversion"
TERMUX_PKG_REVISION=1
TERMUX_PKG_PYTHON_COMMON_DEPS="requests, zstandard, Cython"
TERMUX_PKG_BUILD_DEPENDS="subversion, git-lfs"
TERMUX_PKG_PYTHON_COMMON_DEPS="Cython"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DPYTHON_LIBRARY=$TERMUX_PREFIX/lib/python$TERMUX_PYTHON_VERSION
-DPYTHON_INCLUDE_DIR=$TERMUX_PREFIX/include/python$TERMUX_PYTHON_VERSION
Expand All @@ -30,26 +23,13 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DWITH_INSTALL_PORTABLE=OFF
-DWITH_PYTHON_INSTALL=OFF
-DWITH_GHOST_WAYLAND=OFF
-DHAVE_MALLOC_STATS_H=OFF
"

TERMUX_PKG_RM_AFTER_INSTALL="
lib/python$TERMUX_PYTHON_VERSION/__pycache__/*
lib/python$TERMUX_PYTHON_VERSION/site-packages/pip/_vendor/distro/__pycache__/*
bin/c*
bin/normalizer
lib/python$TERMUX_PYTHON_VERSION/
"

termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT
local version="$(git log -1 --format=%cs | sed 's/-/./g')"
if [ "$version" != "$_COMMIT_DATE" ]; then
echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\""
echo " is different from what is expected to be: \"$version\""
return 1
fi
}

termux_step_pre_configure(){
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
termux_error_exit "This package doesn't support cross-compiling."
Expand All @@ -60,11 +40,13 @@ termux_step_pre_configure(){
LDFLAGS+=" -Wl,--undefined-version"
# Position independent executables are not supported on android
sed -i "s/no-pie/pie/g" $TERMUX_PKG_SRCDIR/build_files/cmake/platform/platform_unix.cmake
}

termux_step_post_make_install() {
export MODIR=$TERMUX_PREFIX/share/blender/$BLENDER_MAJOR_VERSION.$BLENDER_MINOR_VERSION/scripts/modules
curl -L https://github.com/blender/blender-addons/archive/$BLENDER_ADDONS_COMMIT.tar.gz | tar xvz -C $MODIR/
cp -r $MODIR/blender-addons-$BLENDER_ADDONS_COMMIT/* $MODIR/
rm -rf $MODIR/blender-addons-$BLENDER_ADDONS_COMMIT
# Fetch addons
local _ARCH
if [ "$TERMUX_ARCH" = "aarch64" ]; then
_ARCH="arm64"
else
_ARCH=$TERMUX_ARCH
fi
python3 ./build_files/utils/make_update.py --architecture $_ARCH
}
11 changes: 0 additions & 11 deletions tur-on-device/blender/disable-malloc_stats.patch

This file was deleted.

11 changes: 0 additions & 11 deletions tur-on-device/blender/fix-timespec_get.patch

This file was deleted.

This file was deleted.

0 comments on commit 5c6b7df

Please sign in to comment.