dev-util/android-studio: add 3.1.19
[gentoo-zh.git] / www-client / brave-bin / brave-bin-1.66.113.ebuild
blob9e0855358326d344013f2606b957bd9b321f701d
1 # Copyright 2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB en-US es es-419 et fa fi fil fr
7 gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk
8 sl sr sv sw ta te th tr uk ur vi zh-CN zh-TW"
10 inherit chromium-2 desktop pax-utils unpacker xdg
12 MY_PN=${PN/-bin}-browser
13 DESCRIPTION="Web browser that blocks ads and trackers by default"
14 HOMEPAGE="https://brave.com/"
15 SRC_URI="https://github.com/${PN/-bin}/${MY_PN}/releases/download/v${PV}/${MY_PN}_${PV}_amd64.deb"
17 S=${WORKDIR}
19 LICENSE="MPL-2.0"
20 SLOT="0"
21 KEYWORDS="-* amd64"
23 IUSE="qt5 qt6"
24 RESTRICT="bindist mirror strip"
26 RDEPEND="
27 >=app-accessibility/at-spi2-core-2.46.0:2
28 dev-libs/expat
29 dev-libs/glib:2
30 dev-libs/nspr
31 dev-libs/nss
32 media-libs/alsa-lib
33 media-libs/mesa[gbm(+)]
34 net-misc/curl
35 net-print/cups
36 sys-apps/dbus
37 sys-libs/glibc
38 x11-libs/cairo
39 x11-libs/gdk-pixbuf
40 x11-libs/gtk+:3
41 x11-libs/libdrm
42 x11-libs/libxcb
43 x11-libs/libxkbcommon
44 x11-libs/libxshmfence
45 x11-libs/libX11
46 x11-libs/libXcomposite
47 x11-libs/libXdamage
48 x11-libs/libXext
49 x11-libs/libXfixes
50 x11-libs/libXrandr
51 x11-libs/pango
52 qt5? (
53 dev-qt/qtcore:5
54 dev-qt/qtgui:5[X]
55 dev-qt/qtwidgets:5
57 qt6? ( dev-qt/qtbase:6[gui,widgets] )
60 QA_PREBUILT="*"
61 BRAVE_HOME="opt/brave.com/brave"
63 pkg_setup() {
64 chromium_suid_sandbox_check_kernel_config
67 src_unpack() {
71 src_install() {
72 dodir /
73 cd "${ED}" || die
74 unpacker
76 # The appdata directory is deprecated.
77 mv usr/share/{appdata,metainfo}/ || die
79 # Remove cron job and menu for updating from Debian repos.
80 rm -r ${BRAVE_HOME}/cron/ || die
81 rm -r etc usr/share/menu || die
83 # Rename docs directory to our needs.
84 mv usr/share/doc/${MY_PN} usr/share/doc/${PF} || die
86 # Decompress the docs.
87 gzip -d usr/share/doc/${PF}/changelog.gz || die
88 gzip -d usr/share/man/man1/${MY_PN}-stable.1.gz || die
89 if [[ -L usr/share/man/man1/brave-browser.1.gz ]]; then
90 rm usr/share/man/man1/brave-browser.1.gz || die
91 dosym ${MY_PN}-stable.1 usr/share/man/man1/brave-browser.1
94 # Remove unused language packs
95 pushd "${BRAVE_HOME}/locales" > /dev/null || die
96 chromium_remove_language_paks
97 popd > /dev/null || die
99 if ! use qt5; then
100 rm "${BRAVE_HOME}/libqt5_shim.so" || die
102 if ! use qt6; then
103 rm "${BRAVE_HOME}/libqt6_shim.so" || die
106 local logo size
107 for logo in "${ED}"/${BRAVE_HOME}/product_logo_*.png; do
108 size=${logo##*_}
109 size=${size%.*}
110 newicon -s "${size}" "${logo}" ${PN/-bin}.png
111 done
113 pax-mark m "${BRAVE_HOME}/brave"
114 fperms 4711 "/${BRAVE_HOME}/chrome-sandbox"