23 pythonEnv = python3.withPackages (ps: with ps; [
27 stdenv.mkDerivation (finalAttrs: {
31 src = fetchFromGitLab {
33 repo = "development/core/lib-cpp/net-cpp";
34 rev = finalAttrs.version;
35 hash = "sha256-MSqdP3kGI9hDdxFv2a0yd5ZkFkf1lMurB+KDIZLR9jg=";
45 # Be more lenient with how quickly HTTP test server must be up, for slower hardware / archs
47 url = "https://salsa.debian.org/ubports-team/net-cpp/-/raw/941d9eceaa66a06eabb1eb79554548b47d4a60ab/debian/patches/1007_wait-for-flask.patch";
48 hash = "sha256-nsGkZBuqahsg70PLUxn5EluDjmfZ0/wSnOYimfAI4ag=";
50 # Bump std version to 14 for gtest 1.13+
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=";
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}'
91 # https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/issues/4
92 (lib.cmakeBool "ENABLE_WERROR" false)
95 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
97 # Tests start HTTP server in separate process with fixed URL, parallelism breaks things
98 enableParallelChecking = false;
101 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
102 updateScript = gitUpdater { };
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;