-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package request: slang #359925
Comments
I've tried my hand at this and it's not a particularly hard build if you use vendored dependencies, but let's try to avoid doing that in Nixpkgs if possible. Right now I've figured out how to de-vendor miniz and lz4, though Regarding #359938 (@ArchercatNEO), I think something like My partial derivation: {
lib,
llvmPackages_13,
fetchFromGitHub,
cmake,
ninja,
pkg-config,
python3,
tree,
libllvm,
miniz,
lz4,
vulkan-headers,
spirv-headers,
xorg,
enableCUDA ? false,
}:
let
inherit (llvmPackages_13) stdenv;
lz4-static = lz4.overrideAttrs (prev: {
outputs = ["out"];
cmakeFlags = (prev.cmakeFlags or []) ++ [
(lib.cmakeBool "LZ4_BUNDLED_MODE" true)
];
installPhase = ''
runHook preInstall
install -D liblz4.a $out/lib/liblz4_static.a
runHook postInstall
'';
});
in
stdenv.mkDerivation (finalAttrs: {
pname = "slang";
version = "2024.14.6";
src = fetchFromGitHub {
owner = "shader-slang";
repo = "slang";
rev = "refs/tags/v${finalAttrs.version}";
# hash = "sha256-ynq1YGgXD9f6+/lJSt4kFfs2N4QfzoyHOBbMT+4Flt4=";
# TODO: fix this
hash = "sha256-q/FR7CA3FddbHBmINOqQqfmOhlusswv3femKFax2AnM=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
ninja
pkg-config
python3
# llvmPackages_13.lld
];
buildInputs = [
llvmPackages_13.libllvm
llvmPackages_13.libclang
miniz
lz4.dev
lz4-static
vulkan-headers
spirv-headers
# TODO: nvcc, OptiX, NVAPI, Aftermath
] ++ lib.optional stdenv.hostPlatform.isLinux xorg.libX11;
cmakeFlags = [
(lib.cmakeFeature "SLANG_VERSION_FULL" "${finalAttrs.version}")
(lib.cmakeFeature "SLANG_SLANG_LLVM_FLAVOR" "USE_SYSTEM_LLVM")
# (lib.cmakeBool "SLANG_USE_SYSTEM_UNORDERED_DENSE" true)
(lib.cmakeBool "SLANG_USE_SYSTEM_MINIZ" true)
(lib.cmakeBool "SLANG_USE_SYSTEM_LZ4" true)
# (lib.cmakeBool "SLANG_USE_SYSTEM_VULKAN_HEADERS" true) # Wants to link against Vulkan-Headers
# (lib.cmakeBool "SLANG_USE_SYSTEM_SPIRV_HEADERS" true) # Missing Cmake
(lib.cmakeFeature "SLANG_SPIRV_HEADERS_INCLUDE_DIR" "${spirv-headers}/include")
];
env.NIX_CFLAGS_COMPILE = toString [
"-I${miniz}/include/miniz"
];
}) |
Interesting, though I can’t find nvcc with nix-locate as of now, optix requires that, nvapi is (apparently) windows-only and I didn’t look for aftermath. This definitely seems like a drv that’s better made than mine though so congrats on that. |
See #358202 |
Project description
Slang is a shading language now maintained by khronos intended to make shader programming easier and more maintainable.
slangc
is the official compiler for the language.Metadata
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: