From 392bca4c589ebb489d8f608c5842fddd45054d28 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 2 Jul 2021 15:44:25 +0200 Subject: [PATCH 1/2] 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 fe30b701ed0c..3bfc215aea7b 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"; From 74af05601cdb974899f292f07d2c2f83e25fc062 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sat, 3 Jul 2021 17:53:26 -0400 Subject: [PATCH 2/2] Revert "opencolorio: combine `dev` and `out` outputs of expat when building" This reverts commit 7d82e18159f0e3d3655cda8f2c162a0d33d6c0fb. --- pkgs/development/libraries/opencolorio/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix index b93e517def66..522c8cfa4a13 100644 --- a/pkgs/development/libraries/opencolorio/default.nix +++ b/pkgs/development/libraries/opencolorio/default.nix @@ -1,5 +1,5 @@ { - stdenv, lib, fetchFromGitHub, symlinkJoin, + stdenv, lib, fetchFromGitHub, cmake, expat, libyamlcpp, ilmbase, pystring, # Base dependencies glew, freeglut, # Only required on Linux @@ -25,8 +25,8 @@ stdenv.mkDerivation rec { sha256 = "194j9jp5c8ws0fryiz936wyinphnpzwpqnzvw9ryx6rbiwrba487"; }; - nativeBuildInputs = [ cmake (symlinkJoin { name = "expat"; paths = [ expat.out expat.dev ]; }) ]; - buildInputs = [ expat.out libyamlcpp ilmbase pystring ] + nativeBuildInputs = [ cmake ]; + buildInputs = [ expat libyamlcpp ilmbase pystring ] ++ lib.optionals stdenv.hostPlatform.isLinux [ glew freeglut ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon GLUT Cocoa ] ++ lib.optionals pythonBindings [ python3Packages.python python3Packages.pybind11 ]