2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, glslang
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, libX11
|
|
|
|
, spirv-headers
|
|
|
|
, vulkan-headers
|
2022-12-17 10:02:37 +00:00
|
|
|
, vkbasalt32
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-17 10:02:37 +00:00
|
|
|
pname = "vkbasalt";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.3.2.10";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "DadSchoorse";
|
2023-03-15 16:39:30 +00:00
|
|
|
repo = "vkBasalt";
|
|
|
|
rev = "refs/tags/v${finalAttrs.version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-GC6JKYnsfcUBg+CX6v7MyE4FeLmjadFwighaiyureDg=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ glslang meson ninja pkg-config ];
|
|
|
|
buildInputs = [ libX11 spirv-headers vulkan-headers ];
|
|
|
|
mesonFlags = [ "-Dappend_libdir_vkbasalt=true" ];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
|
2022-12-17 10:02:37 +00:00
|
|
|
install -Dm 644 $src/config/vkBasalt.conf $out/share/vkBasalt/vkBasalt.conf
|
|
|
|
# Include 32bit layer in 64bit build
|
|
|
|
ln -s ${vkbasalt32}/share/vulkan/implicit_layer.d/vkBasalt.json \
|
2021-02-05 17:12:51 +00:00
|
|
|
"$out/share/vulkan/implicit_layer.d/vkBasalt32.json"
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# We need to give the different layers separate names or else the loader
|
|
|
|
# might try the 32-bit one first, fail and not attempt to load the 64-bit
|
|
|
|
# layer under the same name.
|
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace "$out/share/vulkan/implicit_layer.d/vkBasalt.json" \
|
|
|
|
--replace "VK_LAYER_VKBASALT_post_processing" "VK_LAYER_VKBASALT_post_processing_${toString stdenv.hostPlatform.parsed.cpu.bits}"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Vulkan post processing layer for Linux";
|
2021-02-05 17:12:51 +00:00
|
|
|
homepage = "https://github.com/DadSchoorse/vkBasalt";
|
|
|
|
license = licenses.zlib;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ kira-bruneau ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
})
|