From 30845d07d8110c034156407c71d71e22f92d194a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 28 Oct 2015 11:45:32 +0100 Subject: [PATCH] pcre: separate variants of the library - don't include the cxx variant in the default build, as it depends on libstdc++ (and it seems rarely used anyway) - allow building pcre16 and pcre32 variants; pcre16 is the one needed by qt*, I think - share the basic libs with all of the variants --- pkgs/development/libraries/pcre/default.nix | 30 ++++++++++++--------- pkgs/top-level/all-packages.nix | 8 ++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index cc6555792899..fa4a640bd0b0 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -1,9 +1,11 @@ -{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true -, windows ? null +{ stdenv, fetchurl +, windows ? null, variant ? null, pcre }: with stdenv.lib; +assert elem variant [ null "cpp" "pcre16" "pcre32" ]; + stdenv.mkDerivation rec { name = "pcre-8.37"; @@ -19,26 +21,28 @@ stdenv.mkDerivation rec { outputs = [ "dev" "out" "bin" "doc" "man" ]; - configureFlags = '' - --enable-jit - ${if unicodeSupport then "--enable-unicode-properties" else ""} - ${if !cplusplusSupport then "--disable-cpp" else ""} - ''; + configureFlags = [ + "--enable-jit" + "--enable-unicode-properties" + "--disable-cpp" + ] + ++ optional (variant != null) "--enable-${variant}"; doCheck = with stdenv; !(isCygwin || isFreeBSD); # XXX: test failure on Cygwin # we are running out of stack on both freeBSDs on Hydra + postFixup = '' + _moveToOutput bin/pcre-config "$dev" + '' + + optionalString (variant != null) '' + ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.so.*.*.* + ''; + crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") { buildInputs = [ windows.mingw_w64_pthreads.crossDrv ]; }; - postInstall = - '' - mkdir $dev/bin - mv $bin/bin/pcre-config $dev/bin/ - ''; - meta = { homepage = "http://www.pcre.org/"; description = "A library for Perl Compatible Regular Expressions"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ffa1b6326aa9..f5936c47889b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7800,9 +7800,7 @@ let vtk = vtkWithQt4; }; - pcre = callPackage ../development/libraries/pcre { - unicodeSupport = config.pcre.unicode or true; - }; + pcre = callPackage ../development/libraries/pcre { }; pdf2xml = callPackage ../development/libraries/pdf2xml {} ; @@ -11545,9 +11543,7 @@ let inherit (gnome3) gitg; - giv = callPackage ../applications/graphics/giv { - pcre = pcre.override { unicodeSupport = true; }; - }; + giv = callPackage ../applications/graphics/giv { }; gmrun = callPackage ../applications/misc/gmrun {};