1{ lib, stdenv, fetchFromGitHub, fetchpatch }:
2
3stdenv.mkDerivation rec {
4 pname = "http-parser";
5 version = "2.9.4";
6
7 src = fetchFromGitHub {
8 owner = "nodejs";
9 repo = "http-parser";
10 rev = "v${version}";
11 sha256 = "1vda4dp75pjf5fcph73sy0ifm3xrssrmf927qd1x8g3q46z0cv6c";
12 };
13
14 env.NIX_CFLAGS_COMPILE = "-Wno-error";
15 patches = [
16 ./build-shared.patch
17 ] ++ lib.optionals stdenv.isAarch32 [
18 # https://github.com/nodejs/http-parser/pull/510
19 (fetchpatch {
20 url = "https://github.com/nodejs/http-parser/commit/4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878.patch";
21 sha256 = "sha256-rZZMJeow3V1fTnjadRaRa+xTq3pdhZn/eJ4xjxEDoU4=";
22 })
23 ];
24 makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
25 buildFlags = [ "library" ];
26 doCheck = true;
27 checkTarget = "test";
28
29 enableParallelBuilding = true;
30
31 meta = with lib; {
32 description = "An HTTP message parser written in C";
33 homepage = "https://github.com/nodejs/http-parser";
34 maintainers = with maintainers; [ matthewbauer ];
35 license = licenses.mit;
36 platforms = platforms.unix;
37 };
38}