luxcorerender: 2.0 -> 2.4 (#101413)

This commit is contained in:
Jonas Meurer 2021-02-06 18:44:49 +01:00 committed by GitHub
parent 75156546fc
commit c7fef40d4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 55 deletions

View file

@ -1,64 +1,58 @@
{ lib, stdenv, fetchFromGitHub, cmake, boost165, pkg-config, python36 { lib, config, stdenv, fetchFromGitHub, symlinkJoin, wrapGAppsHook, cmake, boost172
, tbb, openimageio, libjpeg, libpng, zlib, libtiff, ilmbase , pkg-config, flex, bison, libpng, libtiff, zlib, python3, embree, openexr
, freetype, openexr, libXdmcp, libxkbcommon, epoxy, at-spi2-core , openimagedenoise, openimageio, tbb, c-blosc, gtk3, pcre, doxygen
, dbus, doxygen, qt5, c-blosc, libGLU, gnome3, dconf, gtk3, pcre # OpenCL Support
, bison, flex, libpthreadstubs, libX11 , withOpenCL ? true, ocl-icd
, embree2, makeWrapper, gsettings-desktop-schemas, glib # Cuda Support
, withOpenCL ? true , opencl-headers, ocl-icd, opencl-clhpp, rocm-opencl-runtime , withCuda ? config.cudaSupport or false, cudatoolkit }:
}:
let let
python = python36; boostWithPython = boost172.override {
enablePython = true;
enableNumpy = true;
python = python3;
};
boost_static = boost165.override { # Requires a version number like "<MAJOR><MINOR>"
inherit python; pythonVersion = (lib.versions.major python3.version)
enableStatic = true; + (lib.versions.minor python3.version);
enablePython = true;
};
version = "2.0"; in stdenv.mkDerivation rec {
sha256 = "15nn39ybsfjf3cw3xgkbarvxn4a9ymfd579ankm7yjxkw5gcif38";
in stdenv.mkDerivation {
pname = "luxcorerender"; pname = "luxcorerender";
inherit version; version = "2.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "LuxCoreRender"; owner = "LuxCoreRender";
repo = "LuxCore"; repo = "LuxCore";
rev = "luxcorerender_v${version}"; rev = "luxcorerender_v${version}";
inherit sha256; sha256 = "0xvivw79719fa1q762b76nyvzawfd3hmp8y5j04bax8a7f8mfa9k";
}; };
nativeBuildInputs = [ cmake flex bison doxygen makeWrapper pkg-config ]; nativeBuildInputs = [ pkg-config cmake flex bison doxygen wrapGAppsHook ];
buildInputs = [
embree2 zlib boost_static libjpeg
libtiff libpng ilmbase freetype openexr openimageio
tbb qt5.full c-blosc libGLU pcre
libX11 libpthreadstubs python libXdmcp libxkbcommon
epoxy at-spi2-core dbus
# needed for GSETTINGS_SCHEMAS_PATH
gsettings-desktop-schemas glib gtk3
# needed for XDG_ICON_DIRS
gnome3.adwaita-icon-theme
(lib.getLib dconf)
] ++ lib.optionals withOpenCL [ opencl-headers ocl-icd opencl-clhpp rocm-opencl-runtime ];
cmakeFlags = [ buildInputs = [
"-DOpenEXR_Iex_INCLUDE_DIR=${openexr.dev}/include/OpenEXR" libpng
"-DOpenEXR_IlmThread_INCLUDE_DIR=${ilmbase.dev}/include/OpenEXR" libtiff
"-DOpenEXR_Imath_INCLUDE_DIR=${openexr.dev}/include/OpenEXR" zlib
"-DOpenEXR_half_INCLUDE_DIR=${ilmbase.dev}/include" boostWithPython.dev
"-DPYTHON_LIBRARY=${python}/lib/libpython3.so" python3
"-DPYTHON_INCLUDE_DIR=${python}/include/python${python.pythonVersion}" embree
"-DEMBREE_INCLUDE_PATH=${embree2}/include" openexr
"-DEMBREE_LIBRARY=${embree2}/lib/libembree.so" openimagedenoise
"-DBoost_PYTHON_LIBRARY_RELEASE=${boost_static}/lib/libboost_python3-mt.so" tbb
] ++ lib.optional withOpenCL c-blosc
"-DOPENCL_INCLUDE_DIR=${opencl-headers}/include"; gtk3
pcre
openimageio.dev
openimageio.out
] ++ lib.optionals withOpenCL [ ocl-icd ]
++ lib.optionals withCuda [ cudatoolkit ];
cmakeFlags = [ "-DPYTHON_V=${pythonVersion}" ]
++ lib.optional (!withOpenCL) "-DLUXRAYS_DISABLE_OPENCL=1"
++ lib.optional (!withCuda) "-DLUXRAYS_DISABLE_CUDA=1";
preConfigure = '' preConfigure = ''
NIX_CFLAGS_COMPILE+=" -isystem ${python}/include/python${python.pythonVersion}"
NIX_LDFLAGS+=" -lpython3" NIX_LDFLAGS+=" -lpython3"
''; '';
@ -69,13 +63,6 @@ in stdenv.mkDerivation {
cp -va lib/* $out/lib cp -va lib/* $out/lib
''; '';
preFixup = ''
wrapProgram "$out/bin/luxcoreui" \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
--suffix XDG_DATA_DIRS : '${gnome3.adwaita-icon-theme}/share' \
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
'';
meta = with lib; { meta = with lib; {
description = "Open source, physically based, unbiased rendering engine"; description = "Open source, physically based, unbiased rendering engine";
homepage = "https://luxcorerender.org/"; homepage = "https://luxcorerender.org/";
@ -85,7 +72,6 @@ in stdenv.mkDerivation {
}; };
} }
# TODO (might not be necessary): # TODO (might not be necessary):
# #
# luxcoreui still gives warnings like: "failed to commit changes to # luxcoreui still gives warnings like: "failed to commit changes to

View file

@ -6052,7 +6052,7 @@ in
lzip = callPackage ../tools/compression/lzip { }; lzip = callPackage ../tools/compression/lzip { };
luxcorerender = callPackage ../tools/graphics/luxcorerender { qt5 = qt514; }; luxcorerender = callPackage ../tools/graphics/luxcorerender { };
xz = callPackage ../tools/compression/xz { }; xz = callPackage ../tools/compression/xz { };
lzma = xz; # TODO: move to aliases.nix lzma = xz; # TODO: move to aliases.nix