This commit is contained in:
elwrcl committed 2026-08-28 17:23:24 +03:00
1 parent f7e247b0a5
commit 7d815112ab
6 files changed
+250 -95

No files matched your search

+23 -19
View File
@@ -58,19 +58,24 @@
src,
}:
let
enabledFeatures = [
"StorageAccessAPI"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"WaylandWindowDecorations"
];
# Chromium flags applied on all platforms to disable update machinery.
commonFlags = [
"--disable-component-update"
"--simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'"
"--check-for-update-interval=0"
"--no-first-run"
"--enable-features=StorageAccessAPI"
"--enable-features=${lib.concatStringsSep "," enabledFeatures}"
"--restore-last-session"
];
addFlags = lib.concatMapStringsSep " \\\n " (f: "--add-flags \"${f}\"");
# Libraries that must appear on LD_LIBRARY_PATH at runtime on Linux.
linuxRuntimeLibs = [
libGL
libvdpau
@@ -87,13 +92,13 @@ stdenv.mkDerivation {
nativeBuildInputs = [
makeWrapper
]
++ lib.optionals stdenv.isLinux [
++ lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
copyDesktopItems
]
++ lib.optionals stdenv.isDarwin [ _7zz ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ _7zz ];
buildInputs = lib.optionals stdenv.isLinux [
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
at-spi2-atk
at-spi2-core
@@ -138,7 +143,7 @@ stdenv.mkDerivation {
];
# QT libraries are bundled; suppress autoPatchelf warnings for them.
autoPatchelfIgnoreMissingDeps = lib.optionals stdenv.isLinux [
autoPatchelfIgnoreMissingDeps = lib.optionals stdenv.hostPlatform.isLinux [
"libQt6Core.so.6"
"libQt6Gui.so.6"
"libQt6Widgets.so.6"
@@ -147,17 +152,17 @@ stdenv.mkDerivation {
"libQt5Widgets.so.5"
];
dontWrapQtApps = stdenv.isLinux;
unpackCmd = lib.optionalString stdenv.isDarwin "7zz x $src";
dontWrapQtApps = stdenv.hostPlatform.isLinux;
unpackCmd = lib.optionalString stdenv.hostPlatform.isDarwin "7zz x -odmg-contents \"$curSrc\"";
sourceRoot = lib.optionalString stdenv.hostPlatform.isDarwin "dmg-contents";
installPhase =
if stdenv.isDarwin then
if stdenv.hostPlatform.isDarwin then
''
runHook preInstall
mkdir -p $out/Applications/Helium.app
cp -r . $out/Applications/Helium.app
mkdir -p $out/Applications
cp -r Helium.app $out/Applications/Helium.app
mkdir -p $out/bin
makeWrapper $out/Applications/Helium.app/Contents/MacOS/Helium $out/bin/helium \
@@ -171,14 +176,12 @@ stdenv.mkDerivation {
mkdir -p $out/bin $out/opt/helium
cp -r * $out/opt/helium
${lib.optionalString enableWidevine ''
cp -r ${widevine-cdm}/share/google/chrome/WidevineCdm $out/opt/helium/WidevineCdm
''}
${lib.optionalString enableWidevine ''
cp -r ${widevine-cdm}/share/google/chrome/WidevineCdm $out/opt/helium/WidevineCdm
''}
makeWrapper $out/opt/helium/helium $out/bin/helium \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath linuxRuntimeLibs}" \
--add-flags "--ozone-platform-hint=auto" \
--add-flags "--enable-features=WaylandWindowDecorations" \
${addFlags commonFlags}
mkdir -p $out/share/icons/hicolor/256x256/apps
@@ -195,7 +198,7 @@ ${lib.optionalString enableWidevine ''
chmod +x $out/bin/prefetch-nix
'';
desktopItems = lib.optionals stdenv.isLinux [
desktopItems = lib.optionals stdenv.hostPlatform.isLinux [
(makeDesktopItem {
name = "helium";
exec = "helium %U";
@@ -217,6 +220,7 @@ ${lib.optionalString enableWidevine ''
})
];
passthru = { inherit enabledFeatures; };
meta = {
description = "Private, fast, and honest web browser based on ungoogled-chromium";
homepage = "https://helium.computer/";