1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 testers,
6 gitUpdater,
7 cmake,
8 coreutils,
9 boost,
10 gtest,
11 lomiri,
12 properties-cpp,
13 pkg-config,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "process-cpp";
18 version = "3.0.2";
19
20 src = fetchFromGitLab {
21 domain = "gitlab.com";
22 owner = "ubports";
23 repo = "development/core/lib-cpp/process-cpp";
24 rev = finalAttrs.version;
25 hash = "sha256-UCNmD5Ea2wnEwG9gkt88TaX0vfS4SCaIOPRMeNFx80Y=";
26 };
27
28 outputs = [
29 "out"
30 "dev"
31 ];
32
33 postPatch = ''
34 substituteInPlace data/process-cpp.pc.in \
35 --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \
36 --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}'
37
38 substituteInPlace tests/posix_process_test.cpp \
39 --replace-fail '/usr/bin/sleep' '${lib.getExe' coreutils "sleep"}' \
40 --replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}'
41 '';
42
43 strictDeps = true;
44
45 nativeBuildInputs = [
46 cmake
47 pkg-config
48 ];
49
50 buildInputs = [
51 boost
52 lomiri.cmake-extras
53 properties-cpp
54 ];
55
56 checkInputs = [ gtest ];
57
58 cmakeFlags = [ (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) ];
59
60 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
61
62 passthru = {
63 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
64 updateScript = gitUpdater { };
65 };
66
67 meta = {
68 description = "Simple convenience library for handling processes in C++11";
69 homepage = "https://gitlab.com/ubports/development/core/lib-cpp/process-cpp";
70 license = with lib.licenses; [
71 gpl3Only
72 lgpl3Only
73 ];
74 maintainers = with lib.maintainers; [
75 onny
76 OPNA2608
77 ];
78 platforms = lib.platforms.linux;
79 pkgConfigModules = [ "process-cpp" ];
80 };
81})