Merge remote-tracking branch 'origin/master' into 8-rbs-framework-env
This commit is contained in:
commit
02f8f51f97
18 changed files with 784 additions and 2048 deletions
|
@ -0,0 +1,10 @@
|
|||
--- a/intern/locale/boost_locale_wrapper.cpp
|
||||
+++ b/intern/locale/boost_locale_wrapper.cpp
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <boost/locale.hpp>
|
||||
#include <stdio.h>
|
||||
+#include <iostream>
|
||||
|
||||
#include "boost_locale_wrapper.h"
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
--- a/release/freedesktop/blender.desktop
|
||||
+++ b/release/freedesktop/blender.desktop
|
||||
@@ -84,6 +84,6 @@ Icon=blender
|
||||
Terminal=false
|
||||
Type=Application
|
||||
PrefersNonDefaultGPU=true
|
||||
-X-KDE-RunOnDiscreteGpu=true
|
||||
+X-PreferRunOnDiscreteGPU=true
|
||||
Categories=Graphics;3DGraphics;
|
||||
MimeType=application/x-blender;
|
84
pkgs/development/python-modules/bpy/cg-defaults.patch
Normal file
84
pkgs/development/python-modules/bpy/cg-defaults.patch
Normal file
|
@ -0,0 +1,84 @@
|
|||
diff -Naur a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h
|
||||
--- a/source/blender/makesdna/DNA_modifier_defaults.h 2020-12-24 20:07:32.000000000 +0300
|
||||
+++ b/source/blender/makesdna/DNA_modifier_defaults.h 2020-12-28 00:11:53.397550988 +0300
|
||||
@@ -43,7 +43,7 @@
|
||||
.length = 0.0f, \
|
||||
.merge_dist = 0.01f, \
|
||||
.fit_type = MOD_ARR_FIXEDCOUNT, \
|
||||
- .offset_type = MOD_ARR_OFF_RELATIVE, \
|
||||
+ .offset_type = MOD_ARR_OFF_CONST, \
|
||||
.flags = 0, \
|
||||
.count = 2, \
|
||||
.uv_offset = {0.0f, 0.0f}, \
|
||||
@@ -51,8 +51,8 @@
|
||||
|
||||
#define _DNA_DEFAULT_BevelModifierData \
|
||||
{ \
|
||||
- .value = 0.1f, \
|
||||
- .res = 1, \
|
||||
+ .value = 0.01f, \
|
||||
+ .res = 2, \
|
||||
.flags = 0, \
|
||||
.val_flags = MOD_BEVEL_AMT_OFFSET, \
|
||||
.profile_type = MOD_BEVEL_PROFILE_SUPERELLIPSE, \
|
||||
@@ -93,7 +93,7 @@
|
||||
#define _DNA_DEFAULT_CastModifierData \
|
||||
{ \
|
||||
.object = NULL, \
|
||||
- .fac = 0.5f, \
|
||||
+ .fac = 1.0f, \
|
||||
.radius = 0.0f, \
|
||||
.size = 0.0f, \
|
||||
.defgrp_name = "", \
|
||||
@@ -259,7 +259,7 @@
|
||||
|
||||
#define _DNA_DEFAULT_DecimateModifierData \
|
||||
{ \
|
||||
- .percent = 1.0f, \
|
||||
+ .percent = 0.1f, \
|
||||
.iter = 0, \
|
||||
.delimit = 0, \
|
||||
.symmetry_axis = 0, \
|
||||
@@ -567,7 +567,7 @@
|
||||
.vgroup_name = "", \
|
||||
.factor = DEG2RADF(45.0f), \
|
||||
.limit = {0.0f, 1.0f}, \
|
||||
- .mode = MOD_SIMPLEDEFORM_MODE_TWIST, \
|
||||
+ .mode = MOD_SIMPLEDEFORM_MODE_BEND, \
|
||||
.axis = 0, \
|
||||
.deform_axis = 0, \
|
||||
.flag = 0, \
|
||||
@@ -608,7 +608,7 @@
|
||||
.crease_inner = 0.0f, \
|
||||
.crease_outer = 0.0f, \
|
||||
.crease_rim = 0.0f, \
|
||||
- .flag = MOD_SOLIDIFY_RIM, \
|
||||
+ .flag = MOD_SOLIDIFY_RIM | MOD_SOLIDIFY_EVEN, \
|
||||
.mat_ofs = 0, \
|
||||
.mat_ofs_rim = 0, \
|
||||
.merge_tolerance = 0.0001f, \
|
||||
@@ -619,7 +619,7 @@
|
||||
.subdivType = 0, \
|
||||
.levels = 1, \
|
||||
.renderLevels = 2, \
|
||||
- .flags = eSubsurfModifierFlag_UseCrease | eSubsurfModifierFlag_ControlEdges, \
|
||||
+ .flags = eSubsurfModifierFlag_UseCrease | eSubsurfModifierFlag_ControlEdges | eSubsurfModifierFlag_UseRecursiveSubdivision, \
|
||||
.uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES, \
|
||||
.quality = 3, \
|
||||
.boundary_smooth = SUBSURF_BOUNDARY_SMOOTH_ALL, \
|
||||
diff -Naur a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h
|
||||
--- a/source/blender/makesdna/DNA_view3d_defaults.h 2020-12-24 20:07:32.000000000 +0300
|
||||
+++ b/source/blender/makesdna/DNA_view3d_defaults.h 2020-12-27 22:52:32.467466785 +0300
|
||||
@@ -94,9 +94,9 @@
|
||||
.flag = V3D_SELECT_OUTLINE, \
|
||||
.flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \
|
||||
\
|
||||
- .lens = 50.0f, \
|
||||
- .clip_start = 0.01f, \
|
||||
- .clip_end = 1000.0f, \
|
||||
+ .lens = 85.0f, \
|
||||
+ .clip_start = 0.001f, \
|
||||
+ .clip_end = 100.0f, \
|
||||
\
|
||||
.bundle_size = 0.2f, \
|
||||
.bundle_drawtype = OB_PLAINAXES, \
|
45
pkgs/development/python-modules/bpy/cg_environment.patch
Normal file
45
pkgs/development/python-modules/bpy/cg_environment.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
--- /dev/null 2023-08-11 22:07:27.012000310 +0300
|
||||
+++ b/scripts/startup/cg_environment.py 2023-08-11 00:44:51.704718595 +0300
|
||||
@@ -0,0 +1,42 @@
|
||||
+#!/usr/bin/python3
|
||||
+# -*- coding: utf-8 -*-
|
||||
+# Copyright (C) 2023 Ilia Kurochkin <brothermechanic@gmail.com>
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+
|
||||
+__doc__ = 'Environment for use CG Overlay'
|
||||
+__version__ = '0.1'
|
||||
+
|
||||
+import bpy
|
||||
+from bpy.app.handlers import persistent
|
||||
+import addon_utils
|
||||
+
|
||||
+
|
||||
+@persistent
|
||||
+def cg_env(dummy):
|
||||
+ '''Scripts environment'''
|
||||
+ addon_utils.enable('cg_preferences', default_set=True)
|
||||
+
|
||||
+ print('CG Environment activated!')
|
||||
+
|
||||
+
|
||||
+def register():
|
||||
+ '''register blender module'''
|
||||
+ bpy.app.handlers.load_post.append(cg_env)
|
||||
+
|
||||
+
|
||||
+def unregister():
|
||||
+ '''unregister blender module'''
|
||||
+ bpy.app.handlers.load_post.remove(cg_env)
|
||||
+
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ register()
|
|
@ -1,30 +1,213 @@
|
|||
{ buildPythonPackage, fetchPypi, python3Packages, lib, autoPatchelfHook, blender, config, cudaSupport ? config.cudaSupport }:
|
||||
buildPythonPackage rec {
|
||||
format = "wheel";
|
||||
pname = "bpy";
|
||||
version = "3.6.0";
|
||||
# TODO WITH_CYCLES_OSL
|
||||
# TODO WITH_NANOVDB
|
||||
# TODO WITH_CLANG
|
||||
{ config, stdenv, lib, fetchurl, fetchzip, fetchgit, makeWrapper, cmake, git-lfs
|
||||
, boost, ocl-icd, gettext, zlib, zstd, pugixml, llvmPackages, clang
|
||||
, libepoxy, libXi, libX11, libXext, libXrender, libXxf86vm
|
||||
, libGLU, libGL, glew, addOpenGLRunpath, freeglut
|
||||
, openimageio, opencolorio, openexr, ilmbase, libjpeg, libpng, libtiff, libwebp, potrace
|
||||
, embree, gmp, openvdb, tbb, openimagedenoise, opensubdiv, freetype, libharu, brotli
|
||||
, ffmpeg, fftw, libsndfile
|
||||
, python310Packages, buildPythonPackage, fetchPypi, pkgs, lzma, freecad
|
||||
, cudaSupport ? config.cudaSupport or false, cudaPackages ? { }
|
||||
, hipSupport ? false, hip # comes with a significantly larger closure size
|
||||
, colladaSupport ? true, opencollada
|
||||
, waylandSupport ? stdenv.isLinux, pkg-config, wayland, wayland-protocols, libffi, libdecor, libxkbcommon, dbus
|
||||
}:
|
||||
|
||||
src = fetchPypi rec {
|
||||
inherit pname version format;
|
||||
sha256 = "sha256-7eLJWs54SPT1oHWn2Mw6nmQ8M19FlsPBUIfZPHrl9Wo=";
|
||||
dist = python;
|
||||
python = "cp310";
|
||||
abi = "cp310";
|
||||
platform = "manylinux_2_28_x86_64";
|
||||
let
|
||||
python = python310Packages.python;
|
||||
optix = fetchzip {
|
||||
# url taken from the archlinux blender PKGBUILD
|
||||
url = "https://developer.download.nvidia.com/redist/optix/v7.4/OptiX-7.4.0-Include.zip";
|
||||
sha256 = "sha256-ca08XetwaUYC9foeP5bff9kcDfuFgEzopvjspn2s8RY=";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ requests numpy cython zstandard ];
|
||||
buildInputs = blender.buildInputs;
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
cg_preferences = fetchgit {
|
||||
url = "https://gitlab.com/brothermechanic/cg_preferences.git";
|
||||
rev = "db192525ff41dfae4c063dc914a2c3fe5850d480";
|
||||
sha256 = "sha256-+eLWdokH/5odzOTykgrmG36U8h+Wf8YGOxe1oIy4dJo=";
|
||||
fetchLFS = true;
|
||||
};
|
||||
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bpy";
|
||||
version = "3.6.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.blender.org/source/blender-${version}.tar.xz";
|
||||
hash = "sha256-JJF+cbyya0kAJXBU2do4tiMWx0J9cyNTO0HKmztFrE0=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./cg-defaults.patch
|
||||
./x112.patch
|
||||
./blender-fix-desktop.patch
|
||||
./blender-fix-boost-1.81-iostream.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs =
|
||||
[ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev
|
||||
]
|
||||
++ lib.optionals cudaSupport [ addOpenGLRunpath ]
|
||||
++ lib.optionals waylandSupport [ pkg-config ];
|
||||
buildInputs =
|
||||
[ boost ffmpeg gettext glew ilmbase
|
||||
freetype libjpeg libpng libsndfile libtiff libwebp
|
||||
opencolorio openexr openimageio python zlib pkgs.zstd.dev fftw
|
||||
(opensubdiv.override { inherit cudaSupport; })
|
||||
tbb
|
||||
gmp
|
||||
pugixml
|
||||
potrace
|
||||
libharu
|
||||
brotli
|
||||
libepoxy
|
||||
lzma
|
||||
optix
|
||||
]
|
||||
++ lib.optionals waylandSupport [
|
||||
wayland wayland-protocols libffi libdecor libxkbcommon dbus
|
||||
]
|
||||
++ lib.optionals (!stdenv.isAarch64) [
|
||||
openimagedenoise
|
||||
embree
|
||||
]
|
||||
++ (if (!stdenv.isDarwin) then [
|
||||
libXi libX11 libXext libXrender
|
||||
libGLU libGL
|
||||
libXxf86vm
|
||||
# OpenVDB currently doesn't build on darwin
|
||||
openvdb
|
||||
]
|
||||
else [
|
||||
llvmPackages.openmp clang
|
||||
])
|
||||
++ lib.optional cudaSupport cudaPackages.cudatoolkit
|
||||
++ lib.optional colladaSupport opencollada
|
||||
;
|
||||
pythonPath = with python310Packages; [ numpy requests ];
|
||||
|
||||
postPatch = ''
|
||||
cp ${cg_preferences}/startup.blend release/datafiles/
|
||||
'' +
|
||||
(if stdenv.isDarwin then ''
|
||||
: > build_files/cmake/platform/platform_apple_xcode.cmake
|
||||
substituteInPlace source/creator/CMakeLists.txt \
|
||||
--replace '${"$"}{LIBDIR}/python' \
|
||||
'${python}'
|
||||
substituteInPlace build_files/cmake/platform/platform_apple.cmake \
|
||||
--replace '${"$"}{LIBDIR}/python' \
|
||||
'${python}' \
|
||||
--replace '${"$"}{LIBDIR}/opencollada' \
|
||||
'${opencollada}' \
|
||||
--replace '${"$"}{PYTHON_LIBPATH}/site-packages/numpy' \
|
||||
'${python310Packages.numpy}/${python.sitePackages}/numpy'
|
||||
'' else ''
|
||||
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
|
||||
'') +
|
||||
(lib.optionalString hipSupport ''
|
||||
substituteInPlace extern/hipew/src/hipew.c --replace '"/opt/rocm/hip/lib/libamdhip64.so"' '"${hip}/lib/libamdhip64.so"'
|
||||
substituteInPlace extern/hipew/src/hipew.c --replace '"opt/rocm/hip/bin"' '"${hip}/bin"'
|
||||
'');
|
||||
|
||||
cmakeFlags =
|
||||
[
|
||||
"-DWITH_PYTHON_INSTALL=OFF"
|
||||
"-DWITH_AUDASPACE=OFF"
|
||||
"-DWITH_PYTHON_MODULE=ON"
|
||||
"-DWITH_MEM_JEMALLOC=OFF"
|
||||
"-DWITH_INSTALL_PORTABLE=ON"
|
||||
#___________
|
||||
"-DPYTHON_LIBPATH=${python}/lib"
|
||||
"-DPYTHON_VERSION=${python.pythonVersion}"
|
||||
"-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
|
||||
"-DPYTHON_LIBRARY=${python.libPrefix}"
|
||||
"-DWITH_PYTHON_INSTALL_NUMPY=OFF"
|
||||
"-DPYTHON_NUMPY_PATH=${python310Packages.numpy}/${python.sitePackages}"
|
||||
"-DPYTHON_NUMPY_INCLUDE_DIRS=${python310Packages.numpy}/${python.sitePackages}/numpy/core/include"
|
||||
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
|
||||
"-DWITH_ALEMBIC=OFF"
|
||||
"-DWITH_OPENVDB=ON"
|
||||
"-DWITH_NANOVDB=ON"
|
||||
"-DWITH_IMAGE_OPENJPEG=OFF"
|
||||
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
|
||||
"-DWITH_OPENAL=OFF"
|
||||
"-DWITH_SDL=OFF"
|
||||
"-DWITH_PULSEAUDIO=OFF"
|
||||
"-DWITH_JACK=OFF"
|
||||
"-DWITH_OPENMP=ON"
|
||||
"-DWITH_OPENCOLORIO=ON"
|
||||
"-DWITH_OPENSUBDIV=ON"
|
||||
"-DWITH_TBB=ON"
|
||||
"-DWITH_USD=OFF"
|
||||
"-DWITH_XR_OPENXR=OFF"
|
||||
"-DWITH_NINJA_POOL_JOBS=OFF"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
"-DWITH_BUILDINFO=OFF"
|
||||
"-DWITH_HYDRA=OFF"
|
||||
"-DWITH_MATERIALX=OFF"
|
||||
"-DWITH_LINKER_LLD=ON"
|
||||
"-DWITH_LIBS_PRECOMPILED=OFF"
|
||||
"-DWITH_INTERNATIONAL=ON"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isAarch64 [
|
||||
"-DWITH_CYCLES_EMBREE=OFF"
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
"-DWITH_CYCLES_OSL=OFF" # requires LLVM
|
||||
"-DWITH_OPENVDB=OFF" # OpenVDB currently doesn't build on darwin
|
||||
"-DLIBDIR=/does-not-exist"
|
||||
]
|
||||
++ lib.optionals cudaSupport [
|
||||
"-DWITH_CYCLES_CUDA_BINARIES=ON"
|
||||
"-DCUDA_NVCC_FLAGS=-std=c++14"
|
||||
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
|
||||
"-DOPTIX_INCLUDE_DIR=${optix}"
|
||||
]
|
||||
# Clang doesn't support "-export-dynamic"
|
||||
++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
|
||||
++ lib.optionals waylandSupport [
|
||||
"-DWITH_GHOST_WAYLAND=ON"
|
||||
"-DWITH_GHOST_WAYLAND_DBUS=ON"
|
||||
"-DWITH_GHOST_WAYLAND_DYNLOAD=OFF"
|
||||
"-DWITH_GHOST_WAYLAND_LIBDECOR=ON"
|
||||
];
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
|
||||
|
||||
# Since some dependencies are built with gcc 6, we need gcc 6's
|
||||
# libstdc++ in our RPATH. Sigh.
|
||||
NIX_LDFLAGS = lib.optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib/python3.10/site-packages
|
||||
mkdir -p $out/nix-support
|
||||
mv $out/bpy $out/lib/python3.10/site-packages/
|
||||
echo ${python} >> $out/nix-support/propagated-build-inputs
|
||||
'' + ''
|
||||
mkdir $out/lib/python3.10/site-packages/bpy/3.6/scripts/addons/cg_preferences
|
||||
cp -r ${cg_preferences}/* $out/lib/python3.10/site-packages/bpy/3.6/scripts/addons/cg_preferences/
|
||||
'';
|
||||
# Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be
|
||||
# found. See the explanation in libglvnd.
|
||||
postFixup = ''
|
||||
buildPythonPath $out/lib/python3.10/site-packages
|
||||
'';
|
||||
|
||||
passthru = { inherit python; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "3D Creation/Animation/Publishing System";
|
||||
description = "3D Creation/Animation/Publishing System module";
|
||||
homepage = "https://www.blender.org";
|
||||
# They comment two licenses: GPLv2 and Blender License, but they
|
||||
# say: "We've decided to cancel the BL offering for an indefinite period."
|
||||
# OptiX, enabled with cudaSupport, is non-free.
|
||||
license = with licenses; [ gpl2Plus ] ++ optional cudaSupport unfree;
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ brothermechanic ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
|
||||
broken = stdenv.isDarwin;
|
||||
maintainers = with maintainers; [ goibhniu veprbl brothermechanic ];
|
||||
mainProgram = "bpy";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
|
||||
index fce901b..1f73c5e 100644
|
||||
--- a/intern/smoke/intern/WAVELET_NOISE.h
|
||||
+++ b/intern/smoke/intern/WAVELET_NOISE.h
|
||||
@@ -43,6 +43,7 @@
|
||||
#ifndef WAVELET_NOISE_H
|
||||
#define WAVELET_NOISE_H
|
||||
|
||||
+#include <string.h>
|
||||
#include <MERSENNETWISTER.h>
|
||||
|
||||
#ifdef WIN32
|
46
pkgs/development/python-modules/bpy/x112.patch
Normal file
46
pkgs/development/python-modules/bpy/x112.patch
Normal file
|
@ -0,0 +1,46 @@
|
|||
--- a/intern/ghost/CMakeLists.txt
|
||||
+++ b/intern/ghost/CMakeLists.txt
|
||||
@@ -183,6 +183,13 @@
|
||||
${X11_X11_INCLUDE_PATH}
|
||||
)
|
||||
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_X11_LIB}
|
||||
+ -lXext
|
||||
+ -lXxf86vm
|
||||
+ ${X11_Xrender_LIB}
|
||||
+ )
|
||||
+
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerX11.cpp
|
||||
intern/GHOST_SystemX11.cpp
|
||||
@@ -234,6 +241,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_xf86vmode_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xf86vmode_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
if(WITH_X11_XFIXES)
|
||||
@@ -241,6 +251,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_Xfixes_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xfixes_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
if(WITH_X11_ALPHA)
|
||||
@@ -252,6 +265,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_Xinput_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xinput_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
add_definitions(-DWITH_GHOST_X11)
|
10
pkgs/misc/blender/blender-fix-boost-1.81-iostream.patch
Normal file
10
pkgs/misc/blender/blender-fix-boost-1.81-iostream.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/intern/locale/boost_locale_wrapper.cpp
|
||||
+++ b/intern/locale/boost_locale_wrapper.cpp
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <boost/locale.hpp>
|
||||
#include <stdio.h>
|
||||
+#include <iostream>
|
||||
|
||||
#include "boost_locale_wrapper.h"
|
||||
|
10
pkgs/misc/blender/blender-fix-desktop.patch
Normal file
10
pkgs/misc/blender/blender-fix-desktop.patch
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- a/release/freedesktop/blender.desktop
|
||||
+++ b/release/freedesktop/blender.desktop
|
||||
@@ -84,6 +84,6 @@ Icon=blender
|
||||
Terminal=false
|
||||
Type=Application
|
||||
PrefersNonDefaultGPU=true
|
||||
-X-KDE-RunOnDiscreteGpu=true
|
||||
+X-PreferRunOnDiscreteGPU=true
|
||||
Categories=Graphics;3DGraphics;
|
||||
MimeType=application/x-blender;
|
84
pkgs/misc/blender/cg-defaults.patch
Normal file
84
pkgs/misc/blender/cg-defaults.patch
Normal file
|
@ -0,0 +1,84 @@
|
|||
diff -Naur a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h
|
||||
--- a/source/blender/makesdna/DNA_modifier_defaults.h 2020-12-24 20:07:32.000000000 +0300
|
||||
+++ b/source/blender/makesdna/DNA_modifier_defaults.h 2020-12-28 00:11:53.397550988 +0300
|
||||
@@ -43,7 +43,7 @@
|
||||
.length = 0.0f, \
|
||||
.merge_dist = 0.01f, \
|
||||
.fit_type = MOD_ARR_FIXEDCOUNT, \
|
||||
- .offset_type = MOD_ARR_OFF_RELATIVE, \
|
||||
+ .offset_type = MOD_ARR_OFF_CONST, \
|
||||
.flags = 0, \
|
||||
.count = 2, \
|
||||
.uv_offset = {0.0f, 0.0f}, \
|
||||
@@ -51,8 +51,8 @@
|
||||
|
||||
#define _DNA_DEFAULT_BevelModifierData \
|
||||
{ \
|
||||
- .value = 0.1f, \
|
||||
- .res = 1, \
|
||||
+ .value = 0.01f, \
|
||||
+ .res = 2, \
|
||||
.flags = 0, \
|
||||
.val_flags = MOD_BEVEL_AMT_OFFSET, \
|
||||
.profile_type = MOD_BEVEL_PROFILE_SUPERELLIPSE, \
|
||||
@@ -93,7 +93,7 @@
|
||||
#define _DNA_DEFAULT_CastModifierData \
|
||||
{ \
|
||||
.object = NULL, \
|
||||
- .fac = 0.5f, \
|
||||
+ .fac = 1.0f, \
|
||||
.radius = 0.0f, \
|
||||
.size = 0.0f, \
|
||||
.defgrp_name = "", \
|
||||
@@ -259,7 +259,7 @@
|
||||
|
||||
#define _DNA_DEFAULT_DecimateModifierData \
|
||||
{ \
|
||||
- .percent = 1.0f, \
|
||||
+ .percent = 0.1f, \
|
||||
.iter = 0, \
|
||||
.delimit = 0, \
|
||||
.symmetry_axis = 0, \
|
||||
@@ -567,7 +567,7 @@
|
||||
.vgroup_name = "", \
|
||||
.factor = DEG2RADF(45.0f), \
|
||||
.limit = {0.0f, 1.0f}, \
|
||||
- .mode = MOD_SIMPLEDEFORM_MODE_TWIST, \
|
||||
+ .mode = MOD_SIMPLEDEFORM_MODE_BEND, \
|
||||
.axis = 0, \
|
||||
.deform_axis = 0, \
|
||||
.flag = 0, \
|
||||
@@ -608,7 +608,7 @@
|
||||
.crease_inner = 0.0f, \
|
||||
.crease_outer = 0.0f, \
|
||||
.crease_rim = 0.0f, \
|
||||
- .flag = MOD_SOLIDIFY_RIM, \
|
||||
+ .flag = MOD_SOLIDIFY_RIM | MOD_SOLIDIFY_EVEN, \
|
||||
.mat_ofs = 0, \
|
||||
.mat_ofs_rim = 0, \
|
||||
.merge_tolerance = 0.0001f, \
|
||||
@@ -619,7 +619,7 @@
|
||||
.subdivType = 0, \
|
||||
.levels = 1, \
|
||||
.renderLevels = 2, \
|
||||
- .flags = eSubsurfModifierFlag_UseCrease | eSubsurfModifierFlag_ControlEdges, \
|
||||
+ .flags = eSubsurfModifierFlag_UseCrease | eSubsurfModifierFlag_ControlEdges | eSubsurfModifierFlag_UseRecursiveSubdivision, \
|
||||
.uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES, \
|
||||
.quality = 3, \
|
||||
.boundary_smooth = SUBSURF_BOUNDARY_SMOOTH_ALL, \
|
||||
diff -Naur a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h
|
||||
--- a/source/blender/makesdna/DNA_view3d_defaults.h 2020-12-24 20:07:32.000000000 +0300
|
||||
+++ b/source/blender/makesdna/DNA_view3d_defaults.h 2020-12-27 22:52:32.467466785 +0300
|
||||
@@ -94,9 +94,9 @@
|
||||
.flag = V3D_SELECT_OUTLINE, \
|
||||
.flag2 = V3D_SHOW_RECONSTRUCTION | V3D_SHOW_ANNOTATION, \
|
||||
\
|
||||
- .lens = 50.0f, \
|
||||
- .clip_start = 0.01f, \
|
||||
- .clip_end = 1000.0f, \
|
||||
+ .lens = 85.0f, \
|
||||
+ .clip_start = 0.001f, \
|
||||
+ .clip_end = 100.0f, \
|
||||
\
|
||||
.bundle_size = 0.2f, \
|
||||
.bundle_drawtype = OB_PLAINAXES, \
|
45
pkgs/misc/blender/cg_environment.patch
Normal file
45
pkgs/misc/blender/cg_environment.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
--- /dev/null 2023-08-11 22:07:27.012000310 +0300
|
||||
+++ b/scripts/startup/cg_environment.py 2023-08-11 00:44:51.704718595 +0300
|
||||
@@ -0,0 +1,42 @@
|
||||
+#!/usr/bin/python3
|
||||
+# -*- coding: utf-8 -*-
|
||||
+# Copyright (C) 2023 Ilia Kurochkin <brothermechanic@gmail.com>
|
||||
+#
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 3 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful,
|
||||
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+# GNU General Public License for more details.
|
||||
+
|
||||
+__doc__ = 'Environment for use CG Overlay'
|
||||
+__version__ = '0.1'
|
||||
+
|
||||
+import bpy
|
||||
+from bpy.app.handlers import persistent
|
||||
+import addon_utils
|
||||
+
|
||||
+
|
||||
+@persistent
|
||||
+def cg_env(dummy):
|
||||
+ '''Scripts environment'''
|
||||
+ addon_utils.enable('cg_preferences', default_set=True)
|
||||
+
|
||||
+ print('CG Environment activated!')
|
||||
+
|
||||
+
|
||||
+def register():
|
||||
+ '''register blender module'''
|
||||
+ bpy.app.handlers.load_post.append(cg_env)
|
||||
+
|
||||
+
|
||||
+def unregister():
|
||||
+ '''unregister blender module'''
|
||||
+ bpy.app.handlers.load_post.remove(cg_env)
|
||||
+
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ register()
|
42
pkgs/misc/blender/cg_environment.py
Normal file
42
pkgs/misc/blender/cg_environment.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2023 Ilia Kurochkin <brothermechanic@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
__doc__ = 'Environment for use CG Overlay'
|
||||
__version__ = '0.1'
|
||||
|
||||
import bpy
|
||||
from bpy.app.handlers import persistent
|
||||
import addon_utils
|
||||
|
||||
|
||||
@persistent
|
||||
def cg_env(dummy):
|
||||
'''Scripts environment'''
|
||||
addon_utils.enable('cg_preferences', default_set=True)
|
||||
|
||||
print('CG Environment activated!')
|
||||
|
||||
|
||||
def register():
|
||||
'''register blender module'''
|
||||
bpy.app.handlers.load_post.append(cg_env)
|
||||
|
||||
|
||||
def unregister():
|
||||
'''unregister blender module'''
|
||||
bpy.app.handlers.load_post.remove(cg_env)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
register()
|
|
@ -1,80 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1832,7 +1832,7 @@ if(WITH_COMPILER_SHORT_FILE_MACRO)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_PREFIX_MAP_FLAGS CXX_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)
|
||||
if(C_MACRO_PREFIX_MAP AND CXX_MACRO_PREFIX_MAP)
|
||||
if(APPLE)
|
||||
- if(XCODE AND ${XCODE_VERSION} VERSION_LESS 12.0)
|
||||
+ if(FALSE)
|
||||
# Developers may have say LLVM Clang-10.0.1 toolchain (which supports the flag)
|
||||
# with Xcode-11 (the Clang of which doesn't support the flag).
|
||||
message(WARNING
|
||||
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
|
||||
--- a/build_files/cmake/platform/platform_apple.cmake
|
||||
+++ b/build_files/cmake/platform/platform_apple.cmake
|
||||
@@ -60,7 +60,6 @@ else()
|
||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||
endif()
|
||||
if(NOT EXISTS "${LIBDIR}/")
|
||||
- message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
|
||||
# Prefer lib directory paths
|
||||
@@ -98,10 +97,6 @@ if(WITH_CODEC_SNDFILE)
|
||||
find_library(_sndfile_VORBIS_LIBRARY NAMES vorbis HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
find_library(_sndfile_VORBISENC_LIBRARY NAMES vorbisenc HINTS ${LIBDIR}/ffmpeg/lib)
|
||||
list(APPEND LIBSNDFILE_LIBRARIES
|
||||
- ${_sndfile_FLAC_LIBRARY}
|
||||
- ${_sndfile_OGG_LIBRARY}
|
||||
- ${_sndfile_VORBIS_LIBRARY}
|
||||
- ${_sndfile_VORBISENC_LIBRARY}
|
||||
)
|
||||
|
||||
print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
|
||||
@@ -118,7 +113,7 @@ if(WITH_PYTHON)
|
||||
# Normally cached but not since we include them with blender.
|
||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}")
|
||||
- set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.a)
|
||||
+ set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.dylib)
|
||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||
else()
|
||||
# Module must be compiled against Python framework.
|
||||
@@ -147,7 +142,7 @@ endif()
|
||||
|
||||
# FreeType compiled with Brotli compression for woff2.
|
||||
find_package(Freetype REQUIRED)
|
||||
-list(APPEND FREETYPE_LIBRARIES
|
||||
+message(TRACE APPEND FREETYPE_LIBRARIES
|
||||
${LIBDIR}/brotli/lib/libbrotlicommon-static.a
|
||||
${LIBDIR}/brotli/lib/libbrotlidec-static.a)
|
||||
|
||||
@@ -159,9 +154,7 @@ if(WITH_CODEC_FFMPEG)
|
||||
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
|
||||
set(FFMPEG_FIND_COMPONENTS
|
||||
avcodec avdevice avformat avutil
|
||||
- mp3lame ogg opus swresample swscale
|
||||
- theora theoradec theoraenc vorbis vorbisenc
|
||||
- vorbisfile vpx x264 xvidcore)
|
||||
+ swresample swscale)
|
||||
find_package(FFmpeg)
|
||||
endif()
|
||||
|
||||
@@ -270,7 +263,6 @@ if(WITH_BOOST)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
|
||||
- string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it !
|
||||
endif()
|
||||
|
||||
if(WITH_PUGIXML)
|
||||
@@ -399,7 +391,7 @@ endif()
|
||||
|
||||
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
|
||||
if(WITH_OPENMP)
|
||||
- if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
+ if(FALSE)
|
||||
# Use OpenMP from our precompiled libraries.
|
||||
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
|
||||
set(OPENMP_CUSTOM ON)
|
|
@ -1,80 +1,107 @@
|
|||
{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew
|
||||
, ilmbase, libXi, libX11, libXext, libXrender
|
||||
, libjpeg, libpng, libsamplerate, libsndfile
|
||||
, libtiff, libGLU, libGL, openal, opencolorio, openexr, openimagedenoise, openimageio2, openjpeg, python310Packages
|
||||
, openvdb, libXxf86vm, tbb, alembic
|
||||
, zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
|
||||
# TODO WITH_CYCLES_OSL
|
||||
# TODO WITH_NANOVDB
|
||||
# TODO WITH_CLANG
|
||||
{ config, stdenv, lib, fetchurl, fetchzip, fetchgit, makeWrapper, cmake, git-lfs
|
||||
, boost, ocl-icd, gettext, zlib, zstd, jemalloc, pugixml, llvmPackages, clang
|
||||
, libepoxy, libXi, libX11, libXext, libXrender, libXxf86vm
|
||||
, libGLU, libGL, glew, addOpenGLRunpath
|
||||
, openimageio, opencolorio, openexr, ilmbase, libjpeg, libpng, libtiff, libwebp, potrace
|
||||
, embree, gmp, openvdb, tbb, alembic, openimagedenoise, opensubdiv, freetype, libharu
|
||||
, openal, libsamplerate
|
||||
, ffmpeg, fftw, libsndfile
|
||||
, python310Packages
|
||||
, jackaudioSupport ? false, libjack2
|
||||
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}
|
||||
, cudaSupport ? config.cudaSupport or false, cudaPackages ? { }
|
||||
, hipSupport ? false, hip # comes with a significantly larger closure size
|
||||
, colladaSupport ? true, opencollada
|
||||
, spaceNavSupport ? stdenv.isLinux, libspnav
|
||||
, makeWrapper
|
||||
, pugixml, llvmPackages, SDL
|
||||
, potrace
|
||||
, openxr-loader
|
||||
, embree, gmp, libharu
|
||||
, libepoxy, brotli
|
||||
, waylandSupport ? stdenv.isLinux, pkg-config, wayland, wayland-protocols, libffi, libdecor, libxkbcommon, dbus
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
python = python310Packages.python;
|
||||
optix = fetchzip {
|
||||
# url taken from the archlinux blender PKGBUILD
|
||||
url = "https://developer.download.nvidia.com/redist/optix/v7.3/OptiX-7.3.0-Include.zip";
|
||||
sha256 = "0max1j4822mchj0xpz9lqzh91zkmvsn4py0r174cvqfz8z8ykjk8";
|
||||
url = "https://developer.download.nvidia.com/redist/optix/v7.4/OptiX-7.4.0-Include.zip";
|
||||
sha256 = "sha256-ca08XetwaUYC9foeP5bff9kcDfuFgEzopvjspn2s8RY=";
|
||||
};
|
||||
cg_preferences = fetchgit {
|
||||
url = "https://gitlab.com/brothermechanic/cg_preferences.git";
|
||||
rev = "db192525ff41dfae4c063dc914a2c3fe5850d480";
|
||||
sha256 = "sha256-+eLWdokH/5odzOTykgrmG36U8h+Wf8YGOxe1oIy4dJo=";
|
||||
fetchLFS = true;
|
||||
};
|
||||
robossembler = fetchgit {
|
||||
url = "https://gitlab.com/brothermechanic/logo.git";
|
||||
rev = "0a0235cd154a59b711e87456206ccd7ba69a7e4e";
|
||||
sha256 = "sha256-/QsgKdtDHNymsTEmhIzSrOKNUqqkXl8coy+5LwIEkas=";
|
||||
fetchLFS = true;
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "blender";
|
||||
version = "3.4.1";
|
||||
version = "3.6.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.blender.org/source/${pname}-${version}.tar.xz";
|
||||
hash = "sha256-JHxMEignDJAQ9HIcmFy1tiirUKvPnyZ4Ywc3FC7rkcM=";
|
||||
hash = "sha256-JJF+cbyya0kAJXBU2do4tiMWx0J9cyNTO0HKmztFrE0=";
|
||||
};
|
||||
|
||||
patches = lib.optional stdenv.isDarwin ./darwin.patch;
|
||||
patches = [
|
||||
./cg_environment.patch
|
||||
./cg-defaults.patch
|
||||
./x112.patch
|
||||
./blender-fix-desktop.patch
|
||||
./blender-fix-boost-1.81-iostream.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ]
|
||||
++ optionals cudaSupport [ addOpenGLRunpath ];
|
||||
nativeBuildInputs =
|
||||
[ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev git-lfs
|
||||
]
|
||||
++ lib.optionals cudaSupport [ addOpenGLRunpath ]
|
||||
++ lib.optionals waylandSupport [ pkg-config ];
|
||||
buildInputs =
|
||||
[ boost ffmpeg gettext glew ilmbase
|
||||
freetype libjpeg libpng libsamplerate libsndfile libtiff
|
||||
opencolorio openexr openimagedenoise openimageio2 openjpeg python zlib zstd fftw jemalloc
|
||||
freetype libjpeg libpng libsamplerate libsndfile libtiff libwebp
|
||||
opencolorio openexr openimageio python zlib zstd fftw jemalloc
|
||||
alembic
|
||||
(opensubdiv.override { inherit cudaSupport; })
|
||||
tbb
|
||||
embree
|
||||
gmp
|
||||
pugixml
|
||||
potrace
|
||||
libharu
|
||||
libepoxy
|
||||
brotli
|
||||
optix
|
||||
]
|
||||
++ lib.optionals waylandSupport [
|
||||
wayland wayland-protocols libffi libdecor libxkbcommon dbus
|
||||
]
|
||||
++ lib.optionals (!stdenv.isAarch64) [
|
||||
openimagedenoise
|
||||
embree
|
||||
]
|
||||
++ (if (!stdenv.isDarwin) then [
|
||||
libXi libX11 libXext libXrender
|
||||
libGLU libGL openal
|
||||
libXxf86vm
|
||||
openxr-loader
|
||||
# OpenVDB currently doesn't build on darwin
|
||||
openvdb
|
||||
]
|
||||
else [
|
||||
llvmPackages.openmp SDL
|
||||
llvmPackages.openmp
|
||||
])
|
||||
++ optional jackaudioSupport libjack2
|
||||
++ optional cudaSupport cudaPackages.cudatoolkit
|
||||
++ optional colladaSupport opencollada
|
||||
++ optional spaceNavSupport libspnav;
|
||||
++ lib.optional jackaudioSupport libjack2
|
||||
++ lib.optional cudaSupport cudaPackages.cudatoolkit
|
||||
++ lib.optional colladaSupport opencollada
|
||||
++ lib.optional spaceNavSupport libspnav
|
||||
;
|
||||
pythonPath = with python310Packages; [ numpy requests ];
|
||||
|
||||
postPatch = ''
|
||||
# allow usage of dynamically linked embree
|
||||
rm build_files/cmake/Modules/FindEmbree.cmake
|
||||
cp ${cg_preferences}/startup.blend release/datafiles/
|
||||
cp ${robossembler}/raster/robossembler_1024x512_roboty-rossii.png release/datafiles/splash.png
|
||||
'' +
|
||||
(if stdenv.isDarwin then ''
|
||||
: > build_files/cmake/platform/platform_apple_xcode.cmake
|
||||
|
@ -91,63 +118,85 @@ stdenv.mkDerivation rec {
|
|||
'' else ''
|
||||
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
|
||||
'') +
|
||||
(if hipSupport then ''
|
||||
(lib.optionalString hipSupport ''
|
||||
substituteInPlace extern/hipew/src/hipew.c --replace '"/opt/rocm/hip/lib/libamdhip64.so"' '"${hip}/lib/libamdhip64.so"'
|
||||
substituteInPlace extern/hipew/src/hipew.c --replace '"opt/rocm/hip/bin"' '"${hip}/bin"'
|
||||
'' else "");
|
||||
'');
|
||||
|
||||
cmakeFlags =
|
||||
[
|
||||
"-DWITH_ALEMBIC=ON"
|
||||
"-DWITH_USD=OFF"
|
||||
"-DWITH_MOD_OCEANSIM=ON"
|
||||
"-DWITH_CODEC_FFMPEG=ON"
|
||||
"-DWITH_CODEC_SNDFILE=ON"
|
||||
"-DWITH_INSTALL_PORTABLE=OFF"
|
||||
"-DWITH_FFTW3=ON"
|
||||
"-DWITH_SDL=OFF"
|
||||
"-DWITH_OPENCOLORIO=ON"
|
||||
"-DWITH_OPENSUBDIV=ON"
|
||||
"-DPYTHON_LIBRARY=${python.libPrefix}"
|
||||
"-DPYTHON_LIBPATH=${python}/lib"
|
||||
"-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
|
||||
"-DPYTHON_VERSION=${python.pythonVersion}"
|
||||
"-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
|
||||
"-DPYTHON_LIBRARY=${python.libPrefix}"
|
||||
"-DWITH_PYTHON_INSTALL=OFF"
|
||||
"-DWITH_PYTHON_INSTALL_NUMPY=OFF"
|
||||
"-DPYTHON_NUMPY_PATH=${python310Packages.numpy}/${python.sitePackages}"
|
||||
"-DPYTHON_NUMPY_INCLUDE_DIRS=${python310Packages.numpy}/${python.sitePackages}/numpy/core/include"
|
||||
"-DWITH_PYTHON_INSTALL_REQUESTS=OFF"
|
||||
"-DWITH_ALEMBIC=ON"
|
||||
# Blender supplies its own FindAlembic.cmake (incompatible with the Alembic-supplied config file)
|
||||
"-DALEMBIC_INCLUDE_DIR=${lib.getDev alembic}/include"
|
||||
"-DALEMBIC_LIBRARY=${lib.getLib alembic}/lib/libAlembic.so"
|
||||
"-DWITH_INSTALL_PORTABLE=OFF"
|
||||
"-DWITH_OPENVDB=ON"
|
||||
"-DWITH_TBB=ON"
|
||||
"-DWITH_IMAGE_OPENJPEG=ON"
|
||||
"-DWITH_NANOVDB=ON"
|
||||
"-DWITH_IMAGE_OPENJPEG=OFF"
|
||||
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
|
||||
"-DWITH_OPENAL=ON"
|
||||
"-DWITH_SDL=OFF"
|
||||
"-DWITH_OPENMP=ON"
|
||||
"-DWITH_OPENCOLORIO=ON"
|
||||
"-DWITH_OPENSUBDIV=ON"
|
||||
"-DWITH_TBB=ON"
|
||||
"-DWITH_USD=OFF"
|
||||
"-DWITH_XR_OPENXR=OFF"
|
||||
"-DWITH_NINJA_POOL_JOBS=OFF"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
"-DWITH_BUILDINFO=OFF"
|
||||
"-DWITH_HYDRA=OFF"
|
||||
"-DWITH_MATERIALX=OFF"
|
||||
"-DWITH_LINKER_LLD=ON"
|
||||
"-DWITH_LIBS_PRECOMPILED=OFF"
|
||||
"-DWITH_INTERNATIONAL=ON"
|
||||
]
|
||||
++ optionals stdenv.isDarwin [
|
||||
++ lib.optionals stdenv.hostPlatform.isAarch64 [
|
||||
"-DWITH_CYCLES_EMBREE=OFF"
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
"-DWITH_CYCLES_OSL=OFF" # requires LLVM
|
||||
"-DWITH_OPENVDB=OFF" # OpenVDB currently doesn't build on darwin
|
||||
|
||||
"-DLIBDIR=/does-not-exist"
|
||||
]
|
||||
# Clang doesn't support "-export-dynamic"
|
||||
++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
|
||||
++ optional jackaudioSupport "-DWITH_JACK=ON"
|
||||
++ optionals cudaSupport [
|
||||
++ lib.optionals cudaSupport [
|
||||
"-DWITH_CYCLES_CUDA_BINARIES=ON"
|
||||
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
|
||||
"-DOPTIX_ROOT_DIR=${optix}"
|
||||
"-DOPTIX_INCLUDE_DIR=${optix}"
|
||||
]
|
||||
# Clang doesn't support "-export-dynamic"
|
||||
++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS="
|
||||
++ lib.optional jackaudioSupport "-DWITH_JACK=ON"
|
||||
++ lib.optionals waylandSupport [
|
||||
"-DWITH_GHOST_WAYLAND=ON"
|
||||
"-DWITH_GHOST_WAYLAND_DBUS=ON"
|
||||
"-DWITH_GHOST_WAYLAND_DYNLOAD=OFF"
|
||||
"-DWITH_GHOST_WAYLAND_LIBDECOR=ON"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
|
||||
env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
|
||||
|
||||
# Since some dependencies are built with gcc 6, we need gcc 6's
|
||||
# libstdc++ in our RPATH. Sigh.
|
||||
NIX_LDFLAGS = optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
|
||||
NIX_LDFLAGS = lib.optionalString cudaSupport "-rpath ${stdenv.cc.cc.lib}/lib";
|
||||
|
||||
blenderExecutable =
|
||||
placeholder "out" + (if stdenv.isDarwin then "/Applications/Blender.app/Contents/MacOS/Blender" else "/bin/blender");
|
||||
postInstall = lib.optionalString stdenv.isDarwin ''
|
||||
mkdir $out/Applications
|
||||
mv $out/Blender.app $out/Applications
|
||||
'' + ''
|
||||
mkdir $out/share/blender/3.6/scripts/addons/cg_preferences
|
||||
cp -r ${cg_preferences}/* $out/share/blender/3.6/scripts/addons/cg_preferences/
|
||||
'' + ''
|
||||
buildPythonPath "$pythonPath"
|
||||
wrapProgram $blenderExecutable \
|
||||
|
@ -155,16 +204,20 @@ stdenv.mkDerivation rec {
|
|||
--prefix PYTHONPATH : "$program_PYTHONPATH" \
|
||||
--add-flags '--python-use-system-env'
|
||||
'';
|
||||
|
||||
#cp ${cg_environment} $out/share/blender/3.6/scripts/startup/
|
||||
# cp ./cg_environment.py "$out/share/blender/3.6/scripts/startup/
|
||||
# cp "${cg_preferences}" "$out/share/blender/3.6/scripts/addons/
|
||||
# Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be
|
||||
# found. See the explanation in libglvnd.
|
||||
postFixup = optionalString cudaSupport ''
|
||||
postFixup = lib.optionalString cudaSupport ''
|
||||
for program in $out/bin/blender $out/bin/.blender-wrapped; do
|
||||
isELF "$program" || continue
|
||||
addOpenGLRunpath "$program"
|
||||
done
|
||||
'';
|
||||
|
||||
passthru = { inherit python; };
|
||||
|
||||
meta = with lib; {
|
||||
description = "3D Creation/Animation/Publishing System";
|
||||
homepage = "https://www.blender.org";
|
||||
|
@ -172,7 +225,9 @@ stdenv.mkDerivation rec {
|
|||
# say: "We've decided to cancel the BL offering for an indefinite period."
|
||||
# OptiX, enabled with cudaSupport, is non-free.
|
||||
license = with licenses; [ gpl2Plus ] ++ optional cudaSupport unfree;
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
maintainers = with maintainers; [ goibhniu veprbl ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
|
||||
broken = stdenv.isDarwin;
|
||||
maintainers = with maintainers; [ goibhniu veprbl brothermechanic ];
|
||||
mainProgram = "blender";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/intern/smoke/intern/WAVELET_NOISE.h b/intern/smoke/intern/WAVELET_NOISE.h
|
||||
index fce901b..1f73c5e 100644
|
||||
--- a/intern/smoke/intern/WAVELET_NOISE.h
|
||||
+++ b/intern/smoke/intern/WAVELET_NOISE.h
|
||||
@@ -43,6 +43,7 @@
|
||||
#ifndef WAVELET_NOISE_H
|
||||
#define WAVELET_NOISE_H
|
||||
|
||||
+#include <string.h>
|
||||
#include <MERSENNETWISTER.h>
|
||||
|
||||
#ifdef WIN32
|
BIN
pkgs/misc/blender/robossembler-splash.patch
Normal file
BIN
pkgs/misc/blender/robossembler-splash.patch
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
46
pkgs/misc/blender/x112.patch
Normal file
46
pkgs/misc/blender/x112.patch
Normal file
|
@ -0,0 +1,46 @@
|
|||
--- a/intern/ghost/CMakeLists.txt
|
||||
+++ b/intern/ghost/CMakeLists.txt
|
||||
@@ -183,6 +183,13 @@
|
||||
${X11_X11_INCLUDE_PATH}
|
||||
)
|
||||
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_X11_LIB}
|
||||
+ -lXext
|
||||
+ -lXxf86vm
|
||||
+ ${X11_Xrender_LIB}
|
||||
+ )
|
||||
+
|
||||
list(APPEND SRC
|
||||
intern/GHOST_DisplayManagerX11.cpp
|
||||
intern/GHOST_SystemX11.cpp
|
||||
@@ -234,6 +241,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_xf86vmode_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xf86vmode_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
if(WITH_X11_XFIXES)
|
||||
@@ -241,6 +251,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_Xfixes_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xfixes_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
if(WITH_X11_ALPHA)
|
||||
@@ -252,6 +265,9 @@
|
||||
list(APPEND INC_SYS
|
||||
${X11_Xinput_INCLUDE_PATH}
|
||||
)
|
||||
+ list(APPEND LIB
|
||||
+ ${X11_Xinput_LIB}
|
||||
+ )
|
||||
endif()
|
||||
|
||||
add_definitions(-DWITH_GHOST_X11)
|
Loading…
Add table
Add a link
Reference in a new issue