vulkan-loader: 1.1.70.0 -> 1.1.77.0
This commit is contained in:
parent
879145e1f7
commit
937d6acb80
@ -1,65 +1,31 @@
|
||||
{ stdenv, fetchgit, fetchFromGitHub, cmake, pkgconfig, git, python3,
|
||||
python3Packages, glslang, spirv-tools, x11, libxcb, libXrandr,
|
||||
libXext, wayland, libGL_driver, makeWrapper }:
|
||||
|
||||
let
|
||||
version = "1.1.70.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "Vulkan-LoaderAndValidationLayers";
|
||||
rev = "sdk-${version}";
|
||||
sha256 = "1a7xwl65bi03l4zbjq54qkxjb8kb4m78qvw8bas5alhf9v6i6yqp";
|
||||
};
|
||||
in
|
||||
|
||||
{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig,
|
||||
x11, libxcb, libXrandr, libXext, wayland, libGL_driver }:
|
||||
let version = "1.1.77.0"; in
|
||||
assert version == vulkan-headers.version;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "vulkan-loader-${version}";
|
||||
inherit version src;
|
||||
inherit version;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
||||
buildInputs = [ cmake git python3 python3Packages.lxml
|
||||
glslang x11 libxcb libXrandr libXext wayland
|
||||
];
|
||||
src = fetchFromGitHub {
|
||||
owner = "KhronosGroup";
|
||||
repo = "Vulkan-Loader";
|
||||
rev = "sdk-${version}";
|
||||
sha256 = "1nzzkqh0i3j1d3h7kgmaxzi748l338m2p31lxkwxm4y81xp56a94";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ cmake python3 x11 libxcb libXrandr libXext wayland ];
|
||||
enableParallelBuilding = true;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_WSI_MIR_SUPPORT=OFF"
|
||||
"-DFALLBACK_DATA_DIRS=${libGL_driver.driverLink}/share:/usr/local/share:/usr/share"
|
||||
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
|
||||
];
|
||||
|
||||
outputs = [ "out" "dev" "demos" ];
|
||||
patches = [ ./rev-file.patch ];
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
postUnpack = ''
|
||||
# Hack so a version header can be generated. Relies on ./rev-file.patch to work.
|
||||
mkdir -p "$sourceRoot/external/glslang/External"
|
||||
echo "${spirv-tools.src.rev}" > "$sourceRoot/external/glslang/External/spirv-tools"
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
checkRev() {
|
||||
[ "$2" = $(cat "external_revisions/$1_revision") ] || (echo "ERROR: dependency $1 is revision $2 but should be revision" $(cat "external_revisions/$1_revision") && exit 1)
|
||||
}
|
||||
checkRev glslang "${glslang.src.rev}"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/bin
|
||||
cp -d loader/libvulkan.so* $out/lib
|
||||
cp demos/vulkaninfo $out/bin
|
||||
mkdir -p $out/lib $out/share/vulkan/explicit_layer.d
|
||||
cp -L layers/*.so $out/lib/
|
||||
cp -L layers/*.json $out/share/vulkan/explicit_layer.d/
|
||||
sed -i "s:\\./lib:$out/lib/lib:g" "$out/share/vulkan/"*/*.json
|
||||
mkdir -p $dev/include
|
||||
cp -rv ../include $dev/
|
||||
mkdir -p $demos/share/vulkan-demos
|
||||
cp demos/*.spv demos/*.ppm $demos/share/vulkan-demos
|
||||
mkdir -p $demos/bin
|
||||
find demos -type f -executable -not -name vulkaninfo -exec cp -v {} $demos/bin \;
|
||||
for p in cube cubepp; do
|
||||
wrapProgram $demos/bin/$p --run "cd $demos/share/vulkan-demos"
|
||||
done
|
||||
postInstall = ''
|
||||
cp -r "${vulkan-headers}/include" "$dev"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -1,21 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c9f73ce96..d14ffeed9 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -339,13 +339,13 @@ macro(run_vk_xml_generate dependency output)
|
||||
endmacro()
|
||||
|
||||
# Define macro used for generating header files containing commit IDs for external dependencies
|
||||
-macro(run_external_revision_generate source_dir symbol_name output)
|
||||
+macro(run_external_revision_generate rev_file symbol_name output)
|
||||
add_custom_command(OUTPUT ${output}
|
||||
# NOTE: If you modify this call to use --rev_file instead of --git_dir (to read the commit ID from a file instead of
|
||||
# parsing from a Git repository), you probably also want to add the revision file to the list of DEPENDS on the
|
||||
# subsequent line (to ensure that the script is re-run when the revision file is modified).
|
||||
- COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/external_revision_generator.py --git_dir ${source_dir} -s ${symbol_name} -o ${output}
|
||||
- DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py ${source_dir}/.git/HEAD ${source_dir}/.git/index
|
||||
+ COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/external_revision_generator.py --rev_file ${rev_file} -s ${symbol_name} -o ${output}
|
||||
+ DEPENDS ${SCRIPTS_DIR}/external_revision_generator.py ${rev_file}
|
||||
)
|
||||
endmacro()
|
||||
|
Loading…
Reference in New Issue
Block a user