diff options
author | James Le Cuirot <chewi@gentoo.org> | 2020-08-22 16:51:10 +0100 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2020-08-22 16:53:25 +0100 |
commit | ebd3037d307585561792b7527ff3050f193fc88e (patch) | |
tree | 277f786c6acc63386c4c03b3c485216cbe279d0b /x11-misc | |
parent | package.mask: Last rite dev-python/pygtk (diff) | |
download | gentoo-ebd3037d307585561792b7527ff3050f193fc88e.tar.gz gentoo-ebd3037d307585561792b7527ff3050f193fc88e.tar.bz2 gentoo-ebd3037d307585561792b7527ff3050f193fc88e.zip |
x11-misc/barrier: Version bump to 2.3.3
Closes: https://bugs.gentoo.org/736814
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'x11-misc')
-rw-r--r-- | x11-misc/barrier/Manifest | 1 | ||||
-rw-r--r-- | x11-misc/barrier/barrier-2.3.3.ebuild | 83 | ||||
-rw-r--r-- | x11-misc/barrier/files/barrier-2.3.3-gtest.patch | 116 | ||||
-rw-r--r-- | x11-misc/barrier/files/barrier-2.3.3-tests.patch | 150 |
4 files changed, 350 insertions, 0 deletions
diff --git a/x11-misc/barrier/Manifest b/x11-misc/barrier/Manifest index 7630b04f56f7..8870062b2d6c 100644 --- a/x11-misc/barrier/Manifest +++ b/x11-misc/barrier/Manifest @@ -1 +1,2 @@ DIST barrier-2.3.2.tar.gz 7244128 BLAKE2B 263be99ffb692e5b8e3e3450565fbaf5c5e2f23beca4beaf5d699547933be1bcdcbf1ed6b9ce8bd53f2a5dbb1eba3fc06490620555520fcff0e8d34ff2ad52cb SHA512 0452244afc3294aaafd89f18d2472e24fb2fc62426e7be91ab4ffceca4697c7acb8f4438fc299835f1312f0ada83911679abe6b8e1268631130c5877e193ff83 +DIST barrier-2.3.3.tar.gz 5465909 BLAKE2B 3f881526f53113e48f1ea2e1592ebf2e932a8296fcba331243678963945001e7700dddc3bf8957f85285aec02c3d3700d31786cef291862a9b21780ee9e96cd6 SHA512 1ac945ce090d5bbdae7bab7d4ca802cc2d54c1644a12088203b240e38078d32d3b30ae2f764ba27d66c9d709e430b0eb1b4576314d99dd6177d8b88d19b89777 diff --git a/x11-misc/barrier/barrier-2.3.3.ebuild b/x11-misc/barrier/barrier-2.3.3.ebuild new file mode 100644 index 000000000000..502083619611 --- /dev/null +++ b/x11-misc/barrier/barrier-2.3.3.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit desktop virtualx xdg cmake + +DESCRIPTION="Share a mouse and keyboard between computers (fork of Synergy)" +HOMEPAGE="https://github.com/debauchee/barrier" +SRC_URI="https://github.com/debauchee/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="gui libressl test" +RESTRICT="!test? ( test )" + +RDEPEND=" + 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 + gui? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 + net-dns/avahi[mdnsresponder-compat] + ) + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) +" +DEPEND=" + ${RDEPEND} + dev-cpp/gtest + x11-base/xorg-proto +" + +PATCHES=( + "${FILESDIR}"/${P}-tests.patch + "${FILESDIR}"/${P}-gtest.patch +) + +DOCS=( + ChangeLog + README.md + doc/${PN}.conf.example{,-advanced,-basic} +) + +src_configure() { + local mycmakeargs=( + -DBARRIER_BUILD_GUI=$(usex gui) + -DBARRIER_BUILD_INSTALLER=OFF + -DBARRIER_BUILD_TESTS=$(usex test) + -DBARRIER_REVISION=00000000 + -DBARRIER_USE_EXTERNAL_GTEST=ON + -DBARRIER_VERSION_STAGE=gentoo + ) + + cmake_src_configure +} + +src_test() { + "${BUILD_DIR}"/bin/unittests || die + virtx "${BUILD_DIR}"/bin/integtests || die +} + +src_install() { + cmake_src_install + einstalldocs + doman doc/${PN}{c,s}.1 + + if use gui; then + doicon -s scalable res/${PN}.svg + doicon -s 256 res/${PN}.png + make_desktop_entry ${PN} Barrier ${PN} Utility + fi +} diff --git a/x11-misc/barrier/files/barrier-2.3.3-gtest.patch b/x11-misc/barrier/files/barrier-2.3.3-gtest.patch new file mode 100644 index 000000000000..363f8c2c02c0 --- /dev/null +++ b/x11-misc/barrier/files/barrier-2.3.3-gtest.patch @@ -0,0 +1,116 @@ +From bd1db368b333783697d686c82c42e48c4bec8b9e Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Fri, 21 Aug 2020 23:13:58 +0100 +Subject: [PATCH] Add BARRIER_USE_EXTERNAL_GTEST CMake option to use external + GTest + +--- + CMakeLists.txt | 1 + + src/test/CMakeLists.txt | 38 ++++++++++++++++++++---------- + src/test/integtests/CMakeLists.txt | 4 +--- + src/test/unittests/CMakeLists.txt | 4 +--- + 4 files changed, 29 insertions(+), 18 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4947d20f..18b242db 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,6 +21,7 @@ project (barrier C CXX) + option (BARRIER_BUILD_GUI "Build the GUI" ON) + option (BARRIER_BUILD_INSTALLER "Build the installer" ON) + option (BARRIER_BUILD_TESTS "Build the tests" ON) ++option (BARRIER_USE_EXTERNAL_GTEST "Use external installation of Google Test framework" OFF) + + set (CMAKE_EXPORT_COMPILE_COMMANDS ON) + set (CMAKE_CXX_STANDARD 14) +diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt +index daecb317..4a50e701 100644 +--- a/src/test/CMakeLists.txt ++++ b/src/test/CMakeLists.txt +@@ -14,19 +14,33 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see <http://www.gnu.org/licenses/>. + +-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 (BARRIER_USE_EXTERNAL_GTEST) ++ include (FindPkgConfig) ++ find_package(GTest REQUIRED) ++ pkg_check_modules(GMOCK REQUIRED gmock) ++ include_directories( ++ ${GTEST_INCLUDE_DIRS} ++ ${GMOCK_INCLUDE_DIRS} ++ ) ++else() ++ include_directories( ++ ../../ext/gtest ++ ../../ext/gtest/include ++ ../../ext/gmock ++ ../../ext/gmock/include ++ ) + +-if (UNIX) +- # ignore warnings in gtest and gmock +- set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w") +- set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") ++ add_library(gtest STATIC ../../ext/gtest/src/gtest-all.cc) ++ add_library(gmock STATIC ../../ext/gmock/src/gmock-all.cc) ++ ++ set(GTEST_LIBRARIES gtest) ++ set(GMOCK_LIBRARIES gmock) ++ ++ 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() + endif() + + add_subdirectory(integtests) +diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt +index 0460d8df..9ef875bd 100644 +--- a/src/test/integtests/CMakeLists.txt ++++ b/src/test/integtests/CMakeLists.txt +@@ -68,8 +68,6 @@ endif() + + include_directories( + ../../ +- ../../../ext/gtest/include +- ../../../ext/gmock/include + ) + + if (UNIX) +@@ -80,4 +78,4 @@ endif() + + add_executable(integtests ${sources}) + target_link_libraries(integtests +- arch base client common io ipc mt net platform server synlib gtest gmock ${libs} ${OPENSSL_LIBS}) ++ arch base client common io ipc mt net platform server synlib ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} ${libs} ${OPENSSL_LIBS}) +diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt +index c46375ce..61a0d35f 100644 +--- a/src/test/unittests/CMakeLists.txt ++++ b/src/test/unittests/CMakeLists.txt +@@ -50,8 +50,6 @@ list(APPEND headers ${platform_sources}) + + include_directories( + ../../ +- ../../../ext/gtest/include +- ../../../ext/gmock/include + ../../../ext + ) + +@@ -67,4 +65,4 @@ endif() + + add_executable(unittests ${sources}) + target_link_libraries(unittests +- arch base client server common io net platform server synlib mt ipc gtest gmock ${libs} ${OPENSSL_LIBS}) ++ arch base client server common io net platform server synlib mt ipc ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} ${libs} ${OPENSSL_LIBS}) +-- +2.26.2 + diff --git a/x11-misc/barrier/files/barrier-2.3.3-tests.patch b/x11-misc/barrier/files/barrier-2.3.3-tests.patch new file mode 100644 index 000000000000..a4cc0d665a07 --- /dev/null +++ b/x11-misc/barrier/files/barrier-2.3.3-tests.patch @@ -0,0 +1,150 @@ +From 4a031b8ce538af0c15857c37c1964bf144d5bc38 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Fri, 21 Aug 2020 22:22:48 +0100 +Subject: [PATCH] Add BARRIER_BUILD_TESTS CMake option to make tests optional + +--- + CMakeLists.txt | 2 +- + src/CMakeLists.txt | 5 ++++- + src/lib/barrier/KeyMap.h | 4 ++++ + src/test/unittests/barrier/KeyMapTests.cpp | 2 ++ + 4 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6a377c04..4947d20f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,7 @@ project (barrier C CXX) + + option (BARRIER_BUILD_GUI "Build the GUI" ON) + option (BARRIER_BUILD_INSTALLER "Build the installer" ON) ++option (BARRIER_BUILD_TESTS "Build the tests" ON) + + set (CMAKE_EXPORT_COMPILE_COMMANDS ON) + set (CMAKE_CXX_STANDARD 14) +@@ -49,7 +50,6 @@ else() + endif() + + set (libs) +-include_directories (BEFORE SYSTEM ./ext/gtest/include) + + if (UNIX) + if (NOT APPLE) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 55aad09d..c3dea51f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -19,7 +19,10 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/lib) + + add_subdirectory(lib) + add_subdirectory(cmd) +-add_subdirectory(test) ++ ++if (BARRIER_BUILD_TESTS) ++ add_subdirectory(test) ++endif() + + if (BARRIER_BUILD_GUI) + add_subdirectory(gui) +diff --git a/src/lib/barrier/KeyMap.h b/src/lib/barrier/KeyMap.h +index b6eb8658..812b4d26 100644 +--- a/src/lib/barrier/KeyMap.h ++++ b/src/lib/barrier/KeyMap.h +@@ -24,7 +24,9 @@ + #include "common/stdset.h" + #include "common/stdvector.h" + ++#ifdef TEST_ENV + #include <gtest/gtest_prod.h> ++#endif + + namespace barrier { + +@@ -327,6 +329,7 @@ public: + //@} + + private: ++#ifdef TEST_ENV + FRIEND_TEST(KeyMapTests, + findBestKey_requiredDown_matchExactFirstItem); + FRIEND_TEST(KeyMapTests, +@@ -340,6 +343,7 @@ private: + FRIEND_TEST(KeyMapTests, + findBestKey_onlyOneRequiredDown_matchTwoRequiredChangesItem); + FRIEND_TEST(KeyMapTests, findBestKey_noRequiredDown_cannotMatch); ++#endif + + private: + //! Ways to synthesize a key +diff --git a/src/test/unittests/barrier/KeyMapTests.cpp b/src/test/unittests/barrier/KeyMapTests.cpp +index 59806339..c0832199 100644 +--- a/src/test/unittests/barrier/KeyMapTests.cpp ++++ b/src/test/unittests/barrier/KeyMapTests.cpp +@@ -15,6 +15,8 @@ + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + ++#define TEST_ENV ++ + #include "barrier/KeyMap.h" + + #include "test/global/gtest.h" +-- +2.26.2 + +From 19e020080cb3f54befb504abc48cf304ab42f23e Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Sat, 22 Aug 2020 11:46:25 +0100 +Subject: [PATCH] Respect DISPLAY environment variable in XWindows tests + +XWindowsScreenTests was failing under Gentoo's package manager. I have +also addressed this in XWindowsScreenSaverTests, which is currently +unused. +--- + src/test/integtests/platform/XWindowsScreenSaverTests.cpp | 7 ++++++- + src/test/integtests/platform/XWindowsScreenTests.cpp | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/test/integtests/platform/XWindowsScreenSaverTests.cpp b/src/test/integtests/platform/XWindowsScreenSaverTests.cpp +index c6a2710c..1ee273ed 100644 +--- a/src/test/integtests/platform/XWindowsScreenSaverTests.cpp ++++ b/src/test/integtests/platform/XWindowsScreenSaverTests.cpp +@@ -30,7 +30,12 @@ using ::testing::_; + // TODO: not working on build machine for some reason + TEST(CXWindowsScreenSaverTests, activate_defaultScreen_todo) + { +- Display* display = XOpenDisplay(":0.0"); ++ const char* displayName = getenv("DISPLAY"); ++ if (displayName == NULL) { ++ displayName = ":0.0"; ++ } ++ ++ Display* display = XOpenDisplay(displayName); + Window window = DefaultRootWindow(display); + MockEventQueue eventQueue; + EXPECT_CALL(eventQueue, removeHandler(_, _)).Times(1); +diff --git a/src/test/integtests/platform/XWindowsScreenTests.cpp b/src/test/integtests/platform/XWindowsScreenTests.cpp +index d8f75e15..97358197 100644 +--- a/src/test/integtests/platform/XWindowsScreenTests.cpp ++++ b/src/test/integtests/platform/XWindowsScreenTests.cpp +@@ -25,11 +25,16 @@ using ::testing::_; + + TEST(CXWindowsScreenTests, fakeMouseMove_nonPrimary_getCursorPosValuesCorrect) + { ++ const char* displayName = getenv("DISPLAY"); ++ if (displayName == NULL) { ++ displayName = ":0.0"; ++ } ++ + MockEventQueue eventQueue; + EXPECT_CALL(eventQueue, adoptHandler(_, _, _)).Times(2); + EXPECT_CALL(eventQueue, adoptBuffer(_)).Times(2); + EXPECT_CALL(eventQueue, removeHandler(_, _)).Times(2); +- XWindowsScreen screen(new XWindowsImpl(), ":0.0", false, false, 0, &eventQueue); ++ XWindowsScreen screen(new XWindowsImpl(), displayName, false, false, 0, &eventQueue); + + screen.fakeMouseMove(10, 20); + +-- +2.26.2 + |