2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-10-07 09:15:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2022-08-12 12:06:08 +00:00
|
|
|
, cctools
|
2020-10-07 09:15:18 +00:00
|
|
|
, python3
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
glslang = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "81cc10a498b25a90147cccd6e8939493c1e9e20e";
|
|
|
|
hash = "sha256-jTOxZ1nU7kvtdWjPzyIp/5ZeKw3JtYyqhlFeIE7CyX8=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
lodepng = fetchFromGitHub {
|
|
|
|
owner = "lvandeve";
|
|
|
|
repo = "lodepng";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "5601b8272a6850b7c5d693dd0c0e16da50be8d8d";
|
|
|
|
hash = "sha256-dD8QoyOoGov6VENFNTXWRmen4nYYleoZ8+4TpICNSpo=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
shaderc = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "shaderc";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "e72186b66bb90ed06aaf15cbdc9a053581a0616b";
|
|
|
|
hash = "sha256-hd1IGsWksgAfB8Mq5yZOzSyNGxXsCJxb350pD/Gcskk=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
spirv-headers = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Headers";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "b42ba6d92faf6b4938e6f22ddd186dbdacc98d78";
|
|
|
|
hash = "sha256-ks9JCj5rj+Xu++7z5RiHDkU3/sFXhcScw8dATfB/ot0=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
spirv-tools = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Tools";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "a73e724359a274d7cf4f4248eba5be1e7764fbfd";
|
|
|
|
hash = "sha256-vooJHtgVRlBNkQG4hulYOxIgHH4GMhXw7N4OEbkKJvU=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "amber";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "unstable-2022-04-21";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = pname;
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "8b145a6c89dcdb4ec28173339dd176fb7b6f43ed";
|
|
|
|
hash = "sha256-+xFYlUs13khT6r475eJJ+XS875h2sb+YbJ8ZN4MOSAA=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
cctools
|
2020-10-07 09:15:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Tests are disabled so we do not have to pull in googletest and more dependencies
|
|
|
|
cmakeFlags = [ "-DAMBER_SKIP_TESTS=ON" ];
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
cp -r ${glslang}/ third_party/glslang
|
|
|
|
cp -r ${lodepng}/ third_party/lodepng
|
|
|
|
cp -r ${shaderc}/ third_party/shaderc
|
|
|
|
cp -r ${spirv-tools}/ third_party/spirv-tools
|
|
|
|
cp -r ${spirv-headers}/ third_party/spirv-headers
|
|
|
|
chmod u+w -R third_party
|
|
|
|
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "-Werror" ""
|
|
|
|
substituteInPlace tools/update_build_version.py \
|
|
|
|
--replace "not os.path.exists(directory)" "True"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 -t $out/bin amber image_diff
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-07 09:15:18 +00:00
|
|
|
description = "Multi-API shader test framework";
|
|
|
|
homepage = "https://github.com/google/amber";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
|
|
|
};
|
|
|
|
}
|