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
This commit is contained in:
parent
fd1619cf60
commit
30845d07d8
@ -1,9 +1,11 @@
|
|||||||
{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true
|
{ stdenv, fetchurl
|
||||||
, windows ? null
|
, windows ? null, variant ? null, pcre
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
|
assert elem variant [ null "cpp" "pcre16" "pcre32" ];
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "pcre-8.37";
|
name = "pcre-8.37";
|
||||||
|
|
||||||
@ -19,26 +21,28 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
outputs = [ "dev" "out" "bin" "doc" "man" ];
|
outputs = [ "dev" "out" "bin" "doc" "man" ];
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = [
|
||||||
--enable-jit
|
"--enable-jit"
|
||||||
${if unicodeSupport then "--enable-unicode-properties" else ""}
|
"--enable-unicode-properties"
|
||||||
${if !cplusplusSupport then "--disable-cpp" else ""}
|
"--disable-cpp"
|
||||||
'';
|
]
|
||||||
|
++ optional (variant != null) "--enable-${variant}";
|
||||||
|
|
||||||
doCheck = with stdenv; !(isCygwin || isFreeBSD);
|
doCheck = with stdenv; !(isCygwin || isFreeBSD);
|
||||||
# XXX: test failure on Cygwin
|
# XXX: test failure on Cygwin
|
||||||
# we are running out of stack on both freeBSDs on Hydra
|
# 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") {
|
crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") {
|
||||||
buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
|
buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
|
||||||
};
|
};
|
||||||
|
|
||||||
postInstall =
|
|
||||||
''
|
|
||||||
mkdir $dev/bin
|
|
||||||
mv $bin/bin/pcre-config $dev/bin/
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "http://www.pcre.org/";
|
homepage = "http://www.pcre.org/";
|
||||||
description = "A library for Perl Compatible Regular Expressions";
|
description = "A library for Perl Compatible Regular Expressions";
|
||||||
|
@ -7800,9 +7800,7 @@ let
|
|||||||
vtk = vtkWithQt4;
|
vtk = vtkWithQt4;
|
||||||
};
|
};
|
||||||
|
|
||||||
pcre = callPackage ../development/libraries/pcre {
|
pcre = callPackage ../development/libraries/pcre { };
|
||||||
unicodeSupport = config.pcre.unicode or true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
|
pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
|
||||||
|
|
||||||
@ -11545,9 +11543,7 @@ let
|
|||||||
|
|
||||||
inherit (gnome3) gitg;
|
inherit (gnome3) gitg;
|
||||||
|
|
||||||
giv = callPackage ../applications/graphics/giv {
|
giv = callPackage ../applications/graphics/giv { };
|
||||||
pcre = pcre.override { unicodeSupport = true; };
|
|
||||||
};
|
|
||||||
|
|
||||||
gmrun = callPackage ../applications/misc/gmrun {};
|
gmrun = callPackage ../applications/misc/gmrun {};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user