Merge pull request #313759 from OPNA2608/update/process-cpp

This commit is contained in:
Sandro
2024-06-05 13:08:08 +02:00
committed by GitHub
3 changed files with 78 additions and 52 deletions
+78
View File
@@ -0,0 +1,78 @@
{ lib
, stdenv
, fetchFromGitLab
, testers
, unstableGitUpdater
, cmake
, coreutils
, boost
, gtest
, lomiri
, properties-cpp
, pkg-config
}:
stdenv.mkDerivation (finalAttrs: {
pname = "process-cpp";
version = "3.0.1-unstable-2024-03-14";
src = fetchFromGitLab {
domain = "gitlab.com";
owner = "ubports";
repo = "development/core/lib-cpp/process-cpp";
rev = "7b0a829abcbcdd25d949e5f9e2c26bb985a58b31";
hash = "sha256-Az+lSJ7uVR4pAWvOeah5vFtIPb12eKp0nAFF1qsHZXA=";
};
outputs = [
"out"
"dev"
];
postPatch = ''
substituteInPlace data/process-cpp.pc.in \
--replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \
--replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}'
substituteInPlace tests/posix_process_test.cpp \
--replace-fail '/usr/bin/sleep' '${lib.getExe' coreutils "sleep"}' \
--replace-fail '/usr/bin/env' '${lib.getExe' coreutils "env"}'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
boost
lomiri.cmake-extras
properties-cpp
];
checkInputs = [
gtest
];
cmakeFlags = [
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
updateScript = unstableGitUpdater { };
};
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 OPNA2608 ];
platforms = platforms.linux;
pkgConfigModules = [ "process-cpp" ];
};
})
@@ -1,50 +0,0 @@
{ 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;
};
}
-2
View File
@@ -33771,8 +33771,6 @@ with pkgs;
premid = callPackage ../applications/misc/premid { };
process-cpp = callPackage ../development/libraries/process-cpp { };
processing = callPackage ../applications/graphics/processing {
jdk = jdk17;
};