2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2022-08-21 13:32:41 +00:00
|
|
|
, withJitSealloc ? true
|
2021-10-06 13:57:05 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pcre2";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "10.40";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-${version}/pcre2-${version}.tar.bz2";
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-FOS4PEeDkz3BfpZDGOYyT3yuG8ddjzx5vGlp8AwVnWg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-pcre2-16"
|
|
|
|
"--enable-pcre2-32"
|
2022-07-14 12:49:19 +00:00
|
|
|
# only enable jit on supported platforms which excludes Apple Silicon, see https://github.com/zherczeg/sljit/issues/51
|
|
|
|
"--enable-jit=auto"
|
2022-08-21 13:32:41 +00:00
|
|
|
]
|
|
|
|
# fix pcre jit in systemd units that set MemoryDenyWriteExecute=true like gitea
|
|
|
|
++ lib.optional withJitSealloc "--enable-jit-sealloc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "doc" "man" "devdoc" ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
moveToOutput bin/pcre2-config "$dev"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2022-07-14 12:49:19 +00:00
|
|
|
homepage = "https://www.pcre.org/";
|
2021-10-06 13:57:05 +00:00
|
|
|
description = "Perl Compatible Regular Expressions";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ ttuegel ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|