2022-08-21 13:32:41 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, clang
|
|
|
|
, libclang
|
2023-07-15 17:15:38 +00:00
|
|
|
, libxml2
|
2022-08-21 13:32:41 +00:00
|
|
|
, 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";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.13.8.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}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-AixN3cj6r/PUGvAhVN4wGfpuLiBt5LglgJp68hFfJMo=";
|
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"
|
2023-04-29 16:46:19 +00:00
|
|
|
"-DLLVM_BC_GENERATOR=${clang}/bin/clang++"
|
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
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
libxml2
|
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;
|
2023-07-15 17:15:38 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|