2022-08-21 13:32:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, clang
|
|
|
|
, libclang
|
|
|
|
, zlib
|
|
|
|
, openexr
|
2023-01-11 07:51:40 +00:00
|
|
|
, openimageio
|
2022-08-21 13:32:41 +00:00
|
|
|
, llvm
|
|
|
|
, boost
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, partio
|
|
|
|
, pugixml
|
|
|
|
, util-linux
|
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
boost_static = boost.override { enableStatic = true; };
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2022-03-10 19:12:11 +00:00
|
|
|
pname = "openshadinglanguage";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "1.11.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-08-21 13:32:41 +00:00
|
|
|
owner = "AcademySoftwareFoundation";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "OpenShadingLanguage";
|
2022-08-21 13:32:41 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-2OOkLnHLz+vmSeEDQl12SrJBTuWwbnvoTatnvm8lpbA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-26 12:46:18 +00:00
|
|
|
cmakeFlags = [
|
2023-01-11 07:51:40 +00:00
|
|
|
"-DBoost_ROOT=${boost}"
|
2021-09-26 12:46:18 +00:00
|
|
|
"-DUSE_BOOST_WAVE=ON"
|
2022-08-21 13:32:41 +00:00
|
|
|
"-DENABLE_RTTI=ON"
|
2021-09-26 12:46:18 +00:00
|
|
|
|
|
|
|
# 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"
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
# Set C++11 to C++14 required for LLVM10+
|
|
|
|
"-DCMAKE_CXX_STANDARD=14"
|
2021-09-26 12:46:18 +00:00
|
|
|
];
|
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
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
clang
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
boost_static
|
|
|
|
libclang
|
|
|
|
llvm
|
|
|
|
openexr
|
2023-01-11 07:51:40 +00:00
|
|
|
openimageio
|
2022-08-21 13:32:41 +00:00
|
|
|
partio
|
|
|
|
pugixml
|
|
|
|
python3.pkgs.pybind11
|
|
|
|
util-linux # needed just for hexdump
|
|
|
|
zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace "$out"/lib/pkgconfig/*.pc \
|
|
|
|
--replace '=''${exec_prefix}//' '=/'
|
|
|
|
'';
|
|
|
|
|
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";
|
2022-08-21 13:32:41 +00:00
|
|
|
homepage = "https://opensource.imageworks.com/osl.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ hodapp ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|