2022-12-20 14:06:26 +01:00
|
|
|
{ lib, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
2023-11-29 17:37:04 +01:00
|
|
|
, runCommand
|
2022-12-20 14:06:26 +01:00
|
|
|
, cmake
|
2023-03-03 19:41:10 +01:00
|
|
|
, ffmpeg_4
|
2022-12-20 14:06:26 +01:00
|
|
|
, libdrm
|
|
|
|
, libglvnd
|
|
|
|
, libffi
|
|
|
|
, libpng
|
|
|
|
, libX11
|
|
|
|
, libXau
|
|
|
|
, libXdmcp
|
|
|
|
, libxcb
|
|
|
|
, makeWrapper
|
2023-11-29 17:37:04 +01:00
|
|
|
, mesa
|
2022-12-20 14:06:26 +01:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, vulkan-loader
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2023-04-24 21:39:50 +02:00
|
|
|
, wayland-scanner
|
2022-12-20 14:06:26 +01:00
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
renderdoc = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/baldurk/renderdoc/v1.1/renderdoc/api/app/renderdoc_app.h";
|
|
|
|
hash = "sha256-57XwqlsbDq3GOhxiTAyn9a8TOqhX1qQnGw7z0L22ho4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# The build system expects all these dependencies inside the external folder and
|
|
|
|
# does not search for system-wide installations.
|
|
|
|
# It also expects the version specified in the repository, which can be incompatible
|
|
|
|
# with the version in nixpkgs (e.g. for SPIRV-Headers), so we don't want to patch in our packages.
|
2023-02-13 20:55:44 +01:00
|
|
|
# The revisions are extracted from https://github.com/KhronosGroup/VK-GL-CTS/blob/main/external/fetch_sources.py#L290
|
2023-08-26 18:56:30 +02:00
|
|
|
# with the vk-cts-sources.py script.
|
|
|
|
sources = import ./sources.nix { inherit fetchurl fetchFromGitHub; };
|
2022-12-20 14:06:26 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "vulkan-cts";
|
2024-05-05 20:27:21 +02:00
|
|
|
version = "1.3.8.3";
|
2022-12-20 14:06:26 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "VK-GL-CTS";
|
|
|
|
rev = "${finalAttrs.pname}-${finalAttrs.version}";
|
2024-05-05 20:27:21 +02:00
|
|
|
hash = "sha256-+xmbPezWTEwjxX+o2b7FjQcsoWxWe0RTSaTJOrXSIhc=";
|
2022-12-20 14:06:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
2023-08-26 18:56:30 +02:00
|
|
|
mkdir -p external/renderdoc/src
|
2022-12-20 14:06:26 +01:00
|
|
|
|
|
|
|
cp -r ${renderdoc} external/renderdoc/src/renderdoc_app.h
|
|
|
|
|
2023-08-26 18:56:30 +02:00
|
|
|
${sources.prePatch}
|
|
|
|
|
2022-12-20 14:06:26 +01:00
|
|
|
chmod u+w -R external
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-03-03 19:41:10 +01:00
|
|
|
ffmpeg_4
|
2022-12-20 14:06:26 +01:00
|
|
|
libdrm
|
|
|
|
libffi
|
|
|
|
libglvnd
|
|
|
|
libpng
|
|
|
|
libX11
|
|
|
|
libXau
|
|
|
|
libXdmcp
|
|
|
|
libxcb
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python3
|
2023-04-24 21:39:50 +02:00
|
|
|
wayland-scanner
|
2022-12-20 14:06:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2023-04-24 21:39:50 +02:00
|
|
|
# Fix cts cmake not coping with absolute install dirs
|
2022-12-20 14:06:26 +01:00
|
|
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
2023-04-24 21:39:50 +02:00
|
|
|
|
|
|
|
"-DWAYLAND_SCANNER=wayland-scanner"
|
2022-12-20 14:06:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-10-05 11:02:47 +02:00
|
|
|
# Check that nothing was installed so far
|
|
|
|
! test -e $out
|
2022-12-20 14:06:26 +01:00
|
|
|
|
|
|
|
mkdir -p $out/bin $out/archive-dir
|
|
|
|
cp -a external/vulkancts/modules/vulkan/deqp-vk external/vulkancts/modules/vulkan/deqp-vksc $out/bin/
|
|
|
|
cp -a external/vulkancts/modules/vulkan/vulkan $out/archive-dir/
|
|
|
|
cp -a external/vulkancts/modules/vulkan/vk-default $out/
|
|
|
|
|
|
|
|
wrapProgram $out/bin/deqp-vk \
|
|
|
|
--add-flags '--deqp-vk-library-path=${vulkan-loader}/lib/libvulkan.so' \
|
|
|
|
--add-flags "--deqp-archive-dir=$out/archive-dir"
|
|
|
|
'';
|
|
|
|
|
2023-08-26 18:56:30 +02:00
|
|
|
passthru.updateScript = ./update.sh;
|
2023-11-29 17:37:04 +01:00
|
|
|
passthru.tests.lavapipe = runCommand "vulkan-cts-tests-lavapipe" { nativeBuildInputs = [ finalAttrs.finalPackage ]; } ''
|
|
|
|
# Expand the wildcard to pick the existing architecture
|
|
|
|
export VK_ICD_FILENAMES=$(echo ${mesa.drivers}/share/vulkan/icd.d/lvp_icd.*.json)
|
|
|
|
deqp-vk -n dEQP-VK.api.smoke.triangle
|
|
|
|
touch $out
|
|
|
|
'';
|
2023-08-26 18:56:30 +02:00
|
|
|
|
2022-12-20 14:06:26 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Khronos Vulkan Conformance Tests";
|
|
|
|
homepage = "https://github.com/KhronosGroup/VK-GL-CTS/blob/main/external/vulkancts/README.md";
|
2023-04-22 18:35:33 +02:00
|
|
|
changelog = "https://github.com/KhronosGroup/VK-GL-CTS/releases/tag/${finalAttrs.pname}-${finalAttrs.version}";
|
2022-12-20 14:06:26 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
|
|
|
};
|
|
|
|
})
|