1{ clangStdenv, lib, fetchFromGitHub, cmake, zlib, openexr,
2openimageio, llvm, boost165, flex, bison, partio, pugixml,
3util-linux, python3
4}:
5
6let boost_static = boost165.override { enableStatic = true; };
7in clangStdenv.mkDerivation rec {
8 # In theory this could use GCC + Clang rather than just Clang,
9 # but https://github.com/NixOS/nixpkgs/issues/29877 stops this
10 name = "openshadinglanguage-${version}";
11 version = "1.10.9";
12
13 src = fetchFromGitHub {
14 owner = "imageworks";
15 repo = "OpenShadingLanguage";
16 rev = "Release-1.10.9";
17 sha256 = "1dwf10f2fpxc55pymwkapql20nc462mq61hv21c527994c2qp1ll";
18 };
19
20 cmakeFlags = [
21 "-DUSE_BOOST_WAVE=ON"
22 "-DENABLERTTI=ON"
23
24 # Build system implies llvm-config and llvm-as are in the same directory.
25 # Override defaults.
26 "-DLLVM_DIRECTORY=${llvm}"
27 "-DLLVM_CONFIG=${llvm.dev}/bin/llvm-config"
28 ];
29
30 preConfigure = "patchShebangs src/liboslexec/serialize-bc.bash ";
31
32 nativeBuildInputs = [ cmake boost_static flex bison];
33 buildInputs = [
34 zlib openexr openimageio llvm
35 partio pugixml
36 util-linux # needed just for hexdump
37 python3 # CMake doesn't check this?
38 ];
39 # TODO: How important is partio? CMake doesn't seem to find it
40 meta = with lib; {
41 description = "Advanced shading language for production GI renderers";
42 homepage = "http://opensource.imageworks.com/?p=osl";
43 maintainers = with maintainers; [ hodapp ];
44 license = licenses.bsd3;
45 platforms = platforms.linux;
46 };
47}