nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 nix-update-script,
7 testers,
8 python3,
9 validatePkgConfig,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "llhttp";
14 version = "9.3.0";
15
16 src = fetchFromGitHub {
17 owner = "nodejs";
18 repo = "llhttp";
19 tag = "release/v${finalAttrs.version}";
20 hash = "sha256-VL58h8sdJIpzMiWNqTvfp8oITjb0b3X/F8ygaE9cH94=";
21 };
22
23 outputs = [
24 "out"
25 "dev"
26 ];
27
28 nativeBuildInputs = [
29 cmake
30 validatePkgConfig
31 ];
32
33 cmakeFlags = [
34 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
35 (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
36 ];
37
38 passthru.updateScript = nix-update-script {
39 extraArgs = [ "--version-regex=release/v(.+)" ];
40 };
41 passthru.tests = {
42 inherit (python3.pkgs) aiohttp;
43
44 pkg-config = testers.hasPkgConfigModules {
45 package = finalAttrs.finalPackage;
46 };
47 };
48
49 meta = {
50 description = "Port of http_parser to llparse";
51 homepage = "https://llhttp.org/";
52 changelog = "https://github.com/nodejs/llhttp/releases/tag/release/v${finalAttrs.version}";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ aduh95 ];
55 platforms = lib.platforms.all;
56 pkgConfigModules = [ "libllhttp" ];
57 };
58})