2021-02-06 18:44:49 +01:00
|
|
|
{ lib, config, stdenv, fetchFromGitHub, symlinkJoin, wrapGAppsHook, cmake, boost172
|
|
|
|
, pkg-config, flex, bison, libpng, libtiff, zlib, python3, embree, openexr
|
|
|
|
, openimagedenoise, openimageio, tbb, c-blosc, gtk3, pcre, doxygen
|
|
|
|
# OpenCL Support
|
|
|
|
, withOpenCL ? true, ocl-icd
|
|
|
|
# Cuda Support
|
|
|
|
, withCuda ? config.cudaSupport or false, cudatoolkit }:
|
2018-06-20 16:44:40 +02:00
|
|
|
|
2020-06-07 19:38:50 +02:00
|
|
|
let
|
2021-02-06 18:44:49 +01:00
|
|
|
boostWithPython = boost172.override {
|
|
|
|
enablePython = true;
|
|
|
|
enableNumpy = true;
|
|
|
|
python = python3;
|
|
|
|
};
|
2018-06-20 16:44:40 +02:00
|
|
|
|
2021-02-06 18:44:49 +01:00
|
|
|
# Requires a version number like "<MAJOR><MINOR>"
|
|
|
|
pythonVersion = (lib.versions.major python3.version)
|
|
|
|
+ (lib.versions.minor python3.version);
|
2020-06-07 19:38:50 +02:00
|
|
|
|
2021-02-06 18:44:49 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "luxcorerender";
|
2021-02-06 18:44:49 +01:00
|
|
|
version = "2.4";
|
2018-06-20 16:44:40 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LuxCoreRender";
|
|
|
|
repo = "LuxCore";
|
2020-06-07 19:38:50 +02:00
|
|
|
rev = "luxcorerender_v${version}";
|
2021-02-06 18:44:49 +01:00
|
|
|
sha256 = "0xvivw79719fa1q762b76nyvzawfd3hmp8y5j04bax8a7f8mfa9k";
|
2018-06-20 16:44:40 +02:00
|
|
|
};
|
|
|
|
|
2021-02-06 18:44:49 +01:00
|
|
|
nativeBuildInputs = [ pkg-config cmake flex bison doxygen wrapGAppsHook ];
|
|
|
|
|
2020-12-31 16:01:21 +01:00
|
|
|
buildInputs = [
|
2021-02-06 18:44:49 +01:00
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
zlib
|
|
|
|
boostWithPython.dev
|
|
|
|
python3
|
|
|
|
embree
|
|
|
|
openexr
|
|
|
|
openimagedenoise
|
|
|
|
tbb
|
|
|
|
c-blosc
|
|
|
|
gtk3
|
|
|
|
pcre
|
|
|
|
openimageio.dev
|
|
|
|
openimageio.out
|
|
|
|
] ++ lib.optionals withOpenCL [ ocl-icd ]
|
|
|
|
++ lib.optionals withCuda [ cudatoolkit ];
|
2018-06-20 16:44:40 +02:00
|
|
|
|
2021-02-06 18:44:49 +01:00
|
|
|
cmakeFlags = [ "-DPYTHON_V=${pythonVersion}" ]
|
|
|
|
++ lib.optional (!withOpenCL) "-DLUXRAYS_DISABLE_OPENCL=1"
|
|
|
|
++ lib.optional (!withCuda) "-DLUXRAYS_DISABLE_CUDA=1";
|
2020-12-31 16:01:21 +01:00
|
|
|
|
2018-06-20 16:44:40 +02:00
|
|
|
preConfigure = ''
|
|
|
|
NIX_LDFLAGS+=" -lpython3"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -va bin/* $out/bin
|
|
|
|
cp -va lib/* $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-06-20 16:44:40 +02:00
|
|
|
description = "Open source, physically based, unbiased rendering engine";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://luxcorerender.org/";
|
2018-06-20 16:44:40 +02:00
|
|
|
maintainers = with maintainers; [ hodapp ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# TODO (might not be necessary):
|
|
|
|
#
|
|
|
|
# luxcoreui still gives warnings like: "failed to commit changes to
|
|
|
|
# dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The
|
|
|
|
# name ca.desrt.dconf was not provided by any .service files"
|
|
|
|
|
|
|
|
# CMake complains of the FindOpenGL/GLVND preference
|