From 30001ac6587e59b16d1a9ab52b7c9aaf216ed234 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Tue, 16 Aug 2022 13:27:43 +0100 Subject: dev-cpp/sdbus-c++: Bump to 1.2.0, bump systemd to fix glibc 2.36, drop old 1.1.0 Closes: https://bugs.gentoo.org/864985 Signed-off-by: James Le Cuirot --- dev-cpp/sdbus-c++/Manifest | 6 +- dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch | 58 --------- dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r3.ebuild | 141 -------------------- dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r4.ebuild | 141 ++++++++++++++++++++ dev-cpp/sdbus-c++/sdbus-c++-1.1.0-r3.ebuild | 145 --------------------- dev-cpp/sdbus-c++/sdbus-c++-1.2.0.ebuild | 141 ++++++++++++++++++++ 6 files changed, 285 insertions(+), 347 deletions(-) delete mode 100644 dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch delete mode 100644 dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r3.ebuild create mode 100644 dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r4.ebuild delete mode 100644 dev-cpp/sdbus-c++/sdbus-c++-1.1.0-r3.ebuild create mode 100644 dev-cpp/sdbus-c++/sdbus-c++-1.2.0.ebuild diff --git a/dev-cpp/sdbus-c++/Manifest b/dev-cpp/sdbus-c++/Manifest index 1a00744858e0..4702d52ddcd0 100644 --- a/dev-cpp/sdbus-c++/Manifest +++ b/dev-cpp/sdbus-c++/Manifest @@ -1,4 +1,4 @@ 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-musl-patches-250.4.tar.gz 28065 BLAKE2B b8366c4bb29705e3f41f07d0105c4d252d543aaac178e968663660eeb573da034813aa50a96c74ac78ae5efeea379e00df33c5a039ec828cf93450ed23786252 SHA512 66e41fab1873021913c32e3f43300ea7babd18a36e6543838ab7fab4c44f5590c6a7414dd50c7ee81e5513b0e5aa01cb6df4231e8e06c609d63011a32b524213 -DIST systemd-stable-250.6.tar.gz 11212534 BLAKE2B faf065dbe5c02d9d3311202f93b9ad8984c4c9d127d32c17f305b81046f9e29cfc731cdd4abbd073965f448f4e1dff81d80313896b346548d2640939ad509365 SHA512 b625d5fb419370d238cf72f2e59c8fa6782972d94746835bde3a64a7746edd1d5fad901bbb01311f858b7dbdff6d759518b615708bb835a81964c16878d5644e +DIST sdbus-c++-1.2.0.tar.gz 205798 BLAKE2B da040acb49f5294665b09df97c171eac38f7c6ce5e86093b45b896c4b216afc9b45870395404ffb8e7c32ac8b98f6c795fb528691b344587545e5ae27d4423d6 SHA512 dab2c4d9a5ea6d626672a5a6ee6f3490c60c6fdd160769801a4d6b4cf3df4983fad57ff0230132a5d637ec78a55993200ce217fa89461016e101865cc2777d7d +DIST systemd-musl-patches-251.2.tar.gz 28512 BLAKE2B 4ac6a5220dab8409962a3954af2fb2484af718d0f282129957236ce241fbe8538a90d507a96c7c3d86f4f408ab784a6888b37486405d3276e7734a1bd5aa9680 SHA512 6e56b62234ac54929faea5a7cad699d0b932f869b48e3ba4e1f349a88653b7c787efec24a09b00290c3dc566614e3c1dc2f3c04f04e943f513108a91eca1be82 +DIST systemd-stable-251.4.tar.gz 11440203 BLAKE2B 58a0ee4adcc9d35b15b9cc98b3da81d1103b61a6c0bee722468a5113cd7d6de1d40c46ef964ba9ecc4746e81b516ae4b2f1d046874d62db066735c652592612e SHA512 7bbfadd80b88a4c3510a5e4e3572e4eab71dafbf6289da038e552988e09ee8da16da3c9bb8a4fbbde6c6236e0e3c352b0a33f9ee0b84f10241f3499383387738 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 deleted file mode 100644 index e6d3622ee11f..000000000000 --- a/dev-cpp/sdbus-c++/files/sdbus-c++-gtest-1.11.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 7f437a6e06d2ec3abd3e2fd1101ab6aab386bc44 Mon Sep 17 00:00:00 2001 -From: Stanislav Angelovic -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& d) --{ -+void PrintTo(const ::std::chrono::duration& d, ::std::ostream* os) { - auto seconds = std::chrono::duration_cast>(d); -- return os << seconds.count() << " s"; -+ *os << seconds.count() << "s"; -+} -+ - } --}} - - #endif /* SDBUS_CPP_INTEGRATIONTESTS_DEFS_H_ */ diff --git a/dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r3.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r3.ebuild deleted file mode 100644 index 29193a2602d6..000000000000 --- a/dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r3.ebuild +++ /dev/null @@ -1,141 +0,0 @@ -# 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.6" -MUSL_PATCHSET="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/${SDP%-*}/archive/v${SDP##*-}/${SDP}.tar.gz - elibc_musl? ( - https://dev.gentoo.org/~floppym/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz - https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz - https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.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 - use elibc_musl && eapply "${WORKDIR}"/musl-patches - 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 \ - -Dgshadow=false \ - -Dsmack=false \ - -Dutmp=false - - # 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++-0.9.0-r4.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r4.ebuild new file mode 100644 index 000000000000..12f7585b9012 --- /dev/null +++ b/dev-cpp/sdbus-c++/sdbus-c++-0.9.0-r4.ebuild @@ -0,0 +1,141 @@ +# 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-251.4" +MUSL_PATCHSET="251.2" + +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/${SDP%-*}/archive/v${SDP##*-}/${SDP}.tar.gz + elibc_musl? ( + https://dev.gentoo.org/~floppym/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz + https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz + https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.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 + use elibc_musl && eapply "${WORKDIR}"/musl-patches + 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 \ + -Dgshadow=false \ + -Dsmack=false \ + -Dutmp=false + + # 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-r3.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-1.1.0-r3.ebuild deleted file mode 100644 index 29fe7c8f37f6..000000000000 --- a/dev-cpp/sdbus-c++/sdbus-c++-1.1.0-r3.ebuild +++ /dev/null @@ -1,145 +0,0 @@ -# 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.6" -MUSL_PATCHSET="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/${SDP%-*}/archive/v${SDP##*-}/${SDP}.tar.gz - elibc_musl? ( - https://dev.gentoo.org/~floppym/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz - https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz - https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.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 - use elibc_musl && eapply "${WORKDIR}"/musl-patches - 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 \ - -Dgshadow=false \ - -Dsmack=false \ - -Dutmp=false - - # 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.2.0.ebuild b/dev-cpp/sdbus-c++/sdbus-c++-1.2.0.ebuild new file mode 100644 index 000000000000..2ebb4f8fe333 --- /dev/null +++ b/dev-cpp/sdbus-c++/sdbus-c++-1.2.0.ebuild @@ -0,0 +1,141 @@ +# 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-251.4" +MUSL_PATCHSET="251.2" + +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/${SDP%-*}/archive/v${SDP##*-}/${SDP}.tar.gz + elibc_musl? ( + https://dev.gentoo.org/~floppym/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz + https://dev.gentoo.org/~gyakovlev/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.tar.gz + https://dev.gentoo.org/~soap/distfiles/systemd-musl-patches-${MUSL_PATCHSET}.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" + +pkg_setup() { + use systemd || python-any-r1_pkg_setup +} + +src_prepare() { + if ! use systemd; then + pushd "${SDS}" || die + use elibc_musl && eapply "${WORKDIR}"/musl-patches + 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 \ + -Dgshadow=false \ + -Dsmack=false \ + -Dutmp=false + + # 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 +} -- cgit v1.2.3-18-g5258