www-client/opera-developer: Version 69.0.3686.0
[gentoo.git] / www-client / opera-developer / opera-developer-69.0.3660.0.ebuild
1 # Copyright 1999-2020 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 es es-419 fi fil fr fr-CA hi hr hu id it
7         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 inherit chromium-2 multilib unpacker xdg-utils
11
12 DESCRIPTION="A fast and secure web browser"
13 HOMEPAGE="https://www.opera.com/"
14 LICENSE="OPERA-2014"
15 SLOT="0"
16 SRC_URI_BASE="
17         https://download1.operacdn.com/pub/
18         https://download2.operacdn.com/pub/
19         https://download3.operacdn.com/pub/
20         https://download4.operacdn.com/pub/
21 "
22 SRC_URI="amd64? ("
23 for uri in ${SRC_URI_BASE}; do
24 SRC_URI+="
25         "${uri}${PN}/${PV}/linux/${PN}_${PV}_amd64.deb"
26 "
27 done
28 SRC_URI+=")"
29 KEYWORDS="~amd64"
30
31 RDEPEND="
32         dev-libs/expat
33         dev-libs/glib:2
34         dev-libs/nspr
35         dev-libs/nss
36         gnome-base/gconf:2
37         media-libs/alsa-lib
38         media-libs/fontconfig
39         media-libs/freetype
40         net-misc/curl
41         net-print/cups
42         sys-apps/dbus
43         x11-libs/cairo
44         x11-libs/gdk-pixbuf
45         x11-libs/gtk+:3
46         x11-libs/libX11
47         x11-libs/libXScrnSaver
48         x11-libs/libXcomposite
49         x11-libs/libXcursor
50         x11-libs/libXdamage
51         x11-libs/libXext
52         x11-libs/libXfixes
53         x11-libs/libXi
54         x11-libs/libXrandr
55         x11-libs/libXrender
56         x11-libs/libXtst
57         x11-libs/libnotify
58         x11-libs/pango[X]
59 "
60
61 QA_PREBUILT="*"
62 S=${WORKDIR}
63
64 src_unpack() {
65         unpack_deb ${A}
66 }
67
68 pkg_setup() {
69         OPERA_HOME="usr/$(get_libdir)/${PN}"
70 }
71
72 src_prepare() {
73         default
74
75         case ${ARCH} in
76                 amd64)
77                         mv usr/lib/x86_64-linux-gnu usr/$(get_libdir) || die
78                         rm -r usr/lib || die
79                         ;;
80                 x86)
81                         mv usr/lib/i386-linux-gnu/${PN} usr/$(get_libdir)/ || die
82                         ;;
83         esac
84
85         mv usr/share/doc/${PN} usr/share/doc/${PF} || die
86         gunzip usr/share/doc/${PF}/changelog.gz || die
87
88         rm usr/bin/${PN} || die
89
90         pushd "${OPERA_HOME}/localization" > /dev/null || die
91         chromium_remove_language_paks
92         popd > /dev/null || die
93
94         sed -i \
95                 -e 's|^TargetEnvironment|X-&|g' \
96                 usr/share/applications/${PN}.desktop || die
97 }
98
99 src_install() {
100         mv * "${D}" || die
101         dosym ../$(get_libdir)/${PN}/${PN} /usr/bin/${PN}
102         fperms 4711 /usr/$(get_libdir)/${PN}/opera_sandbox
103 }
104
105 pkg_postrm() {
106         xdg_desktop_database_update
107         xdg_icon_cache_update
108         xdg_mimeinfo_database_update
109 }
110
111 pkg_postinst() {
112         xdg_desktop_database_update
113         xdg_icon_cache_update
114         xdg_mimeinfo_database_update
115 }