Added blender 3.4.1 bin and python module
This commit is contained in:
parent
4c52ac2994
commit
b69bc0aef1
13 changed files with 2346 additions and 112 deletions
11
README.md
11
README.md
|
@ -2,8 +2,13 @@
|
||||||
|
|
||||||
[](https://robossembler.cachix.org)
|
[](https://robossembler.cachix.org)
|
||||||
|
|
||||||
Для запуска:
|
Для установки в свою систему blender 3.4.1
|
||||||
|
* nix profile install gitlab:robossembler/nix-robossembler-overlay#blender
|
||||||
|
|
||||||
|
Запуск локальных окружений для разработки
|
||||||
|
* Python-модуль bpy: `nix develop gitlab:robossembler/nix-robossembler-overlay#bpy`
|
||||||
|
* ROS2 Rolling `nix develop gitlab:robossembler/nix-robossembler-overlay#ros`
|
||||||
|
|
||||||
|
Для внесения изменений в репозиторий:
|
||||||
* git clone https://gitlab.com/robossembler/nix-robossembler-overlay
|
* git clone https://gitlab.com/robossembler/nix-robossembler-overlay
|
||||||
* cd nix-robossembler-overlay
|
* cd nix-robossembler-overlay
|
||||||
* Python-модуль bpy: `nix develop .#blender`
|
|
||||||
* ROS2 Rolling `nix develop .#ros`
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ system ? builtins.currentSystem, pkgs ? import <nixpkgs> { inherit system; } }:
|
|
||||||
|
|
||||||
rec {
|
|
||||||
cork = pkgs.callPackage ./pkgs/cork { };
|
|
||||||
}
|
|
12
flake.lock
generated
12
flake.lock
generated
|
@ -32,11 +32,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670498129,
|
"lastModified": 1675153841,
|
||||||
"narHash": "sha256-QOWbsKObHxNpBzrIVJrgR2TGQdwyYNFgBdoVCCvYuDU=",
|
"narHash": "sha256-EWvU3DLq+4dbJiukfhS7r6sWZyJikgXn6kNl7eHljW8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "52665b05cfd702e12b877aa519b62374d003231a",
|
"rev": "ea692c2ad1afd6384e171eabef4f0887d2b882d3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -75,11 +75,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670693373,
|
"lastModified": 1674431994,
|
||||||
"narHash": "sha256-bN57G4pVApAVIZqCtflto8v7vArnMwLEAger2N8FCG0=",
|
"narHash": "sha256-DszloUZcf1GHlOjDUlryMxmmz6DaTS8dFGpNKRvr2wg=",
|
||||||
"owner": "lopsided98",
|
"owner": "lopsided98",
|
||||||
"repo": "nix-ros-overlay",
|
"repo": "nix-ros-overlay",
|
||||||
"rev": "795e67fe0e19118cef94209e4470edc64f13df93",
|
"rev": "731052037faa9840d05ce50360181f79c6aa1069",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
26
flake.nix
26
flake.nix
|
@ -12,8 +12,17 @@
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
ros = ros-flake.legacyPackages.${system}.rolling;
|
ros = ros-flake.legacyPackages.${system}.rolling;
|
||||||
|
|
||||||
|
# robossembler custom packages; defined here for share between devShells and packages
|
||||||
|
bpy = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/bpy { };
|
||||||
|
blender = pkgs.callPackage ./pkgs/misc/blender { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
packages = {
|
||||||
|
blender = blender;
|
||||||
|
python3Packages = pkgs.recurseIntoAttrs bpy;
|
||||||
|
};
|
||||||
|
|
||||||
devShells.ros =
|
devShells.ros =
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
buildInputs = (with ros; [ ros2run rmw-fastrtps-dynamic-cpp ]);
|
buildInputs = (with ros; [ ros2run rmw-fastrtps-dynamic-cpp ]);
|
||||||
|
@ -22,20 +31,9 @@
|
||||||
export LD_LIBRARY_PATH=${(with pkgs; lib.makeLibraryPath [ libsodium ])}
|
export LD_LIBRARY_PATH=${(with pkgs; lib.makeLibraryPath [ libsodium ])}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
devShells.blender =
|
|
||||||
let
|
devShells.bpy = pkgs.mkShell { packages = [ bpy ]; };
|
||||||
bpy = pkgs.callPackage ./pkgs/bpy.nix { };
|
devShells.blender = pkgs.mkShell { packages = [ blender ]; };
|
||||||
LD_LIBRARY_PATH = with pkgs;
|
|
||||||
lib.makeLibraryPath ([ libxkbcommon ] ++
|
|
||||||
(with xorg; [ libX11 libXrender libXxf86vm libXfixes libXi ])
|
|
||||||
);
|
|
||||||
in
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = [ bpy ];
|
|
||||||
shellHook = ''
|
|
||||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${pkgs.stdenv.cc.cc.lib}/lib/:/run/opengl-driver/lib/
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
21
pkgs/bpy.nix
21
pkgs/bpy.nix
|
@ -1,21 +0,0 @@
|
||||||
{ lib, pkgs, python310, fetchurl }:
|
|
||||||
|
|
||||||
pkgs.python310Packages.buildPythonPackage rec {
|
|
||||||
pname = "bpy";
|
|
||||||
version = "3.4.0";
|
|
||||||
format = "wheel";
|
|
||||||
src = fetchurl {
|
|
||||||
sha256 = "87b3cf0e9138ec46cdfb570d1577bf547b9cd46608ccb5068d41e28b5ae3a744";
|
|
||||||
url = "https://files.pythonhosted.org/packages/9c/f3/732e7c6d6c0932b80df488a24e02ac34e8eae14a3c893eb97dcbf6e9c93c/bpy-3.4.0-cp310-cp310-manylinux_2_17_x86_64.whl";
|
|
||||||
};
|
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ cython numpy requests zstandard ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "3D Creation/Animation/Publishing System";
|
|
||||||
homepage = "https://www.blender.org";
|
|
||||||
license = with licenses; [ gpl2Plus ];
|
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
maintainers = with maintainers; [ movefasta ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ lib, pkgs, python310, fetchurl }:
|
|
||||||
|
|
||||||
pkgs.python310Packages.buildPythonPackage rec {
|
|
||||||
pname = "bpy";
|
|
||||||
version = "3.4.0";
|
|
||||||
format = "wheel";
|
|
||||||
src = fetchurl {
|
|
||||||
sha256 = "87b3cf0e9138ec46cdfb570d1577bf547b9cd46608ccb5068d41e28b5ae3a744";
|
|
||||||
url = "https://files.pythonhosted.org/packages/9c/f3/732e7c6d6c0932b80df488a24e02ac34e8eae14a3c893eb97dcbf6e9c93c/bpy-3.4.0-cp310-cp310-manylinux_2_17_x86_64.whl";
|
|
||||||
};
|
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ cython numpy requests zstandard ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "3D Creation/Animation/Publishing System";
|
|
||||||
homepage = "https://www.blender.org";
|
|
||||||
license = with licenses; [ gpl2Plus ];
|
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
maintainers = with maintainers; [ movefasta ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
{ lib, fetchFromGitHub, pkgs, stdenv }:
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
pname = "cork";
|
|
||||||
version = "unstable";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "gilbo";
|
|
||||||
repo = "cork";
|
|
||||||
rev = "5987de50801d1ce3dedc91307d478594459662d6";
|
|
||||||
sha256 = "sha256-CmSq3vFddgFmSwjtGOI5s5imZMvsjNgPi43BdQxCNwI=";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ ];
|
|
||||||
buildInputs = [
|
|
||||||
pkgs.clang
|
|
||||||
pkgs.llvm
|
|
||||||
pkgs.gmp
|
|
||||||
];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mkdir -p $out/lib64
|
|
||||||
mkdir -p $out/include
|
|
||||||
|
|
||||||
cp bin/* $out/bin/
|
|
||||||
cp lib/* $out/lib64/
|
|
||||||
cp include/* $out/include/
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Cork - a powerful standalone boolean calculations software";
|
|
||||||
longDescription = ''
|
|
||||||
Cork is designed to support Boolean operations between triangle meshes.
|
|
||||||
'';
|
|
||||||
homepage = "https://github.com/gilbo/cork";
|
|
||||||
license = licenses.gpl3;
|
|
||||||
maintainers = [ "brothermechanic\u00e8s <brothermechanic@gmail.com>" ];
|
|
||||||
platforms = platforms.all;
|
|
||||||
priority = 6; # resolves collision
|
|
||||||
};
|
|
||||||
}
|
|
174
pkgs/development/python-modules/bpy/default.nix
Normal file
174
pkgs/development/python-modules/bpy/default.nix
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
{ config, stdenv, lib, fetchurl, fetchzip, boost, cmake, ffmpeg, gettext, glew
|
||||||
|
, ilmbase, libXi, libX11, libXext, libXrender
|
||||||
|
, libjpeg, libpng, libsamplerate, libsndfile, openexr
|
||||||
|
, libtiff, libGLU, libGL, freeglut, openal, opencolorio, openimagedenoise, openimageio2, python310Packages
|
||||||
|
, openvdb, libXxf86vm, tbb, alembic
|
||||||
|
, zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
|
||||||
|
, cudaSupport ? config.cudaSupport or false, cudaPackages ? {}
|
||||||
|
, hipSupport ? false, hip # comes with a significantly larger closure size
|
||||||
|
, colladaSupport ? true, opencollada
|
||||||
|
, makeWrapper
|
||||||
|
, pugixml, llvmPackages, SDL
|
||||||
|
, potrace
|
||||||
|
, openxr-loader
|
||||||
|
, embree, gmp, libharu
|
||||||
|
, libepoxy, brotli
|
||||||
|
, buildPythonPackage, fetchPypi, pkgs, libwebp, lzma, clang, c-blosc
|
||||||
|
}:
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "bpy";
|
||||||
|
version = "3.4.1";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.blender.org/source/blender-${version}.tar.xz";
|
||||||
|
hash = "sha256-JHxMEignDJAQ9HIcmFy1tiirUKvPnyZ4Ywc3FC7rkcM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ]
|
||||||
|
++ optionals cudaSupport [ addOpenGLRunpath ];
|
||||||
|
buildInputs =
|
||||||
|
[ boost ffmpeg gettext glew ilmbase
|
||||||
|
freetype libjpeg libpng libsamplerate libsndfile libtiff
|
||||||
|
opencolorio openexr openimagedenoise openimageio2 python zlib pkgs.zstd.dev fftw jemalloc
|
||||||
|
pkgs.alembic
|
||||||
|
(opensubdiv.override { inherit cudaSupport; })
|
||||||
|
tbb
|
||||||
|
embree
|
||||||
|
gmp
|
||||||
|
pugixml
|
||||||
|
potrace
|
||||||
|
libharu
|
||||||
|
libepoxy
|
||||||
|
brotli
|
||||||
|
llvmPackages.openmp SDL
|
||||||
|
clang
|
||||||
|
libwebp
|
||||||
|
lzma
|
||||||
|
openvdb c-blosc
|
||||||
|
]
|
||||||
|
++ optional cudaSupport cudaPackages.cudatoolkit
|
||||||
|
++ optional colladaSupport opencollada;
|
||||||
|
pythonPath = with python310Packages; [ numpy requests ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# allow usage of dynamically linked embree
|
||||||
|
rm build_files/cmake/Modules/FindEmbree.cmake
|
||||||
|
'' +
|
||||||
|
(if hipSupport then ''
|
||||||
|
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 "");
|
||||||
|
|
||||||
|
output = [ "out" ];
|
||||||
|
|
||||||
|
# TODO WITH_MEM_JEMALLOC=ON > cannot allocate memory in static TLS block
|
||||||
|
# TODO WITH_CYCLES_DEVICE_OPTIX
|
||||||
|
# TODO NANOVDB_INCLUDE_DIR
|
||||||
|
# TODO _CLANG_LIBRARIES CLANG_INCLUDE_DIR
|
||||||
|
# TODO GIT_EXECUTABLE
|
||||||
|
cmakeFlags =
|
||||||
|
[
|
||||||
|
"-DWITH_ALEMBIC=ON"
|
||||||
|
"-DWITH_USD=OFF"
|
||||||
|
"-DWITH_MOD_OCEANSIM=ON"
|
||||||
|
"-DWITH_CODEC_FFMPEG=ON"
|
||||||
|
"-DWITH_CODEC_SNDFILE=ON"
|
||||||
|
"-DWITH_FFTW3=ON"
|
||||||
|
"-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}"
|
||||||
|
"-DWITH_INSTALL_PORTABLE=ON"
|
||||||
|
"-DWITH_PYTHON_INSTALL=OFF"
|
||||||
|
"-DWITH_AUDASPACE=OFF"
|
||||||
|
"-DWITH_PYTHON_MODULE=ON"
|
||||||
|
"-DWITH_MEM_JEMALLOC=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_OPENVDB=ON"
|
||||||
|
"-DWITH_OPENVDB_BLOSC=ON"
|
||||||
|
"-DWITH_TBB=ON"
|
||||||
|
"-DWITH_IMAGE_HDR=ON"
|
||||||
|
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
|
||||||
|
"-DWITH_CYCLES_EMBREE=ON"
|
||||||
|
"WITH_CYCLES_PATH_GUIDING=OFF"
|
||||||
|
"-DWITH_DOC_MANPAGE=OFF"
|
||||||
|
"-DWITH_FREESTYLE=OFF"
|
||||||
|
"-DWITH_GHOST_X11=OFF"
|
||||||
|
"-DWITH_GHOST_WAYLAND=OFF"
|
||||||
|
"-DWITH_HARU=OFF"
|
||||||
|
"-DWITH_IMAGE_DDS=OFF"
|
||||||
|
"-DWITH_IMAGE_WEBP=ON"
|
||||||
|
"-DWITH_IMAGE_HDR=ON"
|
||||||
|
"-DWITH_IMAGE_OPENEXR=ON"
|
||||||
|
"-DWITH_IMAGE_OPENJPEG=OFF"
|
||||||
|
"-DWITH_IMAGE_TIFF=ON"
|
||||||
|
"-DWITH_INPUT_NDOF=OFF"
|
||||||
|
"-DWITH_INTERNATIONAL=OFF"
|
||||||
|
"-DWITH_JACK=OFF"
|
||||||
|
"-DWITH_PULSEAUDIO=OFF"
|
||||||
|
"-DWITH_LZMA=ON"
|
||||||
|
"-DWITH_LZO=OFF"
|
||||||
|
"-DWITH_LLVM=ON"
|
||||||
|
"-DWITH_CLANG=ON"
|
||||||
|
|
||||||
|
"-DWITH_OPENMP=ON"
|
||||||
|
"-DWITH_QUADRIFLOW=OFF"
|
||||||
|
"-DWITH_SDL=OFF"
|
||||||
|
"-DWITH_CXX11_ABI=ON"
|
||||||
|
"-DWITH_XR_OPENXR=OFF"
|
||||||
|
"-DWITH_LINKER_LLD=ON"
|
||||||
|
]
|
||||||
|
# Clang doesn't support "-export-dynamic"
|
||||||
|
++ optionals cudaSupport [
|
||||||
|
"-DWITH_CYCLES_CUDA=ON"
|
||||||
|
"-DWITH_CYCLES_CUDA_BINARIES=ON"
|
||||||
|
"-DCUDA_NVCC_FLAGS=-std=c++14"
|
||||||
|
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
|
||||||
|
"-DOPTIX_ROOT_DIR=${optix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
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";
|
||||||
|
#"${stdenv.lib.makeLibraryPath [ gnome3.libpeas gnome3.gtksourceview ]}"
|
||||||
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
postFixup = ''
|
||||||
|
buildPythonPath $out/lib/python3.10/site-packages
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "3D Creation/Animation/Publishing System";
|
||||||
|
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 ];
|
||||||
|
};
|
||||||
|
}
|
12
pkgs/development/python-modules/bpy/fix-include.patch
Normal file
12
pkgs/development/python-modules/bpy/fix-include.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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
|
80
pkgs/misc/blender/darwin.patch
Normal file
80
pkgs/misc/blender/darwin.patch
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
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)
|
178
pkgs/misc/blender/default.nix
Normal file
178
pkgs/misc/blender/default.nix
Normal file
|
@ -0,0 +1,178 @@
|
||||||
|
{ 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
|
||||||
|
, jackaudioSupport ? false, libjack2
|
||||||
|
, 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
|
||||||
|
}:
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "blender";
|
||||||
|
version = "3.4.1";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://download.blender.org/source/${pname}-${version}.tar.xz";
|
||||||
|
hash = "sha256-JHxMEignDJAQ9HIcmFy1tiirUKvPnyZ4Ywc3FC7rkcM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = lib.optional stdenv.isDarwin ./darwin.patch;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake makeWrapper python310Packages.wrapPython llvmPackages.llvm.dev ]
|
||||||
|
++ optionals cudaSupport [ addOpenGLRunpath ];
|
||||||
|
buildInputs =
|
||||||
|
[ boost ffmpeg gettext glew ilmbase
|
||||||
|
freetype libjpeg libpng libsamplerate libsndfile libtiff
|
||||||
|
opencolorio openexr openimagedenoise openimageio2 openjpeg python zlib zstd fftw jemalloc
|
||||||
|
alembic
|
||||||
|
(opensubdiv.override { inherit cudaSupport; })
|
||||||
|
tbb
|
||||||
|
embree
|
||||||
|
gmp
|
||||||
|
pugixml
|
||||||
|
potrace
|
||||||
|
libharu
|
||||||
|
libepoxy
|
||||||
|
brotli
|
||||||
|
]
|
||||||
|
++ (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
|
||||||
|
])
|
||||||
|
++ optional jackaudioSupport libjack2
|
||||||
|
++ optional cudaSupport cudaPackages.cudatoolkit
|
||||||
|
++ optional colladaSupport opencollada
|
||||||
|
++ optional spaceNavSupport libspnav;
|
||||||
|
pythonPath = with python310Packages; [ numpy requests ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# allow usage of dynamically linked embree
|
||||||
|
rm build_files/cmake/Modules/FindEmbree.cmake
|
||||||
|
'' +
|
||||||
|
(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"'
|
||||||
|
'') +
|
||||||
|
(if hipSupport then ''
|
||||||
|
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}"
|
||||||
|
"-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_OPENVDB=ON"
|
||||||
|
"-DWITH_TBB=ON"
|
||||||
|
"-DWITH_IMAGE_OPENJPEG=ON"
|
||||||
|
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
|
||||||
|
]
|
||||||
|
++ 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 [
|
||||||
|
"-DWITH_CYCLES_CUDA_BINARIES=ON"
|
||||||
|
"-DWITH_CYCLES_DEVICE_OPTIX=ON"
|
||||||
|
"-DOPTIX_ROOT_DIR=${optix}"
|
||||||
|
];
|
||||||
|
|
||||||
|
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";
|
||||||
|
|
||||||
|
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
|
||||||
|
'' + ''
|
||||||
|
buildPythonPath "$pythonPath"
|
||||||
|
wrapProgram $blenderExecutable \
|
||||||
|
--prefix PATH : $program_PATH \
|
||||||
|
--prefix PYTHONPATH : "$program_PYTHONPATH" \
|
||||||
|
--add-flags '--python-use-system-env'
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Set RUNPATH so that libcuda and libnvrtc in /run/opengl-driver(-32)/lib can be
|
||||||
|
# found. See the explanation in libglvnd.
|
||||||
|
postFixup = optionalString cudaSupport ''
|
||||||
|
for program in $out/bin/blender $out/bin/.blender-wrapped; do
|
||||||
|
isELF "$program" || continue
|
||||||
|
addOpenGLRunpath "$program"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "3D Creation/Animation/Publishing System";
|
||||||
|
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" "x86_64-darwin" ];
|
||||||
|
maintainers = with maintainers; [ goibhniu veprbl ];
|
||||||
|
};
|
||||||
|
}
|
12
pkgs/misc/blender/fix-include.patch
Normal file
12
pkgs/misc/blender/fix-include.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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
|
1863
pkgs/misc/blender/wrapper.nix
Normal file
1863
pkgs/misc/blender/wrapper.nix
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue