From 9938bb6c8259a6772e937b0f01318bc816f67ebe Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Thu, 10 May 2018 12:21:45 +0200 Subject: opencv3: fix $out/lib/pkgconfig/opencv.pc --- pkgs/development/libraries/opencv/3.x.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkgs/development/libraries/opencv') diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index efb9a7cdbe4..1d3a9629fd0 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -254,6 +254,21 @@ stdenv.mkDerivation rec { make doxygen ''; + # By default $out/lib/pkgconfig/opencv.pc looks something like this: + # + # prefix=/nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1 + # exec_prefix=${prefix} + # libdir=${exec_prefix}//nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1/lib + # ... + # Libs: -L${exec_prefix}//nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1/lib ... + # + # Note that ${exec_prefix} is set to $out but that $out is also appended to + # ${exec_prefix}. This causes linker errors in downstream packages so we strip + # of $out after the ${exec_prefix} prefix: + postInstall = '' + sed -i "s|\''${exec_prefix}/$out|\''${exec_prefix}|" "$out/lib/pkgconfig/opencv.pc" + ''; + hardeningDisable = [ "bindnow" "relro" ]; passthru = lib.optionalAttrs enablePython { pythonPath = []; }; -- cgit 1.4.1