Files
nixpkgs/pkgs/development/compilers/osl/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

95 lines
1.8 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
cmake,
clang,
libclang,
libxml2,
zlib,
openexr,
openimageio,
llvm,
boost,
flex,
bison,
partio,
pugixml,
robin-map,
util-linux,
python3,
}:
let
boost_static = boost.override { enableStatic = true; };
in
stdenv.mkDerivation (finalAttrs: {
pname = "openshadinglanguage";
version = "1.14.7.0";
src = fetchFromGitHub {
owner = "AcademySoftwareFoundation";
repo = "OpenShadingLanguage";
rev = "v${finalAttrs.version}";
hash = "sha256-w78x0e9T0lYCAPDPkx6T/4TzAs/mpJ/24uQ+yH5gB5I=";
};
cmakeFlags = [
"-DBoost_ROOT=${boost}"
"-DUSE_BOOST_WAVE=ON"
"-DENABLE_RTTI=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"
"-DLLVM_BC_GENERATOR=${clang}/bin/clang++"
];
prePatch = ''
substituteInPlace src/cmake/modules/FindLLVM.cmake \
--replace-fail "NO_DEFAULT_PATH" ""
'';
preConfigure = ''
patchShebangs src/liboslexec/serialize-bc.bash
'';
nativeBuildInputs = [
bison
clang
cmake
flex
];
buildInputs = [
boost_static
libclang
llvm
openexr
openimageio
partio
pugixml
python3.pkgs.pybind11
robin-map
util-linux # needed just for hexdump
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libxml2
];
postFixup = ''
substituteInPlace "$out"/lib/pkgconfig/*.pc \
--replace '=''${exec_prefix}//' '=/'
'';
meta = {
description = "Advanced shading language for production GI renderers";
homepage = "https://opensource.imageworks.com/osl.html";
maintainers = with lib.maintainers; [ hodapp ];
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
};
})