nixpkgs/pkgs/development/libraries/embree/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

42 lines
1.4 KiB
Nix

{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, ispc, tbb, glfw,
openimageio, libjpeg, libpng, libpthreadstubs, libX11, glib }:
stdenv.mkDerivation rec {
pname = "embree";
version = "3.12.1";
src = fetchFromGitHub {
owner = "embree";
repo = "embree";
rev = "v${version}";
sha256 = "0aznd16n7h8g3f6jcahzfp1dq4r7wayqvn03wsaskiq2dvsi4srd";
};
postPatch = ''
# Fix duplicate /nix/store/.../nix/store/.../ paths
sed -i "s|SET(EMBREE_ROOT_DIR .*)|set(EMBREE_ROOT_DIR $out)|" \
common/cmake/embree-config.cmake
sed -i "s|$""{EMBREE_ROOT_DIR}/||" common/cmake/embree-config.cmake
substituteInPlace common/math/math.h --replace 'defined(__MACOSX__) && !defined(__INTEL_COMPILER)' 0
substituteInPlace common/math/math.h --replace 'defined(__WIN32__) || defined(__FreeBSD__)' 'defined(__WIN32__) || defined(__FreeBSD__) || defined(__MACOSX__)'
'';
cmakeFlags = [
"-DEMBREE_TUTORIALS=OFF"
"-DEMBREE_RAY_MASK=ON"
];
nativeBuildInputs = [ ispc pkg-config cmake ];
buildInputs = [ tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ]
++ lib.optionals stdenv.isDarwin [ glib ];
meta = with stdenv.lib; {
description = "High performance ray tracing kernels from Intel";
homepage = "https://embree.github.io/";
maintainers = with maintainers; [ hodapp gebner ];
license = licenses.asl20;
platforms = platforms.unix;
};
}