at master 2.7 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitLab, 5 gitUpdater, 6 testers, 7 boost186, 8 cmake, 9 dbus, 10 doxygen, 11 graphviz, 12 gtest, 13 libxml2, 14 lomiri, 15 pkg-config, 16 process-cpp, 17 properties-cpp, 18}: 19 20stdenv.mkDerivation (finalAttrs: { 21 pname = "dbus-cpp"; 22 version = "5.0.5"; 23 24 src = fetchFromGitLab { 25 owner = "ubports"; 26 repo = "development/core/lib-cpp/dbus-cpp"; 27 tag = finalAttrs.version; 28 hash = "sha256-+QqmZsBFmYRwaAFqRyMBxVFFrjZGBDdMaW4YD/7D2gU="; 29 }; 30 31 outputs = [ 32 "out" 33 "dev" 34 "doc" 35 "examples" 36 ]; 37 38 postPatch = '' 39 substituteInPlace doc/CMakeLists.txt \ 40 --replace-fail 'DESTINATION share/''${CMAKE_PROJECT_NAME}/doc' 'DESTINATION ''${CMAKE_INSTALL_DOCDIR}' 41 42 # Warning on aarch64-linux breaks build due to -Werror 43 substituteInPlace CMakeLists.txt \ 44 --replace-fail '-Werror' "" 45 46 # pkg-config output patching hook expects prefix variable here 47 substituteInPlace data/dbus-cpp.pc.in \ 48 --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' 49 '' 50 + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' 51 substituteInPlace CMakeLists.txt \ 52 --replace-fail 'add_subdirectory(tests)' '# add_subdirectory(tests)' 53 ''; 54 55 strictDeps = true; 56 57 nativeBuildInputs = [ 58 cmake 59 doxygen 60 graphviz 61 pkg-config 62 ]; 63 64 buildInputs = [ 65 boost186 # uses boost/asio/io_service.hpp 66 lomiri.cmake-extras 67 dbus 68 libxml2 69 process-cpp 70 properties-cpp 71 ]; 72 73 nativeCheckInputs = [ 74 dbus 75 ]; 76 77 checkInputs = [ 78 gtest 79 ]; 80 81 cmakeFlags = [ 82 (lib.cmakeBool "DBUS_CPP_ENABLE_DOC_GENERATION" true) 83 ]; 84 85 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 86 87 # DBus, parallelism messes with communication 88 enableParallelChecking = false; 89 90 preFixup = '' 91 moveToOutput libexec/examples $examples 92 ''; 93 94 passthru = { 95 tests.pkg-config = testers.hasPkgConfigModules { 96 package = finalAttrs.finalPackage; 97 # Not bumped for 5.0.5: https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp/-/issues/9 98 # Try again on next bump. 99 versionCheck = finalAttrs.version != "5.0.5"; 100 }; 101 updateScript = gitUpdater { }; 102 }; 103 104 meta = { 105 description = "Dbus-binding leveraging C++-11"; 106 homepage = "https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp"; 107 changelog = "https://gitlab.com/ubports/development/core/lib-cpp/dbus-cpp/-/blob/${finalAttrs.version}/ChangeLog"; 108 license = lib.licenses.lgpl3Only; 109 maintainers = with lib.maintainers; [ OPNA2608 ]; 110 mainProgram = "dbus-cppc"; 111 platforms = lib.platforms.linux; 112 pkgConfigModules = [ 113 "dbus-cpp" 114 ]; 115 }; 116})