Skip to content

Commit 14e6ebd

Browse files
authored
restinio: fix build (NixOS#375955)
2 parents 6319929 + 97ae828 commit 14e6ebd

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pkgs/by-name/re/restinio/package.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ stdenv.mkDerivation (finalAttrs: {
3030
hash = "sha256-heVdo0MtsWi/r9yse+/FZ55lhiunyEdwB3UkOOY5Vj0=";
3131
};
3232

33+
# https://www.github.com/Stiffstream/restinio/issues/230
34+
# > string sub-command JSON failed parsing json string: * Line 1, Column 1
35+
# > Syntax error: value, object or array expected.
36+
postPatch = ''
37+
substituteInPlace dev/test/CMakeLists.txt \
38+
--replace-fail "add_subdirectory(metaprogramming)" ""
39+
'';
40+
3341
strictDeps = true;
3442

3543
nativeBuildInputs = [ cmake ];
@@ -74,6 +82,28 @@ stdenv.mkDerivation (finalAttrs: {
7482

7583
doCheck = true;
7684
enableParallelChecking = false;
85+
__darwinAllowLocalNetworking = true;
86+
preCheck =
87+
let
88+
disabledTests =
89+
[ ]
90+
++ lib.optionals stdenv.hostPlatform.isDarwin [
91+
# Tests that fail with error: 'unable to write: Operation not permitted'
92+
"HTTP echo server"
93+
"single_thread_connection_limiter"
94+
"simple sendfile"
95+
"simple sendfile with std::filesystem::path"
96+
"sendfile the same file several times"
97+
"sendfile 2 files"
98+
"sendfile offsets_and_size"
99+
"sendfile chunks"
100+
"sendfile with partially-read response"
101+
];
102+
excludeRegex = "^(${builtins.concatStringsSep "|" disabledTests})";
103+
in
104+
lib.optionalString (builtins.length disabledTests != 0) ''
105+
checkFlagsArray+=(ARGS="--exclude-regex '${excludeRegex}'")
106+
'';
77107

78108
meta = with lib; {
79109
description = "Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library";

0 commit comments

Comments
 (0)