switch to helium from nur

This commit is contained in:
Sean Kovacs 2025-12-19 13:05:41 -05:00
commit 2207d0ca62
Signed by: sckova
GPG key ID: 00F325187C68651A
6 changed files with 1 additions and 255 deletions

View file

@ -173,7 +173,7 @@
# gui applications # gui applications
input-leap input-leap
libreoffice-qt-fresh libreoffice-qt-fresh
# helium-browser nur.repos.forkprince.helium-nightly
bitwarden-desktop bitwarden-desktop
qbittorrent qbittorrent

View file

@ -1,138 +0,0 @@
{
stdenv,
lib,
fetchurl,
makeDesktopItem,
copyDesktopItems,
autoPatchelfHook,
makeWrapper,
helium-widevine,
# runtime dependencies
xorg,
libGL,
mesa,
cairo,
pango,
systemd,
alsa-lib,
gcc-unwrapped,
qt5,
qt6,
glib,
nspr,
nss,
at-spi2-atk,
at-spi2-core,
cups,
gsettings-desktop-schemas,
gtk3,
}:
let
architectures = {
"x86_64-linux" = {
arch = "x86_64";
hash = "sha256-DLcJCECE5yWcwZuRwNJs3q+sqrZbTbouGF5bDTIFYWM=";
};
"aarch64-linux" = {
arch = "arm64";
hash = "sha256-c4XHvq6H60RfoChyrdADGeazZ0hxt72GoZE4A0bwzNU=";
};
};
platformInfo =
architectures.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec {
pname = "helium-browser";
version = "0.6.9.1";
xzName = "helium-${version}-${platformInfo.arch}_linux";
src = fetchurl {
url = "https://github.com/imputnet/helium-linux/releases/download/${version}/${xzName}.tar.xz";
hash = platformInfo.hash;
};
sourceRoot = ".";
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
copyDesktopItems
];
buildInputs = [
xorg.libXext
xorg.libXfixes
xorg.libXrandr
xorg.libxcb
xorg.libXdamage
xorg.libXcomposite
mesa
cairo
pango
systemd
alsa-lib
gcc-unwrapped.lib
qt5.qtbase.out
qt6.qtbase.out
glib
nspr
nss
at-spi2-atk
at-spi2-core
cups
gsettings-desktop-schemas
gtk3
];
dontWrapQtApps = true;
unpackPhase = ''
runHook preUnpack
tar xf $src
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt/helium
mv ${xzName}/helium.desktop .
mv ${xzName}/product_logo_256.png .
cp -r ${xzName}/* $out/opt/helium/
chmod +x $out/opt/helium/chrome-wrapper $out/opt/helium/chrome
cp -r ${helium-widevine}/share/helium/WidevineCdm $out/opt/helium/
makeWrapper $out/opt/helium/chrome-wrapper $out/bin/helium-browser \
--chdir $out/opt/helium \
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
--prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
libGL
mesa
]
}"
install -Dm644 product_logo_256.png $out/share/icons/hicolor/256x256/apps/helium.png
install -Dm644 helium.desktop $out/share/applications/helium.desktop
substituteInPlace $out/share/applications/helium.desktop \
--replace-fail 'Exec=chromium' "Exec=$out/bin/helium-browser"
substituteInPlace $out/share/applications/helium.desktop \
--replace-fail 'Icon=helium' 'Icon=web-browser'
runHook postInstall
'';
meta = with lib; {
homepage = "https://helium.computer";
description = "Helium web browser";
platforms = platforms.linux;
mainProgram = "helium";
};
}

View file

@ -1,49 +0,0 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
squashfsTools,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "helium-widevine";
version = "${finalAttrs.lacrosVersion}-${builtins.substring 0 7 finalAttrs.widevineInstaller.rev}";
lacrosVersion = "120.0.6098.0";
widevineInstaller = fetchFromGitHub {
owner = "AsahiLinux";
repo = "widevine-installer";
rev = "7a3928fe1342fb07d96f61c2b094e3287588958b";
sha256 = "sha256-XI1y4pVNpXS+jqFs0KyVMrxcULOJ5rADsgvwfLF6e0Y=";
};
src = fetchurl {
url = "https://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/chromeos-lacros-arm64-squash-zstd-${finalAttrs.lacrosVersion}";
hash = "sha256-OKV8w5da9oZ1oSGbADVPCIkP9Y0MVLaQ3PXS3ZBLFXY=";
};
nativeBuildInputs = [
squashfsTools
python3
];
unpackPhase = ''
unsquashfs -q $src 'WidevineCdm/*'
python3 $widevineInstaller/widevine_fixup.py squashfs-root/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so libwidevinecdm.so
cp squashfs-root/WidevineCdm/manifest.json .
cp squashfs-root/WidevineCdm/LICENSE LICENSE.txt
'';
# Accoring to widevine-installer: "Hack because Chromium hardcodes a check for this right now..."
postInstall = ''
mkdir -p "$out/share/helium/WidevineCdm/_platform_specific/linux_x64"
touch "$out/share/helium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"
install -vD manifest.json "$out/share/helium/WidevineCdm/manifest.json"
install -vD LICENSE.txt "$out/share/helium/WidevineCdm/License.txt"
install -vD libwidevinecdm.so "$out/share/helium/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so"
'';
meta = import ./widevine-meta.nix lib;
})

View file

@ -1,15 +0,0 @@
lib: {
description = "Widevine CDM";
homepage = "https://www.widevine.com";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [
jlamur
bearfm
];
platforms = lib.map (name: lib.removeSuffix ".nix" (lib.removePrefix "widevine-" name)) (
lib.filter (name: name != "meta.nix" && name != "package.nix") (
builtins.attrNames (builtins.readDir ./.)
)
);
}

View file

@ -1,44 +0,0 @@
{
lib,
stdenv,
fetchurl,
go-crx3,
}:
let
manifest = builtins.fromJSON (builtins.readFile ./x86_64-manifest.json);
in
stdenv.mkDerivation (finalAttrs: {
pname = "widevine-cdm";
version = manifest.version;
src = fetchurl {
url = manifest.url;
hash = manifest.sri;
};
nativeBuildInputs = [ go-crx3 ];
unpackPhase = ''
unpackDir="src"
cp "$src" "$unpackDir".crx # go-crx3 doesn't like .crx3 extensions
crx3 unpack "$unpackDir".crx
cd "$unpackDir"
'';
installPhase = ''
runHook preInstall
install -vD manifest.json $out/share/helium/WidevineCdm/manifest.json
install -vD LICENSE $out/share/helium/WidevineCdm/LICENSE.txt
install -vD _platform_specific/linux_x64/libwidevinecdm.so $out/share/helium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so
runHook postInstall
'';
passthru.updateScript = ./update-x86_64.py;
meta = import ./meta.nix lib;
})

View file

@ -16,14 +16,6 @@ final: prev: {
# }) { }; # }) { };
# }; # };
helium-browser =
let
helium-widevine = prev.callPackage ./helium-browser/widevine-aarch64-linux.nix { };
in
prev.callPackage ./helium-browser/package.nix {
inherit helium-widevine;
};
spotify-webapp = prev.callPackage (builtins.path { path = ./spotify/package.nix; }) { }; spotify-webapp = prev.callPackage (builtins.path { path = ./spotify/package.nix; }) { };
spotifyd = prev.callPackage (builtins.path { path = ./spotifyd/package.nix; }) { }; spotifyd = prev.callPackage (builtins.path { path = ./spotifyd/package.nix; }) { };