From 392bca4c589ebb489d8f608c5842fddd45054d28 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 2 Jul 2021 15:44:25 +0200 Subject: [PATCH] expat: Fix cmake config files Header & library path constructions in CMake modules expect them to reside under the same prefix as the CMake files. This assumption doesn't work with our multiple outputs so we patch the library path to the correct output. Co-authored-by: Dmitry Kalinkin --- pkgs/development/libraries/expat/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix index fe30b701ed0..3bfc215aea7 100644 --- a/pkgs/development/libraries/expat/default.nix +++ b/pkgs/development/libraries/expat/default.nix @@ -27,6 +27,13 @@ stdenv.mkDerivation rec { patchShebangs ./configure ./run.sh ./test-driver-wrapper.sh ''; + # CMake files incorrectly calculate library path from dev prefix + # https://github.com/libexpat/libexpat/issues/501 + postFixup = '' + substituteInPlace $dev/lib/cmake/expat-${version}/expat-noconfig.cmake \ + --replace "$"'{_IMPORT_PREFIX}' $out + ''; + meta = with lib; { homepage = "https://libexpat.github.io/"; description = "A stream-oriented XML parser library written in C";