about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/process-cpp/default.nix
blob: f73f72e4545d116f7a0d490c937dee3d2b40ec92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, stdenv
, fetchFromGitLab
, cmake
, boost
, properties-cpp
, pkg-config
}:

stdenv.mkDerivation rec {
  pname = "process-cpp";
  version = "unstable-2021-05-11";

  src = fetchFromGitLab {
    domain = "gitlab.com";
    owner = "ubports";
    repo = "development/core/lib-cpp/process-cpp";
    rev = "ee6d99a3278343f5fdcec7ed3dad38763e257310";
    sha256 = "sha256-jDYXKCzrg/ZGFC2xpyfkn/f7J3t0cdOwHK2mLlYWNN0=";
  };

  postPatch = ''
    # Excludes tests from tainting nativeBuildInputs with their dependencies when not being run
    # Tests fail upon verifying OOM score adjustment via /proc/<pid>/oom_score
    # [ RUN      ] LinuxProcess.adjusting_proc_oom_score_adj_works
    # /build/source/tests/linux_process_test.cpp:83: Failure
    # Value of: is_approximately_equal(oom_score.value, core::posix::linux::proc::process::OomScoreAdj::max_value())
    #   Actual: false (333 > 10)
    # Expected: true
    sed -i '/tests/d' CMakeLists.txt
  '';

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    boost
    properties-cpp
  ];

  meta = with lib; {
    description = "A simple convenience library for handling processes in C++11";
    homepage = "https://gitlab.com/ubports/development/core/lib-cpp/process-cpp";
    license = with licenses; [ gpl3Only lgpl3Only ];
    maintainers = with maintainers; [ onny ];
    platforms = platforms.linux;
  };
}