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 mirror strip"
27 >=app-accessibility/at-spi2-core-2.46.0:2
33 media-libs/mesa[gbm(+)]
46 x11-libs/libXcomposite
57 qt6? ( dev-qt/qtbase:6[gui,widgets] )
61 BRAVE_HOME
="opt/brave.com/brave"
64 chromium_suid_sandbox_check_kernel_config
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
/man
1/${MY_PN}-stable.1.gz || die
89 if [[ -L usr
/share
/man
/man
1/brave-browser
.1.gz
]]; then
90 rm usr
/share
/man
/man
1/brave-browser
.1.gz || die
91 dosym
${MY_PN}-stable.1 usr
/share
/man
/man
1/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
100 rm "${BRAVE_HOME}/libqt5_shim.so" || die
103 rm "${BRAVE_HOME}/libqt6_shim.so" || die
107 for logo
in "${ED}"/${BRAVE_HOME}/product_logo_
*.png
; do
110 newicon
-s "${size}" "${logo}" ${PN/-bin}.png
113 pax-mark m "${BRAVE_HOME}/brave
"
114 fperms 4711 "/${BRAVE_HOME}/chrome-sandbox
"