Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv 2, fetchFromGitHub 3, cmake 4, pkg-config 5, cctools 6, python3 7, vulkan-headers 8, vulkan-loader 9}: 10let 11 glslang = fetchFromGitHub { 12 owner = "KhronosGroup"; 13 repo = "glslang"; 14 rev = "81cc10a498b25a90147cccd6e8939493c1e9e20e"; 15 hash = "sha256-jTOxZ1nU7kvtdWjPzyIp/5ZeKw3JtYyqhlFeIE7CyX8="; 16 }; 17 18 lodepng = fetchFromGitHub { 19 owner = "lvandeve"; 20 repo = "lodepng"; 21 rev = "5601b8272a6850b7c5d693dd0c0e16da50be8d8d"; 22 hash = "sha256-dD8QoyOoGov6VENFNTXWRmen4nYYleoZ8+4TpICNSpo="; 23 }; 24 25 shaderc = fetchFromGitHub { 26 owner = "google"; 27 repo = "shaderc"; 28 rev = "e72186b66bb90ed06aaf15cbdc9a053581a0616b"; 29 hash = "sha256-hd1IGsWksgAfB8Mq5yZOzSyNGxXsCJxb350pD/Gcskk="; 30 }; 31 32 spirv-headers = fetchFromGitHub { 33 owner = "KhronosGroup"; 34 repo = "SPIRV-Headers"; 35 rev = "b42ba6d92faf6b4938e6f22ddd186dbdacc98d78"; 36 hash = "sha256-ks9JCj5rj+Xu++7z5RiHDkU3/sFXhcScw8dATfB/ot0="; 37 }; 38 39 spirv-tools = fetchFromGitHub { 40 owner = "KhronosGroup"; 41 repo = "SPIRV-Tools"; 42 rev = "a73e724359a274d7cf4f4248eba5be1e7764fbfd"; 43 hash = "sha256-vooJHtgVRlBNkQG4hulYOxIgHH4GMhXw7N4OEbkKJvU="; 44 }; 45 46in 47stdenv.mkDerivation rec { 48 pname = "amber"; 49 version = "unstable-2022-04-21"; 50 51 src = fetchFromGitHub { 52 owner = "google"; 53 repo = pname; 54 rev = "8b145a6c89dcdb4ec28173339dd176fb7b6f43ed"; 55 hash = "sha256-+xFYlUs13khT6r475eJJ+XS875h2sb+YbJ8ZN4MOSAA="; 56 }; 57 58 buildInputs = [ 59 vulkan-headers 60 vulkan-loader 61 ]; 62 63 nativeBuildInputs = [ 64 cmake 65 pkg-config 66 python3 67 ] ++ lib.optionals stdenv.isDarwin [ 68 cctools 69 ]; 70 71 # Tests are disabled so we do not have to pull in googletest and more dependencies 72 cmakeFlags = [ "-DAMBER_SKIP_TESTS=ON" ]; 73 74 prePatch = '' 75 cp -r ${glslang}/ third_party/glslang 76 cp -r ${lodepng}/ third_party/lodepng 77 cp -r ${shaderc}/ third_party/shaderc 78 cp -r ${spirv-tools}/ third_party/spirv-tools 79 cp -r ${spirv-headers}/ third_party/spirv-headers 80 chmod u+w -R third_party 81 82 substituteInPlace CMakeLists.txt \ 83 --replace "-Werror" "" 84 substituteInPlace tools/update_build_version.py \ 85 --replace "not os.path.exists(directory)" "True" 86 ''; 87 88 installPhase = '' 89 install -Dm755 -t $out/bin amber image_diff 90 ''; 91 92 meta = with lib; { 93 description = "Multi-API shader test framework"; 94 homepage = "https://github.com/google/amber"; 95 license = licenses.asl20; 96 maintainers = with maintainers; [ Flakebi ]; 97 }; 98}