2020-12-31 07:48:55 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, boost165, pkg-config, python36
|
2018-06-20 15:44:40 +01:00
|
|
|
, tbb, openimageio, libjpeg, libpng, zlib, libtiff, ilmbase
|
|
|
|
, freetype, openexr, libXdmcp, libxkbcommon, epoxy, at-spi2-core
|
2019-11-30 23:11:47 +00:00
|
|
|
, dbus, doxygen, qt5, c-blosc, libGLU, gnome3, dconf, gtk3, pcre
|
2018-06-20 15:44:40 +01:00
|
|
|
, bison, flex, libpthreadstubs, libX11
|
2018-07-17 21:11:16 +01:00
|
|
|
, embree2, makeWrapper, gsettings-desktop-schemas, glib
|
2020-12-31 15:01:21 +00:00
|
|
|
, withOpenCL ? true , opencl-headers, ocl-icd, opencl-clhpp, rocm-opencl-runtime
|
2018-06-20 15:44:40 +01:00
|
|
|
}:
|
|
|
|
|
2020-06-07 18:38:50 +01:00
|
|
|
let
|
|
|
|
python = python36;
|
|
|
|
|
|
|
|
boost_static = boost165.override {
|
|
|
|
inherit python;
|
2018-06-20 15:44:40 +01:00
|
|
|
enableStatic = true;
|
2018-07-04 03:55:51 +01:00
|
|
|
enablePython = true;
|
2018-06-20 15:44:40 +01:00
|
|
|
};
|
|
|
|
|
2020-06-07 18:38:50 +01:00
|
|
|
version = "2.0";
|
|
|
|
sha256 = "15nn39ybsfjf3cw3xgkbarvxn4a9ymfd579ankm7yjxkw5gcif38";
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "luxcorerender";
|
2020-06-07 18:38:50 +01:00
|
|
|
inherit version;
|
2018-06-20 15:44:40 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LuxCoreRender";
|
|
|
|
repo = "LuxCore";
|
2020-06-07 18:38:50 +01:00
|
|
|
rev = "luxcorerender_v${version}";
|
|
|
|
inherit sha256;
|
2018-06-20 15:44:40 +01:00
|
|
|
};
|
|
|
|
|
2020-12-31 07:48:55 +00:00
|
|
|
nativeBuildInputs = [ cmake flex bison doxygen makeWrapper pkg-config ];
|
2020-12-31 15:01:21 +00:00
|
|
|
buildInputs = [
|
|
|
|
embree2 zlib boost_static libjpeg
|
|
|
|
libtiff libpng ilmbase freetype openexr openimageio
|
2021-01-07 12:04:31 +00:00
|
|
|
tbb qt5.full c-blosc libGLU pcre
|
|
|
|
libX11 libpthreadstubs python libXdmcp libxkbcommon
|
|
|
|
epoxy at-spi2-core dbus
|
2020-12-31 15:01:21 +00:00
|
|
|
# needed for GSETTINGS_SCHEMAS_PATH
|
|
|
|
gsettings-desktop-schemas glib gtk3
|
|
|
|
# needed for XDG_ICON_DIRS
|
|
|
|
gnome3.adwaita-icon-theme
|
|
|
|
(stdenv.lib.getLib dconf)
|
2021-01-07 12:04:31 +00:00
|
|
|
] ++ stdenv.lib.optionals withOpenCL [ opencl-headers ocl-icd opencl-clhpp rocm-opencl-runtime ];
|
2018-06-20 15:44:40 +01:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DOpenEXR_Iex_INCLUDE_DIR=${openexr.dev}/include/OpenEXR"
|
|
|
|
"-DOpenEXR_IlmThread_INCLUDE_DIR=${ilmbase.dev}/include/OpenEXR"
|
|
|
|
"-DOpenEXR_Imath_INCLUDE_DIR=${openexr.dev}/include/OpenEXR"
|
|
|
|
"-DOpenEXR_half_INCLUDE_DIR=${ilmbase.dev}/include"
|
2020-06-07 18:38:50 +01:00
|
|
|
"-DPYTHON_LIBRARY=${python}/lib/libpython3.so"
|
|
|
|
"-DPYTHON_INCLUDE_DIR=${python}/include/python${python.pythonVersion}"
|
2018-06-20 15:44:40 +01:00
|
|
|
"-DEMBREE_INCLUDE_PATH=${embree2}/include"
|
|
|
|
"-DEMBREE_LIBRARY=${embree2}/lib/libembree.so"
|
|
|
|
"-DBoost_PYTHON_LIBRARY_RELEASE=${boost_static}/lib/libboost_python3-mt.so"
|
|
|
|
] ++ stdenv.lib.optional withOpenCL
|
2020-12-31 15:01:21 +00:00
|
|
|
"-DOPENCL_INCLUDE_DIR=${opencl-headers}/include";
|
|
|
|
|
2018-06-20 15:44:40 +01:00
|
|
|
preConfigure = ''
|
2020-06-07 18:38:50 +01:00
|
|
|
NIX_CFLAGS_COMPILE+=" -isystem ${python}/include/python${python.pythonVersion}"
|
2018-06-20 15:44:40 +01:00
|
|
|
NIX_LDFLAGS+=" -lpython3"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp -va bin/* $out/bin
|
|
|
|
cp -va lib/* $out/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapProgram "$out/bin/luxcoreui" \
|
|
|
|
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
|
2019-02-13 21:47:50 +00:00
|
|
|
--suffix XDG_DATA_DIRS : '${gnome3.adwaita-icon-theme}/share' \
|
2019-11-30 23:11:47 +00:00
|
|
|
--prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules"
|
2018-06-20 15:44:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open source, physically based, unbiased rendering engine";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://luxcorerender.org/";
|
2018-06-20 15:44:40 +01: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
|