www-client/opera: Version 60.0.3255.109
[gentoo.git] / www-client / opera / opera-60.0.3255.95.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 CHROMIUM_LANGS="
6         be bg bn ca cs da de el en-GB en-US es-419 es fil fi fr-CA fr hi hr hu id
7         it ja ko lt lv ms nb nl pl pt-BR pt-PT ro ru sk sr sv sw ta te th tr uk vi
8         zh-CN zh-TW
9
10 "
11 inherit chromium-2 multilib unpacker xdg-utils
12
13 DESCRIPTION="A fast and secure web browser"
14 HOMEPAGE="https://www.opera.com/"
15 LICENSE="OPERA-2014"
16 SLOT="0"
17 SRC_URI_BASE="
18         https://download1.operacdn.com/pub/
19         https://download2.operacdn.com/pub/
20         https://download3.operacdn.com/pub/
21         https://download4.operacdn.com/pub/
22 "
23 for uri in ${SRC_URI_BASE}; do
24 SRC_URI+="
25         "${uri}${PN}/desktop/${PV}/linux/${PN}-stable_${PV}_amd64.deb"
26 "
27 done
28 KEYWORDS="~amd64"
29
30 RDEPEND="
31         dev-libs/expat
32         dev-libs/glib:2
33         dev-libs/nspr
34         dev-libs/nss
35         gnome-base/gconf:2
36         media-libs/alsa-lib
37         media-libs/fontconfig
38         media-libs/freetype
39         net-misc/curl
40         net-print/cups
41         sys-apps/dbus
42         x11-libs/cairo
43         x11-libs/gdk-pixbuf
44         x11-libs/gtk+:3
45         x11-libs/libX11
46         x11-libs/libXScrnSaver
47         x11-libs/libXcomposite
48         x11-libs/libXcursor
49         x11-libs/libXdamage
50         x11-libs/libXext
51         x11-libs/libXfixes
52         x11-libs/libXi
53         x11-libs/libXrandr
54         x11-libs/libXrender
55         x11-libs/libXtst
56         x11-libs/libnotify
57         x11-libs/pango[X]
58 "
59
60 QA_PREBUILT="*"
61 S=${WORKDIR}
62
63 src_unpack() {
64         unpack_deb ${A}
65 }
66
67 src_prepare() {
68         default
69
70         OPERA_HOME="usr/$(get_libdir)/${PN}"
71
72         case ${ARCH} in
73                 amd64)
74                         mv usr/lib/x86_64-linux-gnu usr/$(get_libdir) || die
75                         rm -r usr/lib || die
76                         ;;
77         esac
78
79         rm usr/bin/${PN} || die
80
81         rm usr/share/doc/${PN}-stable/copyright || die
82         mv usr/share/doc/${PN}-stable usr/share/doc/${PF} || die
83         gunzip usr/share/doc/${PF}/changelog.gz || die
84
85         pushd "${OPERA_HOME}"/localization > /dev/null || die
86         chromium_remove_language_paks
87         popd > /dev/null || die
88
89         sed -i \
90                 -e 's|^TargetEnvironment|X-&|g' \
91                 usr/share/applications/${PN}.desktop || die
92 }
93
94 src_install() {
95         rm "${OPERA_HOME}"/${PN}_autoupdate || die
96         mv * "${D}" || die
97         dosym ../$(get_libdir)/${PN}/${PN} /usr/bin/${PN}
98         fperms 4711 /"${OPERA_HOME}"/opera_sandbox
99 }
100
101 pkg_postrm() {
102         xdg_icon_cache_update
103         xdg_desktop_database_update
104         xdg_mimeinfo_database_update
105 }
106
107 pkg_postinst() {
108         xdg_icon_cache_update
109         xdg_desktop_database_update
110         xdg_mimeinfo_database_update
111 }