From a3a6cac4588ffdcd0634b818bb631bb1c9055b44 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Thu, 2 May 2024 19:53:16 +0200 Subject: [PATCH] Add recipe for sdbus-c++-1 We still need it. At least hyprland has not yet been ported to sdbus-c++-2 --- .../xdg-desktop-portal-hyprland.bb | 2 +- recipes-core/sdbus-c++/sdbus-c++-1/run-ptest | 6 +++ recipes-core/sdbus-c++/sdbus-c++-1_1.6.0.bb | 51 +++++++++++++++++++ recipes-support/hyprland/hypridle_git.bb | 2 +- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100755 recipes-core/sdbus-c++/sdbus-c++-1/run-ptest create mode 100644 recipes-core/sdbus-c++/sdbus-c++-1_1.6.0.bb diff --git a/dynamic-layers/meta-qt6/recipes-qt/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.bb b/dynamic-layers/meta-qt6/recipes-qt/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.bb index e7ab190..ae364f9 100644 --- a/dynamic-layers/meta-qt6/recipes-qt/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.bb +++ b/dynamic-layers/meta-qt6/recipes-qt/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.bb @@ -15,7 +15,7 @@ DEPENDS = " \ hyprlang \ libdrm \ pipewire \ - sdbus-c++ \ + sdbus-c++-1 \ virtual/libgbm \ " diff --git a/recipes-core/sdbus-c++/sdbus-c++-1/run-ptest b/recipes-core/sdbus-c++/sdbus-c++-1/run-ptest new file mode 100755 index 0000000..5e285b3 --- /dev/null +++ b/recipes-core/sdbus-c++/sdbus-c++-1/run-ptest @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +./sdbus-c++-unit-tests 2>&1 && echo "PASS: sdbus-c++-unit-tests" || echo "FAIL: sdbus-c++-unit-tests" + +./sdbus-c++-integration-tests 2>&1 && echo "PASS: sdbus-c++-integration-tests" || echo "FAIL: sdbus-c++-integration-tests" diff --git a/recipes-core/sdbus-c++/sdbus-c++-1_1.6.0.bb b/recipes-core/sdbus-c++/sdbus-c++-1_1.6.0.bb new file mode 100644 index 0000000..0a59e13 --- /dev/null +++ b/recipes-core/sdbus-c++/sdbus-c++-1_1.6.0.bb @@ -0,0 +1,51 @@ +SUMMARY = "sdbus-c++" +DESCRIPTION = "High-level C++ D-Bus library designed to provide easy-to-use yet powerful API in modern C++" + +SECTION = "libs" + +LICENSE = "LGPL-2.1-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=1803fa9c2c3ce8cb06b4861d75310742" + +inherit cmake pkgconfig systemd ptest + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'with-external-libsystemd', 'with-builtin-libsystemd', d)} \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'with-tests', '', d)}" +PACKAGECONFIG[with-builtin-libsystemd] = ",,sdbus-c++-libsystemd,libcap,basu" +PACKAGECONFIG[with-external-libsystemd] = ",,systemd,libsystemd" +PACKAGECONFIG[with-tests] = "-DBUILD_TESTS=ON -DINSTALL_TESTS=ON -DTESTS_INSTALL_PATH=${PTEST_PATH},-DBUILD_TESTS=OFF,googletest gmock" + +DEPENDS += "expat" + +PV .= "+git" +SRCREV = "7450515d0bc632b871d0d3f549ddb24783dd008f" +SRC_URI = "git://github.com/Kistler-Group/sdbus-cpp.git;protocol=https;branch=master \ + file://run-ptest" + +EXTRA_OECMAKE = "-DBUILD_CODE_GEN=OFF \ + -DBUILD_DOC=ON \ + -DBUILD_DOXYGEN_DOC=OFF" + +S = "${WORKDIR}/git" + +# Link libatomic on architectures without 64bit atomics fixes +# libsdbus-c++.so.1.1.0: undefined reference to `__atomic_load_8' +LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" +LDFLAGS:append:powerpc = " -Wl,--no-as-needed -latomic -Wl,--as-needed" +LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" + +do_install:append() { + if ! ${@bb.utils.contains('PTEST_ENABLED', '1', 'true', 'false', d)}; then + rm -rf ${D}${sysconfdir}/dbus-1 + fi +} + +do_install_ptest() { + DESTDIR='${D}' cmake_runcmake_build --target tests/install +} + +FILES:${PN}-ptest =+ "${sysconfdir}/dbus-1/system.d/" +FILES:${PN}-dev += "${bindir}/sdbus-c++-xml2cpp" + +RDEPENDS:${PN}-ptest += "dbus" +# It adds -isystem which is spurious, no idea where it gets it from +CCACHE_DISABLE = "1" diff --git a/recipes-support/hyprland/hypridle_git.bb b/recipes-support/hyprland/hypridle_git.bb index 0b9bbc0..71c45f5 100644 --- a/recipes-support/hyprland/hypridle_git.bb +++ b/recipes-support/hyprland/hypridle_git.bb @@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=778ddc598b3f2a2da3657dda514da983" SRC_URI = "git://github.com/hyprwm/hypridle.git;protocol=https;branch=main" -DEPENDS = "wayland wayland-native wayland-protocols hyprlang sdbus-c++" +DEPENDS = "wayland wayland-native wayland-protocols hyprlang sdbus-c++-1" S = "${WORKDIR}/git" SRCREV = "7cff4581a3753154fc5b41f39a098fad49b777b1"