Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.5 kB · 91 lines
Nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192{ lib, stdenv, fetchFromGitHub, cmake, python3, autoSignDarwinBinariesHook, cctools,}:# Like many google projects, shaderc doesn't gracefully support separately# compiled dependencies, so we can't easily use the versions of glslang and# spirv-tools used by vulkan-loader. Exact revisions are taken from# https://github.com/google/shaderc/blob/known-good/known_good.json
# Future work: extract and fetch all revisions automatically based on a revision# of shaderc's known-good branch.let glslang = fetchFromGitHub { owner = "KhronosGroup"; repo = "glslang"; rev = "15.3.0"; hash = "sha256-HwFP4KJuA+BMQVvBWV0BCRj9U5I3CLEU+5bBtde2f6w="; }; spirv-tools = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Tools"; rev = "v2025.1"; hash = "sha256-2Wv0dxVQ8NvuDRTcsXkH1GKmuA6lsIuwTl0j6kbTefo="; }; spirv-headers = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-Headers"; rev = "vulkan-sdk-1.4.309.0"; hash = "sha256-Q1i6i5XimULuGufP6mimwDW674anAETUiIEvDQwvg5Y="; };instdenv.mkDerivation (finalAttrs: { pname = "shaderc"; version = "2025.2";
outputs = [ "out" "lib" "bin" "dev" "static" ];
src = fetchFromGitHub { owner = "google"; repo = "shaderc"; rev = "v${finalAttrs.version}"; hash = "sha256-u3gmH2lrkwBTZg9j4jInQceXK4MUWhKZPSPsN98mEkk="; };
postPatch = '' cp -r --no-preserve=mode ${glslang} third_party/glslang cp -r --no-preserve=mode ${spirv-tools} third_party/spirv-tools ln -s ${spirv-headers} third_party/spirv-tools/external/spirv-headers patchShebangs --build utils/ '';
nativeBuildInputs = [ cmake python3 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook ];
postInstall = '' moveToOutput "lib/*.a" $static '';
cmakeFlags = [ "-DSHADERC_SKIP_TESTS=ON" ];
# Fix the paths in .pc, even though it's unclear if all these .pc are really useful. postFixup = '' substituteInPlace "$dev"/lib/pkgconfig/*.pc \ --replace-fail '=''${prefix}//' '=/' \ --replace-fail "$dev/$dev/" "$dev/" '';
meta = { description = "Collection of tools, libraries and tests for shader compilation"; inherit (finalAttrs.src.meta) homepage; license = lib.licenses.asl20; platforms = lib.platforms.all; };})