From 3bbeed67126efb3f5db16bc6cd9f8edfe596eb4d Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Wed, 3 Dec 2025 19:19:23 -0800 Subject: [PATCH] add: helium-browser-bin (#8007) (#8026) * add: helium browser * use libdir instead of /opt and cleanup redundant files * rename from helium-browser -> helium-browser-bin * fix desktop file --------- (cherry picked from commit 65bf267eb130e7f2e2361b065c1efb11bab57342) Co-authored-by: Nadia Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/apps/helium-browser-bin/anda.hcl | 5 + .../helium-browser-bin.spec | 112 ++++++++++++++++++ anda/apps/helium-browser-bin/update.rhai | 1 + 3 files changed, 118 insertions(+) create mode 100644 anda/apps/helium-browser-bin/anda.hcl create mode 100644 anda/apps/helium-browser-bin/helium-browser-bin.spec create mode 100644 anda/apps/helium-browser-bin/update.rhai diff --git a/anda/apps/helium-browser-bin/anda.hcl b/anda/apps/helium-browser-bin/anda.hcl new file mode 100644 index 0000000000..5f8cf43658 --- /dev/null +++ b/anda/apps/helium-browser-bin/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "helium-browser-bin.spec" + } +} diff --git a/anda/apps/helium-browser-bin/helium-browser-bin.spec b/anda/apps/helium-browser-bin/helium-browser-bin.spec new file mode 100644 index 0000000000..21ef5924f2 --- /dev/null +++ b/anda/apps/helium-browser-bin/helium-browser-bin.spec @@ -0,0 +1,112 @@ +%define debug_package %{nil} + +%global __requires_exclude libffmpeg.so|libvk_swiftshader.so|libvulkan.so|libEGL.so|libGLESv2.so +%global __provides_exclude_from %{_libdir}/%{name}/.*\\.so + +Name: helium-browser-bin +Version: 0.6.9.1 +Release: 1%{?dist} +Summary: Private, fast, and honest web browser based on Chromium + +URL: https://helium.computer +License: GPL-3.0-only AND BSD-3-Clause + +Source0: https://github.com/imputnet/helium-linux/releases/download/%{version}/helium-%{version}-x86_64_linux.tar.xz +Source1: https://github.com/imputnet/helium-linux/releases/download/%{version}/helium-%{version}-arm64_linux.tar.xz + +ExclusiveArch: x86_64 aarch64 + +Requires: xdg-utils +Requires: liberation-fonts + +Packager: Nadia P + +%description +Private, fast, and honest web browser based on Chromium. +Based on ungoogled-chromium with additional privacy and usability improvements. + +%prep +%ifarch x86_64 +%autosetup -n helium-%{version}-x86_64_linux +%endif +%ifarch aarch64 +%autosetup -n helium-%{version}-arm64_linux -T -b 1 +%endif + +sed -i \ + -e 's/Exec=chromium/Exec=%{name}/' \ + -e 's/Name=Helium$/Name=Helium Browser/' \ + -e 's/Icon=helium/Icon=%{name}/' \ + helium.desktop + +%build + +%install +install -dm755 %{buildroot}%{_libdir}/%{name} +cp -a * %{buildroot}%{_libdir}/%{name}/ + +sed -i 's/exists_desktop_file || generate_desktop_file/true/' \ + %{buildroot}%{_libdir}/%{name}/chrome-wrapper + +install -Dm644 helium.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop +install -Dm644 product_logo_256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png + +rm -f %{buildroot}%{_libdir}/%{name}/helium.desktop +rm -f %{buildroot}%{_libdir}/%{name}/product_logo_256.png + +install -dm755 %{buildroot}%{_bindir} +cat > %{buildroot}%{_bindir}/%{name} << EOF +#!/bin/bash +set -euo pipefail + +XDG_CONFIG_HOME="\${XDG_CONFIG_HOME:-\"\$HOME/.config\"}" + +SYS_CONF="%{_sysconfdir}/helium-browser-flags.conf" +USR_CONF="\${XDG_CONFIG_HOME}/helium-browser-flags.conf" + +FLAGS=() + +append_flags_file() { + local file="\$1" + [[ -r "\$file" ]] || return 0 + local line safe_line + while IFS= read -r line; do + [[ "\$line" =~ ^[[:space:]]*(#|\$) ]] && continue + case "\$line" in + *'\$('*|*'\`'*) + echo "Warning: ignoring unsafe line in \$file: \$line" >&2 + continue + ;; + esac + set -f + safe_line=\${line//\$/\\\\\$} + safe_line=\${safe_line//~/\\\\~} + eval "set -- \$safe_line" + set +f + for token in "\$@"; do + FLAGS+=("\$token") + done + done < "\$file" +} + +append_flags_file "\$SYS_CONF" +append_flags_file "\$USR_CONF" + +if [[ -n "\${HELIUM_USER_FLAGS:-}" ]]; then + read -r -a ENV_FLAGS <<< "\$HELIUM_USER_FLAGS" + FLAGS+=("\${ENV_FLAGS[@]}") +fi + +exec %{_libdir}/%{name}/chrome-wrapper "\${FLAGS[@]}" "\$@" +EOF +chmod 755 %{buildroot}%{_bindir}/%{name} + +%files +%{_libdir}/%{name}/ +%{_bindir}/%{name} +%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/256x256/apps/%{name}.png + +%changelog +* Wed Dec 03 2025 Nadia P - 0.6.9.1-1 +- Initial package diff --git a/anda/apps/helium-browser-bin/update.rhai b/anda/apps/helium-browser-bin/update.rhai new file mode 100644 index 0000000000..db92cb0a2c --- /dev/null +++ b/anda/apps/helium-browser-bin/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("imputnet/helium-linux"));