depot/third_party/nixpkgs/pkgs/by-name/pr/process-cpp/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

78 lines
1.8 KiB
Nix

{ 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 = "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" ];
};
})