From 0fe70e7fd4cf127299d63d43cf9cd996fbe6d778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=B6ller?= Date: Sat, 9 Jan 2021 23:24:44 +0100 Subject: [PATCH] vulkan-loader: fix pkg-config include directory With the last update the pkg-config file was changed to cmake variables, which made substituteInPlace ineffective. Fixes #108766 --- .../libraries/vulkan-loader/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index c833d770aeaf..b3882a919421 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -15,19 +15,23 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config cmake ]; buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ]; - preConfigure = '' - substituteInPlace loader/vulkan.pc.in \ - --replace 'includedir=''${prefix}/include' 'includedir=${vulkan-headers}/include' \ - --replace 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' 'libdir=@CMAKE_INSTALL_LIBDIR@' - ''; - cmakeFlags = [ "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share" "-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}" + "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ]; outputs = [ "out" "dev" ]; + doInstallCheck = true; + + installCheckPhase = '' + grep -q "${vulkan-headers}/include" $dev/lib/pkgconfig/vulkan.pc || { + echo vulkan-headers include directory not found in pkg-config file + exit 1 + } + ''; + meta = with lib; { description = "LunarG Vulkan loader"; homepage = "https://www.lunarg.com";