|
| 1 | +# Copyright 1999-2024 Gentoo Authors |
| 2 | +# Distributed under the terms of the GNU General Public License v2 |
| 3 | + |
| 4 | +EAPI=8 |
| 5 | + |
| 6 | +inherit xdg-utils desktop |
| 7 | + |
| 8 | +MY_PV="1.0.0-a.37" |
| 9 | +MY_P="zen" |
| 10 | + |
| 11 | +DESCRIPTION="Zen Browser - A Firefox-based browser focused on privacy" |
| 12 | +HOMEPAGE="https://github.com/zen-browser/desktop" |
| 13 | +SRC_URI="https://github.com/zen-browser/desktop/releases/download/${MY_PV}/${MY_P}.linux-specific.tar.bz2 -> ${P}.tar.bz2" |
| 14 | + |
| 15 | +S="${WORKDIR}" |
| 16 | +LICENSE="MPL-2.0" |
| 17 | +SLOT="0" |
| 18 | + |
| 19 | +RDEPEND=" |
| 20 | + dev-libs/expat |
| 21 | + dev-libs/glib:2 |
| 22 | + dev-libs/nspr |
| 23 | + dev-libs/nss |
| 24 | + media-libs/alsa-lib |
| 25 | + media-libs/fontconfig |
| 26 | + media-libs/freetype |
| 27 | + media-libs/mesa |
| 28 | + net-print/cups |
| 29 | + sys-apps/dbus |
| 30 | + sys-libs/glibc |
| 31 | + x11-libs/cairo |
| 32 | + x11-libs/gdk-pixbuf |
| 33 | + x11-libs/gtk+:3 |
| 34 | + x11-libs/libX11 |
| 35 | + x11-libs/libXcomposite |
| 36 | + x11-libs/libXcursor |
| 37 | + x11-libs/libXdamage |
| 38 | + x11-libs/libXext |
| 39 | + x11-libs/libXfixes |
| 40 | + x11-libs/libXi |
| 41 | + x11-libs/libXrandr |
| 42 | + x11-libs/libXrender |
| 43 | + x11-libs/libXtst |
| 44 | + x11-libs/pango |
| 45 | +" |
| 46 | + |
| 47 | +DEPEND="${RDEPEND}" |
| 48 | + |
| 49 | +QA_PREBUILT="opt/zen/*" |
| 50 | + |
| 51 | +src_install() { |
| 52 | + #create dest dir |
| 53 | + local destdir="/opt/zen" |
| 54 | + dodir "${destdir}" |
| 55 | + #copy files into dest dir |
| 56 | + cp -a "${S}/zen"/* "${ED}${destdir}" || die |
| 57 | + #create a symlink to the binary |
| 58 | + dosym "${destdir}/zen-bin" "/usr/bin/zen-bin" || die |
| 59 | + #add icons |
| 60 | + local icon_dir="${ED}${destdir}/browser/chrome/icons/default" |
| 61 | + if [[ -d "${icon_dir}" ]]; then |
| 62 | + for size in 16 32 48 64 128; do |
| 63 | + if [[ -f "${icon_dir}/default${size}.png" ]]; then |
| 64 | + newicon -s ${size} "${icon_dir}/default${size}.png" zen.png |
| 65 | + fi |
| 66 | + done |
| 67 | + else |
| 68 | + ewarn "Icon directory not found, skipping icon installation" |
| 69 | + fi |
| 70 | + #create desktop file |
| 71 | + make_desktop_entry zen-bin "Zen" zen "Network;WebBrowser" |
| 72 | + #handle permissions of destdir files |
| 73 | + fperms 0755 "${destdir}"/{zen-bin,updater,glxtest,vaapitest} |
| 74 | + fperms 0750 "${destdir}"/pingsender |
| 75 | +} |
| 76 | + |
| 77 | +pkg_postinst() { |
| 78 | + xdg_icon_cache_update |
| 79 | + xdg_desktop_database_update |
| 80 | + elog "For optimal performance and compatibility, please ensure" |
| 81 | + elog "that you have the latest graphics drivers installed." |
| 82 | +} |
| 83 | + |
| 84 | +pkg_postrm() { |
| 85 | + xdg_icon_cache_update |
| 86 | + xdg_desktop_database_update |
| 87 | +} |
0 commit comments