From 4a6e82ab8fdfe2c9c7c2b0398a7c429c56534552 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Mon, 30 Nov 2020 09:59:55 +0100 Subject: x11-misc/synergy: Reenable tests in 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- x11-misc/synergy/files/synergy-1.9.1-gtest.patch | 28 ----- .../files/synergy-1.9.1-internal-gmock-gtest.patch | 23 ---- x11-misc/synergy/files/synergy-1.9.1-test.patch | 33 ++++++ x11-misc/synergy/synergy-1.9.1-r1.ebuild | 121 +++++++++++++++++++++ x11-misc/synergy/synergy-1.9.1.ebuild | 99 ----------------- 5 files changed, 154 insertions(+), 150 deletions(-) delete mode 100644 x11-misc/synergy/files/synergy-1.9.1-gtest.patch delete mode 100644 x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch create mode 100644 x11-misc/synergy/files/synergy-1.9.1-test.patch create mode 100644 x11-misc/synergy/synergy-1.9.1-r1.ebuild delete mode 100644 x11-misc/synergy/synergy-1.9.1.ebuild diff --git a/x11-misc/synergy/files/synergy-1.9.1-gtest.patch b/x11-misc/synergy/files/synergy-1.9.1-gtest.patch deleted file mode 100644 index f7a5e614e810..000000000000 --- a/x11-misc/synergy/files/synergy-1.9.1-gtest.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/lib/synergy/KeyMap.h -+++ b/src/lib/synergy/KeyMap.h -@@ -24,7 +24,9 @@ - #include "common/stdset.h" - #include "common/stdvector.h" - -+#if WITH_GENTOO_TEST - #include -+#endif - - namespace synergy { - -@@ -327,6 +329,7 @@ - //@} - - -+#if WITH_GENTOO_TEST - private: - FRIEND_TEST(KeyMapTests, - findBestKey_requiredDown_matchExactFirstItem); -@@ -341,6 +344,7 @@ - FRIEND_TEST(KeyMapTests, - findBestKey_onlyOneRequiredDown_matchTwoRequiredChangesItem); - FRIEND_TEST(KeyMapTests, findBestKey_noRequiredDown_cannotMatch); -+#endif - - private: - //! Ways to synthesize a key diff --git a/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch b/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch deleted file mode 100644 index bc8a96130575..000000000000 --- a/x11-misc/synergy/files/synergy-1.9.1-internal-gmock-gtest.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/test/CMakeLists.txt -+++ b/src/test/CMakeLists.txt -@@ -14,20 +14,5 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - --include_directories( -- ../../ext/gtest -- ../../ext/gtest/include -- ../../ext/gmock -- ../../ext/gmock/include) -- --add_library(gtest STATIC ../../ext/gtest/src/gtest-all.cc) --add_library(gmock STATIC ../../ext/gmock/src/gmock-all.cc) -- --if (UNIX) -- # ignore warnings in gtest and gmock -- set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w") -- set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") --endif() -- - add_subdirectory(integtests) - add_subdirectory(unittests) diff --git a/x11-misc/synergy/files/synergy-1.9.1-test.patch b/x11-misc/synergy/files/synergy-1.9.1-test.patch new file mode 100644 index 000000000000..d0c44e9dd7ff --- /dev/null +++ b/x11-misc/synergy/files/synergy-1.9.1-test.patch @@ -0,0 +1,33 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index ab63a06..ec7a3e0 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -22,3 +22,8 @@ add_subdirectory(cmd) + if (SYNERGY_BUILD_LEGACY_GUI) + add_subdirectory(gui) + endif (SYNERGY_BUILD_LEGACY_GUI) ++ ++option(BUILD_TESTS "Build tests" OFF) ++if (BUILD_TESTS) ++ add_subdirectory(test) ++endif() +diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt +index f39968a..bfc886c 100644 +--- a/src/test/integtests/CMakeLists.txt ++++ b/src/test/integtests/CMakeLists.txt +@@ -68,4 +68,4 @@ endif() + + add_executable(integtests ${sources}) + target_link_libraries(integtests +- arch base client common io ipc mt net platform server synergy gtest gmock ${libs} ${OPENSSL_LIBS}) ++ arch base client common io ipc mt net platform server gtest gmock ${libs} ${OPENSSL_LIBS}) +diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt +index 54131eb..ef84dba 100644 +--- a/src/test/unittests/CMakeLists.txt ++++ b/src/test/unittests/CMakeLists.txt +@@ -68,4 +68,4 @@ endif() + + add_executable(unittests ${sources}) + target_link_libraries(unittests +- arch base client server common io net platform server synergy mt ipc gtest gmock shared ${libs} ${OPENSSL_LIBS}) ++ arch base client server common io net platform server mt ipc gtest gmock shared ${libs} ${OPENSSL_LIBS}) diff --git a/x11-misc/synergy/synergy-1.9.1-r1.ebuild b/x11-misc/synergy/synergy-1.9.1-r1.ebuild new file mode 100644 index 000000000000..021b8d2d54b8 --- /dev/null +++ b/x11-misc/synergy/synergy-1.9.1-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit cmake-utils desktop gnome2-utils virtualx + +DESCRIPTION="Lets you easily share a single mouse and keyboard between multiple computers" +HOMEPAGE="https://symless.com/synergy https://github.com/symless/synergy-core" +SRC_URI=" + https://github.com/symless/${PN}-core/archive/v${PV}-stable.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~jer/${PN}.png +" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris" +IUSE="libressl qt5 test" +RESTRICT="!test? ( test )" + +S=${WORKDIR}/${PN}-core-${PV}-stable + +COMMON_DEPEND=" + !libressl? ( dev-libs/openssl:= ) + libressl? ( dev-libs/libressl:= ) + net-misc/curl + x11-libs/libICE + x11-libs/libSM + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXinerama + x11-libs/libXrandr + x11-libs/libXtst + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 + net-dns/avahi[mdnsresponder-compat] + ) +" +DEPEND=" + ${COMMON_DEPEND} + x11-base/xorg-proto +" +RDEPEND=" + ${COMMON_DEPEND} + qt5? ( !x11-misc/qsynergy ) +" + +DOCS=( ChangeLog doc/synergy.conf.example{,-advanced,-basic} ) + +PATCHES=( + "${FILESDIR}"/${P}-pthread.patch + "${FILESDIR}"/${P}-cmake-version.patch + "${FILESDIR}"/${P}-qt-5.11.patch + "${FILESDIR}"/${P}-test.patch +) + +src_prepare() { + # requires Internet, and relies on old site anyway + rm src/test/integtests/arch/ArchInternetTests.cpp || die + # broken on Xvfb + rm src/test/integtests/platform/XWindowsScreenTests.cpp || die + + cmake-utils_src_prepare +} + +src_configure() { + # otherwise unit tests segfault + local -x CFLAGS="${CFLAGS} -O0" + local -x CXXFLAGS="${CXXFLAGS} -O0" + + local mycmakeargs=( + -DSYNERGY_BUILD_LEGACY_GUI=$(usex qt5) + -DSYNERGY_BUILD_LEGACY_INSTALLER=OFF + -DBUILD_TESTS=$(usex test) + ) + + cmake-utils_src_configure +} + +my_test() { + "${BUILD_DIR}"/bin/unittests && + "${BUILD_DIR}"/bin/integtests +} + +src_test() { + virtx my_test +} + +src_install() { + dobin "${BUILD_DIR}"/bin/{synergy{c,s},syntool} + + if use qt5 ; then + newbin "${BUILD_DIR}"/bin/${PN} qsynergy + newicon -s 256 "${DISTDIR}"/${PN}.png q${PN}.png + make_desktop_entry q${PN} ${PN/s/S} q${PN} Utility; + fi + + insinto /etc + newins doc/synergy.conf.example synergy.conf + + newman doc/${PN}c.man ${PN}c.1 + newman doc/${PN}s.man ${PN}s.1 + + einstalldocs +} + +pkg_preinst() { + use qt5 && gnome2_icon_savelist +} + +pkg_postinst() { + use qt5 && gnome2_icon_cache_update +} + +pkg_postrm() { + use qt5 && gnome2_icon_cache_update +} diff --git a/x11-misc/synergy/synergy-1.9.1.ebuild b/x11-misc/synergy/synergy-1.9.1.ebuild deleted file mode 100644 index 0c5c3b75592b..000000000000 --- a/x11-misc/synergy/synergy-1.9.1.ebuild +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit cmake-utils desktop gnome2-utils - -DESCRIPTION="Lets you easily share a single mouse and keyboard between multiple computers" -HOMEPAGE="https://symless.com/synergy https://github.com/symless/synergy-core" -SRC_URI=" - https://github.com/symless/${PN}-core/archive/v${PV}-stable.tar.gz -> ${P}.tar.gz - https://dev.gentoo.org/~jer/${PN}.png -" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="libressl qt5" -RESTRICT="test" - -S=${WORKDIR}/${PN}-core-${PV}-stable - -COMMON_DEPEND=" - !libressl? ( dev-libs/openssl:= ) - libressl? ( dev-libs/libressl:= ) - net-misc/curl - x11-libs/libICE - x11-libs/libSM - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXi - x11-libs/libXinerama - x11-libs/libXrandr - x11-libs/libXtst - qt5? ( - dev-qt/qtcore:5 - dev-qt/qtgui:5 - dev-qt/qtnetwork:5 - dev-qt/qtwidgets:5 - net-dns/avahi[mdnsresponder-compat] - ) -" -DEPEND=" - ${COMMON_DEPEND} - x11-base/xorg-proto -" -RDEPEND=" - ${COMMON_DEPEND} - qt5? ( !x11-misc/qsynergy ) -" - -DOCS=( ChangeLog doc/synergy.conf.example{,-advanced,-basic} ) - -PATCHES=( - "${FILESDIR}"/${P}-pthread.patch - "${FILESDIR}"/${P}-internal-gmock-gtest.patch - "${FILESDIR}"/${P}-gtest.patch - "${FILESDIR}"/${P}-cmake-version.patch - "${FILESDIR}"/${P}-qt-5.11.patch -) - -src_configure() { - local mycmakeargs=( - -DSYNERGY_BUILD_LEGACY_GUI=$(usex qt5) - -DSYNERGY_BUILD_LEGACY_INSTALLER=OFF - ) - - cmake-utils_src_configure -} - -src_install() { - dobin "${BUILD_DIR}"/bin/{synergy{c,s},syntool} - - if use qt5 ; then - newbin "${BUILD_DIR}"/bin/${PN} qsynergy - newicon -s 256 "${DISTDIR}"/${PN}.png q${PN}.png - make_desktop_entry q${PN} ${PN/s/S} q${PN} Utility; - fi - - insinto /etc - newins doc/synergy.conf.example synergy.conf - - newman doc/${PN}c.man ${PN}c.1 - newman doc/${PN}s.man ${PN}s.1 - - einstalldocs -} - -pkg_preinst() { - use qt5 && gnome2_icon_savelist -} - -pkg_postinst() { - use qt5 && gnome2_icon_cache_update -} - -pkg_postrm() { - use qt5 && gnome2_icon_cache_update -} -- cgit v1.2.3-65-gdbad