10 stdenv.mkDerivation rec {
11 pname = "swiftshader";
12 version = "2023-09-11";
15 url = "https://swiftshader.googlesource.com/SwiftShader";
16 rev = "4e40d502c440cc59b25fa3a5fee0eadbab7442aa";
17 hash = "sha256-YtbTaOkFhVMKdu3jiRHQsPmoEu3KDzIQXLZ5HFBSmWI=";
18 # Remove 1GB of test files to get under Hydra output limit
20 rm -r $out/third_party/llvm-project/llvm/test
21 rm -r $out/third_party/json/test
22 rm -r $out/third_party/cppdap/third_party/json/test
23 rm -r $out/third_party/llvm-project/clang/test
33 # Make sure we include the drivers and icd files in the output as the cmake
34 # generated install command only puts in the spirv-tools stuff.
41 vk_so_path="$out/lib/libvk_swiftshader.so"
42 mkdir -p "$(dirname "$vk_so_path")"
43 mv Linux/libvk_swiftshader.so "$vk_so_path"
45 vk_icd_json="$out/share/vulkan/icd.d/vk_swiftshader_icd.json"
46 mkdir -p "$(dirname "$vk_icd_json")"
47 jq ".ICD.library_path = \"$vk_so_path\"" <Linux/vk_swiftshader_icd.json >"$vk_icd_json"
53 description = "A high-performance CPU-based implementation of the Vulkan 1.3 graphics API";
54 homepage = "https://opensource.google/projects/swiftshader";
55 license = licenses.asl20;
56 # Should be possible to support Darwin by changing the install phase with
57 # 's/Linux/Darwin/' and 's/so/dylib/' or something similar.
58 platforms = with platforms; linux;