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 <dmitry.kalinkin@gmail.com>
This commit is contained in:
OPNA2608 2021-07-02 15:44:25 +02:00 committed by Dmitry Kalinkin
parent 288f1d27d9
commit 392bca4c58
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333

View file

@ -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";