chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / ne / net-cpp / package.nix
blob00815ff66ca800729435abb734c461f21904a03e
1 { stdenv
2 , lib
3 , fetchFromGitLab
4 , fetchpatch
5 , gitUpdater
6 , testers
7 , boost
8 , cmake
9 , curl
10 , doxygen
11 , graphviz
12 , gtest
13 , jsoncpp
14 , lomiri
15 , pkg-config
16 , process-cpp
17 , properties-cpp
18 , python3
19 , validatePkgConfig
22 let
23   pythonEnv = python3.withPackages (ps: with ps; [
24     httpbin
25   ]);
27 stdenv.mkDerivation (finalAttrs: {
28   pname = "net-cpp";
29   version = "3.1.1";
31   src = fetchFromGitLab {
32     owner = "ubports";
33     repo = "development/core/lib-cpp/net-cpp";
34     rev = finalAttrs.version;
35     hash = "sha256-MSqdP3kGI9hDdxFv2a0yd5ZkFkf1lMurB+KDIZLR9jg=";
36   };
38   outputs = [
39     "out"
40     "dev"
41     "doc"
42   ];
44   patches = [
45     # Be more lenient with how quickly HTTP test server must be up, for slower hardware / archs
46     (fetchpatch {
47       url = "https://salsa.debian.org/ubports-team/net-cpp/-/raw/941d9eceaa66a06eabb1eb79554548b47d4a60ab/debian/patches/1007_wait-for-flask.patch";
48       hash = "sha256-nsGkZBuqahsg70PLUxn5EluDjmfZ0/wSnOYimfAI4ag=";
49     })
50     # Bump std version to 14 for gtest 1.13+
51     (fetchpatch {
52       url = "https://salsa.debian.org/ubports-team/net-cpp/-/raw/f3a031eb7e4ce7df00781100f16de58a4709afcb/debian/patches/0001-Bump-std-version-to-14-needed-for-googletest-1.13.0.patch";
53       hash = "sha256-3ykqCfZjtTx7zWQ5rkMhVp7D5fkpoCjl0CVFwwEd4U4=";
54     })
55   ];
57   postPatch = lib.optionalString finalAttrs.finalPackage.doCheck ''
58     # Use wrapped python. Removing just the /usr/bin doesn't seem to work?
59     substituteInPlace tests/httpbin.h.in \
60       --replace '/usr/bin/python3' '${lib.getExe pythonEnv}'
61   '';
63   strictDeps = true;
65   nativeBuildInputs = [
66     cmake
67     doxygen
68     graphviz
69     validatePkgConfig
70   ];
72   buildInputs = [
73     boost
74     curl
75   ];
77   nativeCheckInputs = [
78     pkg-config
79     pythonEnv
80   ];
82   checkInputs = [
83     lomiri.cmake-extras
84     gtest
85     jsoncpp
86     process-cpp
87     properties-cpp
88   ];
90   cmakeFlags = [
91     # https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/issues/4
92     (lib.cmakeBool "ENABLE_WERROR" false)
93   ];
95   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
97   # Tests start HTTP server in separate process with fixed URL, parallelism breaks things
98   enableParallelChecking = false;
100   passthru = {
101     tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
102     updateScript = gitUpdater { };
103   };
105   meta = with lib; {
106     description = "Simple yet beautiful networking API for C++11";
107     homepage = "https://gitlab.com/ubports/development/core/lib-cpp/net-cpp";
108     changelog = "https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/blob/${finalAttrs.version}/ChangeLog";
109     license = licenses.lgpl3Only;
110     maintainers = teams.lomiri.members;
111     platforms = platforms.linux;
112     pkgConfigModules = [
113       "net-cpp"
114     ];
115   };