1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 gitUpdater,
6 testers,
7 cmake,
8 pkg-config,
9 gtest,
10 doxygen,
11 graphviz,
12 lomiri,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "properties-cpp";
17 version = "0.0.3";
18
19 src = fetchFromGitLab {
20 owner = "ubports";
21 repo = "development/core/lib-cpp/properties-cpp";
22 rev = finalAttrs.version;
23 hash = "sha256-C/BDEuKNMQHOjATO5aWBptjIlgfv6ykzjFAsHb6uP3Q=";
24 };
25
26 postPatch = ''
27 # GTest needs C++17
28 # Remove when https://gitlab.com/ubports/development/core/lib-cpp/properties-cpp/-/merge_requests/3 merged & in release
29 substituteInPlace CMakeLists.txt \
30 --replace-fail 'std=c++14' 'std=c++17'
31 ''
32 + lib.optionalString (!finalAttrs.finalPackage.doCheck) ''
33 sed -i "/add_subdirectory(tests)/d" CMakeLists.txt
34 '';
35
36 strictDeps = true;
37
38 nativeBuildInputs = [
39 cmake
40 doxygen
41 graphviz
42 pkg-config
43 ];
44
45 buildInputs = [
46 lomiri.cmake-extras
47 ];
48
49 checkInputs = [
50 gtest
51 ];
52
53 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
54
55 passthru = {
56 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
57 updateScript = gitUpdater { };
58 };
59
60 meta = with lib; {
61 homepage = "https://gitlab.com/ubports/development/core/lib-cpp/properties-cpp";
62 description = "Very simple convenience library for handling properties and signals in C++11";
63 license = licenses.lgpl3Only;
64 maintainers = with maintainers; [ edwtjo ];
65 platforms = platforms.linux;
66 pkgConfigModules = [
67 "properties-cpp"
68 ];
69 };
70})