10 stdenv.mkDerivation rec {
14 src = fetchFromGitHub {
15 owner = "KhronosGroup";
18 hash = "sha256-QXNecJ6SDeWpRjzHRTdPJHob1H3q2HZmWuL2zBt2Tlw=";
21 outputs = [ "bin" "out" "dev" ];
23 # These get set at all-packages, keep onto them for child drvs
25 spirv-tools = spirv-tools;
26 spirv-headers = spirv-headers;
29 nativeBuildInputs = [ cmake python3 bison jq ];
31 cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
34 cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
35 ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers
38 # This is a dirty fix for lib/cmake/SPIRVTargets.cmake:51 which includes this directory
40 mkdir -p $dev/include/External
41 moveToOutput lib/pkgconfig "''${!outputDev}"
42 moveToOutput lib/cmake "''${!outputDev}"
45 # Fix the paths in .pc, even though it's unclear if these .pc are really useful.
47 substituteInPlace $dev/lib/pkgconfig/*.pc \
48 --replace-fail '=''${prefix}//' '=/' \
49 --replace-fail "includedir=$dev/$dev" "includedir=$dev"
51 # add a symlink for backwards compatibility
52 ln -s $bin/bin/glslang $bin/bin/glslangValidator
56 inherit (src.meta) homepage;
57 description = "Khronos reference front-end for GLSL and ESSL";
58 license = licenses.asl20;
59 platforms = platforms.unix;
60 maintainers = [ maintainers.ralith ];