2022-04-15 01:41:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-18 21:22:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "http-parser";
|
2021-07-18 21:22:44 +00:00
|
|
|
version = "2.9.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nodejs";
|
|
|
|
repo = "http-parser";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1vda4dp75pjf5fcph73sy0ifm3xrssrmf927qd1x8g3q46z0cv6c";
|
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error";
|
2022-04-15 01:41:22 +00:00
|
|
|
patches = [
|
|
|
|
./build-shared.patch
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch32 [
|
2022-04-15 01:41:22 +00:00
|
|
|
# https://github.com/nodejs/http-parser/pull/510
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/nodejs/http-parser/commit/4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878.patch";
|
|
|
|
sha256 = "sha256-rZZMJeow3V1fTnjadRaRa+xTq3pdhZn/eJ4xjxEDoU4=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
|
|
|
|
buildFlags = [ "library" ];
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An HTTP message parser written in C";
|
|
|
|
homepage = "https://github.com/nodejs/http-parser";
|
|
|
|
maintainers = with maintainers; [ matthewbauer ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|