···
22
+
pythonEnv = python3.withPackages (ps: with ps; [
26
+
stdenv.mkDerivation (finalAttrs: {
30
+
src = fetchFromGitLab {
32
+
repo = "development/core/lib-cpp/net-cpp";
33
+
rev = finalAttrs.version;
34
+
hash = "sha256-qXKuFLmtPjdqTcBIM07xbRe3DnP7AzieCy7Tbjtl0uc=";
44
+
# Enable disabling of Werror
45
+
# Remove when version > 3.1.0
47
+
name = "0001-net-cpp-Add-ENABLE_WERROR-option.patch";
48
+
url = "https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/commit/0945180aa6dd38245688d5ebc11951b272e93dc4.patch";
49
+
hash = "sha256-91YuEgV+Q9INN4BJXYwWgKUNHHtUYz3CG+ROTy24GIE=";
52
+
# Enable opting out of tests
53
+
# https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/merge_requests/14
55
+
name = "0002-net-cpp-Make-tests-optional.patch";
56
+
url = "https://gitlab.com/OPNA2608/net-cpp/-/commit/cfbcd55446a4224a4c913ead3a370cd56d07a71b.patch";
57
+
hash = "sha256-kt48txzmWNXyxvx3DWAJl7I90c+o3KlgveNQjPkhfxA=";
60
+
# Be more lenient with how quickly HTTP test server must be up, for slower hardware / archs
62
+
url = "https://salsa.debian.org/ubports-team/net-cpp/-/raw/941d9eceaa66a06eabb1eb79554548b47d4a60ab/debian/patches/1007_wait-for-flask.patch";
63
+
hash = "sha256-nsGkZBuqahsg70PLUxn5EluDjmfZ0/wSnOYimfAI4ag=";
67
+
postPatch = lib.optionalString finalAttrs.doCheck ''
68
+
# Use wrapped python. Removing just the /usr/bin doesn't seem to work?
69
+
substituteInPlace tests/httpbin.h.in \
70
+
--replace '/usr/bin/python3' '${lib.getExe pythonEnv}'
75
+
nativeBuildInputs = [
86
+
nativeCheckInputs = [
100
+
# https://gitlab.com/ubports/development/core/lib-cpp/net-cpp/-/issues/4
101
+
"-DENABLE_WERROR=OFF"
104
+
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
106
+
# Tests start HTTP server in separate process with fixed URL, parallelism breaks things
107
+
enableParallelChecking = false;
110
+
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
111
+
updateScript = gitUpdater { };
115
+
description = "Simple yet beautiful networking API for C++11";
116
+
homepage = "https://gitlab.com/ubports/development/core/lib-cpp/net-cpp";
117
+
license = licenses.lgpl3Only;
118
+
maintainers = teams.lomiri.members;
119
+
platforms = platforms.linux;
120
+
pkgConfigModules = [