1 { stdenv, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, ispc, tbb, glfw,
2 openimageio, libjpeg, libpng, libpthreadstubs, libX11, glib }:
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
12 sha256 = "sha256-tfM4SGOFVBG0pQK9B/iN2xDaW3yjefnTtsoUad75m80=";
17 name = "fixed-compilation-issues-for-arm-aarch64-processor-under-linux.patch";
18 url = "https://github.com/embree/embree/commit/82ca6b5ccb7abe0403a658a0e079926478f04cb1.patch";
19 hash = "sha256-l9S4PBk+yQUypQ22l05daD0ruouZKE4VHkGvzKxkH4o=";
24 # Fix duplicate /nix/store/.../nix/store/.../ paths
25 sed -i "s|SET(EMBREE_ROOT_DIR .*)|set(EMBREE_ROOT_DIR $out)|" \
26 common/cmake/embree-config.cmake
27 sed -i "s|$""{EMBREE_ROOT_DIR}/||" common/cmake/embree-config.cmake
28 substituteInPlace common/math/math.h --replace 'defined(__MACOSX__) && !defined(__INTEL_COMPILER)' 0
29 substituteInPlace common/math/math.h --replace 'defined(__WIN32__) || defined(__FreeBSD__)' 'defined(__WIN32__) || defined(__FreeBSD__) || defined(__MACOSX__)'
33 "-DEMBREE_TUTORIALS=OFF"
34 "-DEMBREE_RAY_MASK=ON"
36 "-DTBB_INCLUDE_DIR=${tbb.dev}/include"
39 nativeBuildInputs = [ ispc pkg-config cmake ];
40 buildInputs = [ tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ]
41 ++ lib.optionals stdenv.isDarwin [ glib ];
44 description = "High performance ray tracing kernels from Intel";
45 homepage = "https://embree.github.io/";
46 maintainers = with maintainers; [ hodapp gebner ];
47 license = licenses.asl20;
48 platforms = platforms.unix;