2021-02-05 17:12:51 +00:00
|
|
|
{ clangStdenv, lib, fetchFromGitHub, cmake, zlib, openexr,
|
2020-04-24 23:36:52 +00:00
|
|
|
openimageio, llvm, boost165, flex, bison, partio, pugixml,
|
2021-08-05 21:33:18 +00:00
|
|
|
util-linux, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let boost_static = boost165.override { enableStatic = true; };
|
|
|
|
in clangStdenv.mkDerivation rec {
|
|
|
|
# In theory this could use GCC + Clang rather than just Clang,
|
|
|
|
# but https://github.com/NixOS/nixpkgs/issues/29877 stops this
|
2022-03-10 19:12:11 +00:00
|
|
|
pname = "openshadinglanguage";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "1.10.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "imageworks";
|
|
|
|
repo = "OpenShadingLanguage";
|
|
|
|
rev = "Release-1.10.9";
|
|
|
|
sha256 = "1dwf10f2fpxc55pymwkapql20nc462mq61hv21c527994c2qp1ll";
|
|
|
|
};
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_BOOST_WAVE=ON"
|
|
|
|
"-DENABLERTTI=ON"
|
|
|
|
|
|
|
|
# Build system implies llvm-config and llvm-as are in the same directory.
|
|
|
|
# Override defaults.
|
|
|
|
"-DLLVM_DIRECTORY=${llvm}"
|
|
|
|
"-DLLVM_CONFIG=${llvm.dev}/bin/llvm-config"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preConfigure = "patchShebangs src/liboslexec/serialize-bc.bash ";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake boost_static flex bison];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-01-15 22:18:51 +00:00
|
|
|
zlib openexr openimageio llvm
|
|
|
|
partio pugixml
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux # needed just for hexdump
|
2021-08-05 21:33:18 +00:00
|
|
|
python3 # CMake doesn't check this?
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
# TODO: How important is partio? CMake doesn't seem to find it
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Advanced shading language for production GI renderers";
|
|
|
|
homepage = "http://opensource.imageworks.com/?p=osl";
|
|
|
|
maintainers = with maintainers; [ hodapp ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|