|
| 1 | +_pkgname="helium" |
| 2 | +pkgname="${_pkgname}-browser-bin" |
| 3 | +gives="helium-browser" |
| 4 | +pkgver=0.7.7.1 |
| 5 | +pkgrel=1 |
| 6 | +pkgdesc="Private, fast, and honest web browser based on Chromium" |
| 7 | +arch=('amd64' 'arm64') |
| 8 | +url="https://github.com/imputnet/helium-linux" |
| 9 | +license=('GPL-3.0-only' 'BSD-3-Clause') |
| 10 | +depends=('libgtk-3-0t64' 'libnss3' 'libasound2t64' 'xdg-utils' 'libxss1' 'libcups2' 'libgcrypt20' |
| 11 | + 'fonts-liberation' 'systemd' 'dbus' 'libpulse0' 'pciutils' 'libva2' |
| 12 | + 'libffi8' 'desktop-file-utils' 'hicolor-icon-theme' 'ca-certificates') |
| 13 | +optdepends=('pipewire: WebRTC desktop sharing under Wayland' |
| 14 | + 'kdialog: support for native dialogs in Plasma' |
| 15 | + 'libgtk-4-1: for --gtk-version=4 (GTK4 IME might work better on Wayland)' |
| 16 | + 'gnome-keyring: password storage backend on GNOME / Xfce' |
| 17 | + 'kwallet6: support for storing passwords in KWallet on Plasma' |
| 18 | + 'upower: Battery Status API support') |
| 19 | + |
| 20 | +source_amd64=( |
| 21 | + "${_pkgname}-${pkgver}-x86_64_linux.tar.xz::https://github.com/imputnet/helium-linux/releases/download/${pkgver}/${_pkgname}-${pkgver}-x86_64_linux.tar.xz" |
| 22 | + "LICENSE.ungoogled_chromium::https://raw.githubusercontent.com/imputnet/helium-linux/${pkgver}/LICENSE.ungoogled_chromium" |
| 23 | +) |
| 24 | + |
| 25 | +source_arm64=( |
| 26 | + "${_pkgname}-${pkgver}-arm64_linux.tar.xz::https://github.com/imputnet/helium-linux/releases/download/${pkgver}/${_pkgname}-${pkgver}-arm64_linux.tar.xz" |
| 27 | + "LICENSE.ungoogled_chromium::https://raw.githubusercontent.com/imputnet/helium-linux/${pkgver}/LICENSE.ungoogled_chromium" |
| 28 | +) |
| 29 | + |
| 30 | +sha256sums_amd64=('698f46c080cf4dcb249b9e4d96e4b2c640870ba76b77a05d05a358661af39511' |
| 31 | + '9539b394e4179952698894bd62ef6566b6804ab0ff360dcf3a511cfaf7f78c4d') |
| 32 | + |
| 33 | +sha256sums_arm64=('efa849d7dfdb1f3744d7ffe478617d8a66243073b2e951e9039e9bc44920c200' |
| 34 | + '9539b394e4179952698894bd62ef6566b6804ab0ff360dcf3a511cfaf7f78c4d') |
| 35 | + |
| 36 | +prepare() { |
| 37 | + _archdir="${_pkgname}-${pkgver}-$([[ ${CARCH} == "arm64" ]] && echo "arm64" || echo "x86_64")_linux" |
| 38 | + sed -i \ |
| 39 | + -e 's/Exec=chromium/Exec=helium-browser/' \ |
| 40 | + -e 's/Name=Helium$/Name=Helium Browser/' \ |
| 41 | + -e 's/Icon=helium/Icon=helium-browser/' \ |
| 42 | + "${srcdir}/${_archdir}/helium.desktop" |
| 43 | +} |
| 44 | + |
| 45 | +package() { |
| 46 | + _archdir="${_pkgname}-${pkgver}-$([[ ${CARCH} == "arm64" ]] && echo "arm64" || echo "x86_64")_linux" |
| 47 | + install -dm755 "${pkgdir}/usr/lib/${gives}" |
| 48 | + cp -a "${srcdir}/${_archdir}/"* "${pkgdir}/usr/lib/${gives}/" |
| 49 | + install -Dm644 "${srcdir}/${_archdir}/helium.desktop" \ |
| 50 | + "${pkgdir}/usr/share/applications/helium-browser.desktop" |
| 51 | + install -Dm644 "${pkgdir}/usr/lib/${gives}/product_logo_256.png" \ |
| 52 | + "${pkgdir}/usr/share/pixmaps/helium-browser.png" |
| 53 | + install -Dm644 "${pkgdir}/usr/lib/${gives}/product_logo_256.png" \ |
| 54 | + "${pkgdir}/usr/share/icons/hicolor/256x256/apps/helium-browser.png" |
| 55 | + install -Dm644 "${srcdir}/LICENSE.ungoogled_chromium" \ |
| 56 | + "${pkgdir}/usr/share/doc/${pkgname}/LICENSE.ungoogled_chromium" |
| 57 | + install -dm755 "${pkgdir}/usr/bin" |
| 58 | + cat > "${pkgdir}/usr/bin/helium-browser" << 'EOF' |
| 59 | +#!/bin/bash |
| 60 | +set -euo pipefail |
| 61 | + |
| 62 | +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" |
| 63 | + |
| 64 | +SYS_CONF="/etc/helium-browser-flags.conf" |
| 65 | +USR_CONF="${XDG_CONFIG_HOME}/helium-browser-flags.conf" |
| 66 | + |
| 67 | +FLAGS=() |
| 68 | + |
| 69 | +append_flags_file() { |
| 70 | + local file="$1" |
| 71 | + [[ -r "$file" ]] || return 0 |
| 72 | + local line safe_line |
| 73 | + while IFS= read -r line; do |
| 74 | + [[ "$line" =~ ^[[:space:]]*(#|$) ]] && continue |
| 75 | + case "$line" in |
| 76 | + *'$('*|*'`'*) |
| 77 | + echo "Warning: ignoring unsafe line in $file: $line" >&2 |
| 78 | + continue |
| 79 | + ;; |
| 80 | + esac |
| 81 | + set -f |
| 82 | + safe_line=${line//$/\\$} |
| 83 | + safe_line=${safe_line//~/\\~} |
| 84 | + eval "set -- $safe_line" |
| 85 | + set +f |
| 86 | + for token in "$@"; do |
| 87 | + FLAGS+=("$token") |
| 88 | + done |
| 89 | + done < "$file" |
| 90 | +} |
| 91 | + |
| 92 | +append_flags_file "$SYS_CONF" |
| 93 | +append_flags_file "$USR_CONF" |
| 94 | + |
| 95 | +if [[ -n "${HELIUM_USER_FLAGS:-}" ]]; then |
| 96 | + read -r -a ENV_FLAGS <<< "$HELIUM_USER_FLAGS" |
| 97 | + FLAGS+=("${ENV_FLAGS[@]}") |
| 98 | +fi |
| 99 | + |
| 100 | +export CHROME_VERSION_EXTRA="stable" |
| 101 | + |
| 102 | +exec /usr/lib/helium-browser/chrome "${FLAGS[@]}" "$@" |
| 103 | +EOF |
| 104 | + chmod 755 "${pkgdir}/usr/bin/helium-browser" |
| 105 | +} |
0 commit comments