*/*: [QA] Use consistent function definition formatting
[gentoo.git] / x11-misc / synergy / synergy-1.9.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils desktop gnome2-utils
7
8 DESCRIPTION="Lets you easily share a single mouse and keyboard between multiple computers"
9 HOMEPAGE="https://symless.com/synergy https://github.com/symless/synergy-core"
10 SRC_URI="
11         https://github.com/symless/${PN}-core/archive/v${PV}-stable.tar.gz -> ${P}.tar.gz
12         https://dev.gentoo.org/~jer/${PN}.png
13 "
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~sparc-solaris ~x86-solaris"
18 IUSE="libressl qt5"
19 RESTRICT="test"
20
21 S=${WORKDIR}/${PN}-core-${PV}-stable
22
23 COMMON_DEPEND="
24         !libressl? ( dev-libs/openssl:= )
25         libressl? ( dev-libs/libressl:= )
26         net-misc/curl
27         x11-libs/libICE
28         x11-libs/libSM
29         x11-libs/libX11
30         x11-libs/libXext
31         x11-libs/libXi
32         x11-libs/libXinerama
33         x11-libs/libXrandr
34         x11-libs/libXtst
35         qt5? (
36                 dev-qt/qtcore:5
37                 dev-qt/qtgui:5
38                 dev-qt/qtnetwork:5
39                 dev-qt/qtwidgets:5
40                 net-dns/avahi[mdnsresponder-compat]
41         )
42 "
43 DEPEND="
44         ${COMMON_DEPEND}
45         x11-base/xorg-proto
46 "
47 RDEPEND="
48         ${COMMON_DEPEND}
49         qt5? ( !x11-misc/qsynergy )
50 "
51
52 DOCS=( ChangeLog doc/synergy.conf.example{,-advanced,-basic} )
53
54 PATCHES=(
55         "${FILESDIR}"/${P}-pthread.patch
56         "${FILESDIR}"/${P}-internal-gmock-gtest.patch
57         "${FILESDIR}"/${P}-gtest.patch
58         "${FILESDIR}"/${P}-cmake-version.patch
59         "${FILESDIR}"/${P}-qt-5.11.patch
60 )
61
62 src_configure() {
63         local mycmakeargs=(
64                 -DSYNERGY_BUILD_LEGACY_GUI=$(usex qt5)
65                 -DSYNERGY_BUILD_LEGACY_INSTALLER=OFF
66         )
67
68         cmake-utils_src_configure
69 }
70
71 src_install() {
72         dobin "${BUILD_DIR}"/bin/{synergy{c,s},syntool}
73
74         if use qt5 ; then
75                 newbin "${BUILD_DIR}"/bin/${PN} qsynergy
76                 newicon -s 256 "${DISTDIR}"/${PN}.png q${PN}.png
77                 make_desktop_entry q${PN} ${PN/s/S} q${PN} Utility;
78         fi
79
80         insinto /etc
81         newins doc/synergy.conf.example synergy.conf
82
83         newman doc/${PN}c.man ${PN}c.1
84         newman doc/${PN}s.man ${PN}s.1
85
86         einstalldocs
87 }
88
89 pkg_preinst() {
90         use qt5 && gnome2_icon_savelist
91 }
92
93 pkg_postinst() {
94         use qt5 && gnome2_icon_cache_update
95 }
96
97 pkg_postrm() {
98         use qt5 && gnome2_icon_cache_update
99 }