net-im/zoom: Several fixes.
[gentoo.git] / net-im / zoom / zoom-3.5.374815.0324-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit desktop eutils xdg-utils
7
8 DESCRIPTION="Video conferencing and web conferencing service"
9 HOMEPAGE="https://zoom.us/"
10 SRC_URI="amd64? ( https://zoom.us/client/${PV}/${PN}_x86_64.tar.xz -> ${P}_x86_64.tar.xz )
11         x86? ( https://zoom.us/client/${PV}/${PN}_i686.tar.xz -> ${P}_i686.tar.xz )"
12 S="${WORKDIR}/${PN}"
13
14 LICENSE="all-rights-reserved Apache-2.0" # Apache-2.0 for icon
15 SLOT="0"
16 KEYWORDS="-* ~amd64 ~x86"
17 IUSE="pulseaudio"
18 RESTRICT="mirror bindist strip"
19
20 RDEPEND="dev-libs/glib:2
21         dev-qt/qtcore:5
22         dev-qt/qtdbus:5
23         dev-qt/qtdeclarative:5
24         dev-qt/qtgraphicaleffects:5
25         dev-qt/qtgui:5
26         dev-qt/qtnetwork:5
27         dev-qt/qtpositioning:5
28         dev-qt/qtprintsupport:5
29         dev-qt/qtquickcontrols:5
30         dev-qt/qtscript:5
31         dev-qt/qtwebchannel:5
32         dev-qt/qtwebengine:5
33         dev-qt/qtwidgets:5
34         media-libs/libglvnd
35         media-libs/libjpeg-turbo
36         sys-apps/dbus
37         sys-apps/util-linux
38         x11-libs/libX11
39         x11-libs/libxcb
40         x11-libs/libXext
41         x11-libs/libXfixes
42         x11-libs/libXtst
43         x11-libs/xcb-util-image
44         x11-libs/xcb-util-keysyms
45         pulseaudio? ( media-sound/pulseaudio )"
46
47 BDEPEND="!pulseaudio? ( dev-util/bbe )"
48
49 QA_PREBUILT="opt/zoom/*"
50
51 src_prepare() {
52         default
53         if ! use pulseaudio; then
54                 # For some strange reason, zoom cannot use any ALSA sound devices if
55                 # it finds libpulse. This causes breakage if media-sound/apulse[sdk]
56                 # is installed. So, force zoom to ignore libpulse.
57                 bbe -e 's/libpulse.so/IgNoRePuLsE/' zoom >zoom.tmp || die
58                 mv zoom.tmp zoom || die
59         fi
60 }
61
62 src_install() {
63         insinto /opt/zoom
64         exeinto /opt/zoom
65         doins -r json sip timezones translations
66         doins *.pcm *.pem *.sh Embedded.properties version.txt
67         use amd64 && doins icudtl.dat
68         doexe zoom{,.sh,linux} zopen ZoomLauncher
69         dosym {"../../usr/$(get_libdir)",/opt/zoom}/libturbojpeg.so #715106
70
71         make_wrapper zoom ./zoom /opt/zoom
72         make_desktop_entry "zoom %U" Zoom zoom-videocam "" \
73                                            "MimeType=x-scheme-handler/zoommtg;application/x-zoom;"
74         # The tarball doesn't contain an icon, so take a generic camera icon
75         # from https://github.com/google/material-design-icons, modified to be
76         # white on a blue background
77         doicon "${FILESDIR}"/zoom-videocam.svg
78 }
79
80 pkg_postinst() {
81         xdg_desktop_database_update
82 }
83
84 pkg_postrm() {
85         xdg_desktop_database_update
86 }