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 {};