remove ia64 keywords
[gentoo-zh.git] / www-client / brave-bin / brave-bin-1.73.104.ebuild
blob460ce8ff12bf63687f84b0df6af2e97152a56969
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 strip"
26 RDEPEND="
27         >=app-accessibility/at-spi2-core-2.46.0:2
28         app-misc/ca-certificates
29         dev-libs/expat
30         dev-libs/glib:2
31         dev-libs/nspr
32         dev-libs/nss
33         media-libs/alsa-lib
34         media-libs/mesa[gbm(+)]
35         net-misc/curl
36         net-print/cups
37         sys-apps/dbus
38         sys-libs/glibc
39         x11-libs/cairo
40         x11-libs/gdk-pixbuf
41         x11-libs/gtk+:3
42         x11-libs/libdrm
43         x11-libs/libxcb
44         x11-libs/libxkbcommon
45         x11-libs/libxshmfence
46         x11-libs/libX11
47         x11-libs/libXcomposite
48         x11-libs/libXdamage
49         x11-libs/libXext
50         x11-libs/libXfixes
51         x11-libs/libXrandr
52         x11-libs/pango
53         qt5? (
54                 dev-qt/qtcore:5
55                 dev-qt/qtgui:5[X]
56                 dev-qt/qtwidgets:5
57         )
58         qt6? ( dev-qt/qtbase:6[gui,widgets] )
61 QA_PREBUILT="*"
62 BRAVE_HOME="opt/brave.com/brave"
64 pkg_setup() {
65         chromium_suid_sandbox_check_kernel_config
68 src_unpack() {
69         :
72 src_install() {
73         dodir /
74         cd "${ED}" || die
75         unpacker
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/man1/${MY_PN}-stable.1.gz || die
90         if [[ -L usr/share/man/man1/brave-browser.1.gz ]]; then
91             rm usr/share/man/man1/brave-browser.1.gz || die
92             dosym ${MY_PN}-stable.1 usr/share/man/man1/brave-browser.1
93         fi
95         # Remove unused language packs
96         pushd "${BRAVE_HOME}/locales" > /dev/null || die
97         chromium_remove_language_paks
98         popd > /dev/null || die
100         if ! use qt5; then
101                 rm "${BRAVE_HOME}/libqt5_shim.so" || die
102         fi
103         if ! use qt6; then
104                 rm "${BRAVE_HOME}/libqt6_shim.so" || die
105         fi
107         local logo size
108         for logo in "${ED}"/${BRAVE_HOME}/product_logo_*.png; do
109             size=${logo##*_}
110                 size=${size%.*}
111                 newicon -s "${size}" "${logo}" ${PN/-bin}.png
112         done
114         pax-mark m "${BRAVE_HOME}/brave"
115         fperms 4711 "/${BRAVE_HOME}/chrome-sandbox"