summaryrefslogtreecommitdiff
path: root/dev-cpp/sdbus-c++
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-24 23:59:54 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-24 23:59:54 +0000
commit401101f9c8077911929d3f2b60a37098460a5d89 (patch)
treec2bef4719f6787550f0916aeaa8f4f403a9296af /dev-cpp/sdbus-c++
parent4cbcc855382a06088e2f016f62cafdbcb7e40665 (diff)
gentoo resync : 25.03.2022
Diffstat (limited to 'dev-cpp/sdbus-c++')
-rw-r--r--dev-cpp/sdbus-c++/Manifest8
-rw-r--r--dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch58
-rw-r--r--dev-cpp/sdbus-c++/files/sdbus-c++-static-libsystemd.patch10
-rw-r--r--dev-cpp/sdbus-c++/metadata.xml12
-rw-r--r--dev-cpp/sdbus-c++/sdbus-c++-0.9.0.ebuild128
-rw-r--r--dev-cpp/sdbus-c++/sdbus-c++-1.1.0.ebuild132
6 files changed, 348 insertions, 0 deletions
diff --git a/dev-cpp/sdbus-c++/Manifest b/dev-cpp/sdbus-c++/Manifest
new file mode 100644
index 000000000000..65f396ea7532
--- /dev/null
+++ b/dev-cpp/sdbus-c++/Manifest
@@ -0,0 +1,8 @@
+AUX sdbus-c++-gtest-1.11.patch 2164 BLAKE2B 26bcf5be0de9bc9240123a1c7b6f676e069e3eac96a1d96c2dde9db31350b55540ea2a84e612d8c3989f1ecf10772fdbe9470950d595b0f1f2321f4bc0edef1e SHA512 e5db4f76d650882e3bb034c05ff20bf47c96aad8cd39b57e47d63ee753e8c08837764e9be87702720f8beadcf6a9b067f78ed94380babb8811ebb6af6f5daa4b
+AUX sdbus-c++-static-libsystemd.patch 417 BLAKE2B ec6120631ad48d70820c1070a47a224c837c838e0ff24c031b02fb4b9ef900da7b3a2c0b0e696066665a9004b9fcb68851c6971a220b2446da03dbbf42138ac5 SHA512 e42a080f580597aa7c3cddb71f6e6368addfe4a36b08b2944baf111dd70029c3d0d79868dabeaf78b91836c2a84939163ce10c3ffe4b36e53424be06c1fe1a0e
+DIST sdbus-c++-0.9.0.tar.gz 198979 BLAKE2B 31cda7ce97aad05f93a015ca0f8bd93aa095f6abb6bc513343767c7221d2aeacc96ee2b6a1b0ecf50850f17506fc97aa3a9fead0332687d57bdbddf806502826 SHA512 8695d3efac5654cb28998cdd69c16f251654b2c95e0dc2a2f5a4b01b24dae7b04e1a1f2e9bc9fb96b99f099dd4a130ca980cb672f74829565fd0d48162a581c5
+DIST sdbus-c++-1.1.0.tar.gz 201532 BLAKE2B 3dac74cb7fc6717db9d25463ddfb9122db54edcd3bc9d1e71d18c132ede1efaf12b514f335c3978f51277afff7e6ab5533cfd02241759f7e3d24cede8aa29c6d SHA512 ba6230c0d1019875d92a92f793278c528a01692dc70e7acee8bb289af5dae65c1ad7b1c139f859cb7a960c7b48501178bfdf755163c2bc4d3766e67f3aa9b883
+DIST systemd-stable-250.4.tar.gz 11132786 BLAKE2B 8fdfe1bad76e572dc1be0955f3d1c4080f2beb81a2f9670f80827899f5406ab8ed8675400c2f5e8ccef44cf1bceff42ceae12a42e1b67d46c0deb523e6495f25 SHA512 307ed0920da660b6c45d909fea66864fb98db8b2f6905d629fb2012fc4bf64dd25fd61168c22bf4098200be541be9b0e815fbde98806a99c85cb33d49d8b63d0
+EBUILD sdbus-c++-0.9.0.ebuild 3127 BLAKE2B 073d0b6c378c1e5e63882d32e798e67ebac1bc15f3c6524c46ff5534999ec9c58b42de0c400b46fafb3492a9de80bf1a65e6a75aa0220c2c5c606bd8a5d36e95 SHA512 ccd1ef989aac5eae53ac0c142809646569a914c48df17220c61ebc92096a19c8e16e04a0345a6f03c33c361c53570e3d603d4376e9eb15fb645beca4ef64d223
+EBUILD sdbus-c++-1.1.0.ebuild 3178 BLAKE2B e90613baf5061d935d4dfabc555599c02b27f62044cbd61ebe1f79461726dbe0d415ecc78beb0d9f18cb3d52669035e616a5161f8ad9a25b94d2496692a220c2 SHA512 2174b4740d81306500f37cc90f5b974ff16a41bc6c65117e23610ec2a8ebc601573e632c410a28a177890df47d22379bcad794123e81b4496ef8bf48eef81a20
+MISC metadata.xml 418 BLAKE2B d05d643aa8ee2b37ffb36fd99116e85e714e0e64ef830cbee4f24e2e09315a24c439e0fcc8f0b4c5516860e4dd13730682c3d50a1f65dd1c2954628793791ee9 SHA512 b75a5467a9b29405732dbac6c9e18567f7b37319a4fbffc2b65098ea2d1c3fdcc903834080e6751ef41737290352fd7ab2d0d68296675fb19f5520b81625fcbf
diff --git a/dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch b/dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch
new file mode 100644
index 000000000000..e6d3622ee11f
--- /dev/null
+++ b/dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch
@@ -0,0 +1,58 @@
+From 7f437a6e06d2ec3abd3e2fd1101ab6aab386bc44 Mon Sep 17 00:00:00 2001
+From: Stanislav Angelovic <stanislav.angelovic@siemens.com>
+Date: Thu, 27 Jan 2022 13:38:19 +0100
+Subject: [PATCH] fix(tests): printer for std::chrono in googletest v1.11.0
+
+---
+ tests/CMakeLists.txt | 2 +-
+ tests/integrationtests/Defs.h | 22 ++++++++++------------
+ 2 files changed, 11 insertions(+), 13 deletions(-)
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index fbf198c..ec42e55 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -19,7 +19,7 @@ if (NOT TARGET GTest::gmock)
+ if (NOT TARGET GTest::gmock)
+ include(FetchContent)
+
+- message("Fetching googletest...")
++ message("Fetching googletest v${GOOGLETEST_VERSION}...")
+ FetchContent_Declare(googletest
+ GIT_REPOSITORY ${GOOGLETEST_GIT_REPO}
+ GIT_TAG release-${GOOGLETEST_VERSION}
+diff --git a/tests/integrationtests/Defs.h b/tests/integrationtests/Defs.h
+index 2f129a4..2bfc7c9 100644
+--- a/tests/integrationtests/Defs.h
++++ b/tests/integrationtests/Defs.h
+@@ -56,20 +56,18 @@ const bool DEFAULT_BLOCKING_VALUE{true};
+
+ constexpr const double DOUBLE_VALUE{3.24L};
+
+-/** Duration stream operator for human readable gtest value output.
+- *
+- * Note that the conversion to double is lossy if the input type has 64 or more bits.
+- * This is ok for our integration tests because they don't have very
+- * accurate timing requirements.
+- *
+- * @return human readable duration in seconds
+- */
++}}
++
++namespace testing::internal {
++
++// Printer for std::chrono::duration types.
++// This is a workaround, since it's not a good thing to add this to std namespace.
+ template< class Rep, class Period >
+-static std::ostream& operator<<(std::ostream& os, const std::chrono::duration<Rep, Period>& d)
+-{
++void PrintTo(const ::std::chrono::duration<Rep, Period>& d, ::std::ostream* os) {
+ auto seconds = std::chrono::duration_cast<std::chrono::duration<double>>(d);
+- return os << seconds.count() << " s";
++ *os << seconds.count() << "s";
++}
++
+ }
+-}}
+
+ #endif /* SDBUS_CPP_INTEGRATIONTESTS_DEFS_H_ */
diff --git a/dev-cpp/sdbus-c++/files/sdbus-c++-static-libsystemd.patch b/dev-cpp/sdbus-c++/files/sdbus-c++-static-libsystemd.patch
new file mode 100644
index 000000000000..d6f018fda175
--- /dev/null
+++ b/dev-cpp/sdbus-c++/files/sdbus-c++-static-libsystemd.patch
@@ -0,0 +1,10 @@
+systemd does not include pkg-config dependencies for static linking.
+
+diff -Naur a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in
+--- a/src/libsystemd/libsystemd.pc.in 2022-01-18 11:35:43.000000000 +0000
++++ b/src/libsystemd/libsystemd.pc.in 2022-03-05 21:24:47.139338880 +0000
+@@ -18,3 +18,4 @@
+ Version: {{PROJECT_VERSION}}
+ Libs: -L${libdir} -lsystemd
+ Cflags: -I${includedir}
++Requires: libcap
diff --git a/dev-cpp/sdbus-c++/metadata.xml b/dev-cpp/sdbus-c++/metadata.xml
new file mode 100644
index 000000000000..3bd4943a1267
--- /dev/null
+++ b/dev-cpp/sdbus-c++/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chewi@gentoo.org</email>
+ <name>James Le Cuirot</name>
+ </maintainer>
+ <use>
+ <flag name="systemd">Use external libsystemd instead of statically-linked build</flag>
+ <flag name="tools">Install interface stub code generator</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-cpp/sdbus-c++/sdbus-c++-0.9.0.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-0.9.0.ebuild
new file mode 100644
index 000000000000..04f6c85c5a16
--- /dev/null
+++ b/dev-cpp/sdbus-c++/sdbus-c++-0.9.0.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit python-any-r1 meson cmake
+
+SDP="systemd-stable-250.4"
+DESCRIPTION="High-level C++ D-Bus library"
+HOMEPAGE="https://github.com/Kistler-Group/sdbus-cpp"
+SRC_URI="https://github.com/Kistler-Group/sdbus-cpp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ !systemd? ( https://github.com/systemd/systemd/archive/v${SDP##*-}/${SDP}.tar.gz )"
+LICENSE="LGPL-2.1+ Nokia-Qt-LGPL-Exception-1.1" # Nothing to do with Qt but exception text is exactly the same.
+SLOT="0/0"
+KEYWORDS="~amd64"
+IUSE="doc systemd test tools"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ !systemd? ( sys-libs/libcap )
+ systemd? ( >=sys-apps/systemd-236:= )
+ tools? ( dev-libs/expat )
+"
+
+# util-linux is needed for libmount when building libsystemd, but sdbus-c++
+# doesn't need it when subsequently linking libsystemd statically.
+
+DEPEND="
+ ${RDEPEND}
+ !systemd? ( sys-apps/util-linux )
+ test? ( >=dev-cpp/gtest-1.10.0 )
+"
+
+BDEPEND="
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen[dot] )
+ !systemd? (
+ ${PYTHON_DEPS}
+ $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
+ )
+"
+
+python_check_deps() {
+ has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
+}
+
+S="${WORKDIR}/sdbus-cpp-${PV}"
+SDS="${WORKDIR}/${SDP}"
+SDB="${WORKDIR}/systemd-build"
+
+pkg_setup() {
+ use systemd || python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ if ! use systemd; then
+ pushd "${SDS}" || die
+ eapply "${FILESDIR}"/${PN}-static-libsystemd.patch
+ popd || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ if ! use systemd; then
+ EMESON_SOURCE=${SDS} \
+ BUILD_DIR=${SDB} \
+ meson_src_configure \
+ --prefix "${WORKDIR}" \
+ --includedir "${SDP}/src" \
+ -Drootlibdir="${SDB}" \
+ -Dselinux=false \
+ -Dstatic-libsystemd=pic
+
+ # systemd doesn't generate the needed pkg-config file during configure.
+ BUILD_DIR=${SDB} \
+ meson_src_compile libsystemd.pc
+
+ # Need this present otherwise CMake generates the wrong linker args.
+ touch "${SDB}"/libsystemd.a || die
+ fi
+
+ local mycmakeargs=(
+ -DBUILD_CODE_GEN=$(usex tools)
+ -DBUILD_DOC=yes
+ -DBUILD_DOXYGEN_DOC=$(usex doc)
+ -DBUILD_LIBSYSTEMD=no
+ -DBUILD_TESTS=$(usex test)
+ )
+
+ PKG_CONFIG_PATH=${SDB}/src/libsystemd:${PKG_CONFIG_PATH} \
+ cmake_src_configure
+}
+
+src_compile() {
+ if ! use systemd; then
+ BUILD_DIR=${SDB} \
+ meson_src_compile version.h systemd:static_library
+ fi
+
+ cmake_src_compile all $(usev doc)
+}
+
+src_test() {
+ if ! cmp -s {"${S}"/tests/integrationtests/files,/etc/dbus-1/system.d}/org.sdbuscpp.integrationtests.conf; then
+ ewarn "Not running the tests as a D-Bus configuration file has not been"
+ ewarn "installed yet or has changed since. The tests can be run after"
+ ewarn "the package has been merged."
+ return
+ elif [[ ! -S /run/dbus/system_bus_socket ]]; then
+ ewarn "Not running the tests as the system-wide D-Bus daemon is unavailable."
+ return
+ fi
+
+ cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+ rm -v "${ED}"/usr/share/doc/${PF}/COPYING || die
+
+ if use test; then
+ # Delete installed test binaries.
+ rm -rv "${ED}"/opt || die
+ fi
+}
diff --git a/dev-cpp/sdbus-c++/sdbus-c++-1.1.0.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-1.1.0.ebuild
new file mode 100644
index 000000000000..7eee346da844
--- /dev/null
+++ b/dev-cpp/sdbus-c++/sdbus-c++-1.1.0.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit python-any-r1 meson cmake
+
+SDP="systemd-stable-250.4"
+DESCRIPTION="High-level C++ D-Bus library"
+HOMEPAGE="https://github.com/Kistler-Group/sdbus-cpp"
+SRC_URI="https://github.com/Kistler-Group/sdbus-cpp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ !systemd? ( https://github.com/systemd/systemd/archive/v${SDP##*-}/${SDP}.tar.gz )"
+LICENSE="LGPL-2.1+ Nokia-Qt-LGPL-Exception-1.1" # Nothing to do with Qt but exception text is exactly the same.
+SLOT="0/1"
+KEYWORDS="~amd64"
+IUSE="doc systemd test tools"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ !systemd? ( sys-libs/libcap )
+ systemd? ( >=sys-apps/systemd-236:= )
+ tools? ( dev-libs/expat )
+"
+
+# util-linux is needed for libmount when building libsystemd, but sdbus-c++
+# doesn't need it when subsequently linking libsystemd statically.
+
+DEPEND="
+ ${RDEPEND}
+ !systemd? ( sys-apps/util-linux )
+ test? ( >=dev-cpp/gtest-1.10.0 )
+"
+
+BDEPEND="
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen[dot] )
+ !systemd? (
+ ${PYTHON_DEPS}
+ $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]')
+ )
+"
+
+python_check_deps() {
+ has_version -b "dev-python/jinja[${PYTHON_USEDEP}]"
+}
+
+S="${WORKDIR}/sdbus-cpp-${PV}"
+SDS="${WORKDIR}/${SDP}"
+SDB="${WORKDIR}/systemd-build"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-gtest-1.11.patch
+)
+
+pkg_setup() {
+ use systemd || python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ if ! use systemd; then
+ pushd "${SDS}" || die
+ eapply "${FILESDIR}"/${PN}-static-libsystemd.patch
+ popd || die
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ if ! use systemd; then
+ EMESON_SOURCE=${SDS} \
+ BUILD_DIR=${SDB} \
+ meson_src_configure \
+ --prefix "${WORKDIR}" \
+ --includedir "${SDP}/src" \
+ -Drootlibdir="${SDB}" \
+ -Dselinux=false \
+ -Dstatic-libsystemd=pic
+
+ # systemd doesn't generate the needed pkg-config file during configure.
+ BUILD_DIR=${SDB} \
+ meson_src_compile libsystemd.pc
+
+ # Need this present otherwise CMake generates the wrong linker args.
+ touch "${SDB}"/libsystemd.a || die
+ fi
+
+ local mycmakeargs=(
+ -DBUILD_CODE_GEN=$(usex tools)
+ -DBUILD_DOC=yes
+ -DBUILD_DOXYGEN_DOC=$(usex doc)
+ -DBUILD_LIBSYSTEMD=no
+ -DBUILD_TESTS=$(usex test)
+ )
+
+ PKG_CONFIG_PATH=${SDB}/src/libsystemd:${PKG_CONFIG_PATH} \
+ cmake_src_configure
+}
+
+src_compile() {
+ if ! use systemd; then
+ BUILD_DIR=${SDB} \
+ meson_src_compile version.h systemd:static_library
+ fi
+
+ cmake_src_compile all $(usev doc)
+}
+
+src_test() {
+ if ! cmp -s {"${S}"/tests/integrationtests/files,/etc/dbus-1/system.d}/org.sdbuscpp.integrationtests.conf; then
+ ewarn "Not running the tests as a D-Bus configuration file has not been"
+ ewarn "installed yet or has changed since. The tests can be run after"
+ ewarn "the package has been merged."
+ return
+ elif [[ ! -S /run/dbus/system_bus_socket ]]; then
+ ewarn "Not running the tests as the system-wide D-Bus daemon is unavailable."
+ return
+ fi
+
+ cmake_src_test
+}
+
+src_install() {
+ cmake_src_install
+ rm -v "${ED}"/usr/share/doc/${PF}/COPYING || die
+
+ if use test; then
+ # Delete installed test binaries.
+ rm -rv "${ED}"/opt || die
+ fi
+}