1 # Copyright 2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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"
24 RESTRICT
="bindist strip"
27 >=app-accessibility/at-spi2-core-2.46.0:2
28 app-misc/ca-certificates
34 media-libs/mesa[gbm(+)]
47 x11-libs/libXcomposite
58 qt6? ( dev-qt/qtbase:6[gui,widgets] )
62 BRAVE_HOME
="opt/brave.com/brave"
65 chromium_suid_sandbox_check_kernel_config
77 # The appdata directory is deprecated.
78 mv usr
/share
/{appdata
,metainfo
}/ || die
80 # Remove cron job and menu for updating from Debian repos.
81 rm -r ${BRAVE_HOME}/cron
/ || die
82 rm -r etc usr
/share
/menu || die
84 # Rename docs directory to our needs.
85 mv usr
/share
/doc
/${MY_PN} usr
/share
/doc
/${PF} || die
87 # Decompress the docs.
88 gzip -d usr
/share
/doc
/${PF}/changelog.gz || die
89 gzip -d usr
/share
/man
/man
1/${MY_PN}-stable.1.gz || die
90 if [[ -L usr
/share
/man
/man
1/brave-browser
.1.gz
]]; then
91 rm usr
/share
/man
/man
1/brave-browser
.1.gz || die
92 dosym
${MY_PN}-stable.1 usr
/share
/man
/man
1/brave-browser
.1
95 # Remove unused language packs
96 pushd "${BRAVE_HOME}/locales" > /dev
/null || die
97 chromium_remove_language_paks
98 popd > /dev
/null || die
101 rm "${BRAVE_HOME}/libqt5_shim.so" || die
104 rm "${BRAVE_HOME}/libqt6_shim.so" || die
108 for logo
in "${ED}"/${BRAVE_HOME}/product_logo_
*.png
; do
111 newicon
-s "${size}" "${logo}" ${PN/-bin}.png
114 pax-mark m "${BRAVE_HOME}/brave
"
115 fperms 4711 "/${BRAVE_HOME}/chrome-sandbox
"