2023-07-21 03:13:51 +02:00
|
|
|
{ pkgs, lib, stdenv, fetchFromGitHub, cmake, python3 }:
|
|
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "swiftshader";
|
2023-10-05 17:23:46 +02:00
|
|
|
version = "03102023";
|
2023-07-21 03:13:51 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "SwiftShader";
|
2023-10-05 17:23:46 +02:00
|
|
|
rev = "400ac3a175a658d8157f8a363271ae7ab013c2ee";
|
|
|
|
sha256 = "sha256-t3XjGPY6CutpyIKolUjvprOkJjKCEfDmU7+x1Hmzpfg=";
|
2023-07-21 03:13:51 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ cmake python3 ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib
|
2023-10-05 17:23:46 +02:00
|
|
|
mkdir -p $out/share/vulkan/icd.d
|
|
|
|
install -Dm755 libvk_swiftshader.so $out/lib
|
|
|
|
install -Dm644 Linux/vk_swiftshader_icd.json $out/share/vulkan/icd.d
|
|
|
|
|
|
|
|
sed -i "s#./libvk_swiftshader.so#$out/lib/libvk_swiftshader.so#" $out/share/vulkan/icd.d/vk_swiftshader_icd.json
|
2023-07-21 03:13:51 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "SwiftShader is a high-performance CPU-based implementation of the Vulkan 1.3 graphics API";
|
|
|
|
homepage = "https://swiftshader.googlesource.com/SwiftShader";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|