1 { lib, stdenv, fetchgit, python3, cmake, jq, libX11, libXext, zlib }:
3 stdenv.mkDerivation rec {
5 version = "2023-09-11";
8 url = "https://swiftshader.googlesource.com/SwiftShader";
9 rev = "4e40d502c440cc59b25fa3a5fee0eadbab7442aa";
10 sha256 = "085bdqn80s7zw5h2pz6xff3j34hmkxb9wxzgjmzdr9c24zwp2k1c";
13 nativeBuildInputs = [ cmake python3 jq ];
15 # Make sure we include the drivers and icd files in the output as the cmake
16 # generated install command only puts in the spirv-tools stuff.
23 vk_so_path="$out/lib/libvk_swiftshader.so"
24 mkdir -p "$(dirname "$vk_so_path")"
25 mv Linux/libvk_swiftshader.so "$vk_so_path"
27 vk_icd_json="$out/share/vulkan/icd.d/vk_swiftshader_icd.json"
28 mkdir -p "$(dirname "$vk_icd_json")"
29 jq ".ICD.library_path = \"$vk_so_path\"" <Linux/vk_swiftshader_icd.json >"$vk_icd_json"
36 "A high-performance CPU-based implementation of the Vulkan 1.3 graphics API";
37 homepage = "https://opensource.google/projects/swiftshader";
38 license = licenses.asl20;
39 # Should be possible to support Darwin by changing the install phase with
40 # 's/Linux/Darwin/' and 's/so/dylib/' or something similar.
41 platforms = with platforms; linux;
42 maintainers = with maintainers; [ expipiplus1 ];