From 797b60f0d760fc2cfcad0c15cb22a5b75ed81818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Mon, 15 Feb 2021 08:18:29 +0100 Subject: [PATCH] ripgrep: link PCRE2 dynamically The pcre2 crate which is used by ripgrep uses pkg-config to find the path of the PCRE2 dynamic library. If the pkg-config or the library is not found, PCRE2 will be built/linked statically. This change adds pkg-config to the nativeBuildInputs of ripgrep, so that the PCRE2 library is detected and dynamically linked. --- pkgs/tools/text/ripgrep/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/ripgrep/default.nix b/pkgs/tools/text/ripgrep/default.nix index 61e534fa732..b012bdfe57e 100644 --- a/pkgs/tools/text/ripgrep/default.nix +++ b/pkgs/tools/text/ripgrep/default.nix @@ -4,6 +4,7 @@ , rustPlatform , asciidoctor , installShellFiles +, pkg-config , Security , withPCRE2 ? true , pcre2 ? null @@ -24,9 +25,10 @@ rustPlatform.buildRustPackage rec { cargoBuildFlags = lib.optional withPCRE2 "--features pcre2"; - nativeBuildInputs = [ asciidoctor installShellFiles ]; + nativeBuildInputs = [ asciidoctor installShellFiles ] + ++ lib.optional withPCRE2 pkg-config; buildInputs = (lib.optional withPCRE2 pcre2) - ++ (lib.optional stdenv.isDarwin Security); + ++ (lib.optional stdenv.isDarwin Security); preFixup = '' installManPage $releaseDir/build/ripgrep-*/out/rg.1