cider-2: 3.0.0 -> 3.1.1

This commit is contained in:
Amadej Kastelic
2025-09-02 20:31:50 +02:00
parent 6af268dc22
commit 4d94729b6e
+23 -3
View File
@@ -8,21 +8,25 @@
# Required dependencies for autoPatchelfHook # Required dependencies for autoPatchelfHook
alsa-lib, alsa-lib,
asar,
gtk3, gtk3,
libgbm, libgbm,
libGL,
nspr, nspr,
nss, nss,
widevine-cdm,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "cider-2"; pname = "cider-2";
version = "3.0.0"; version = "3.1.1";
src = fetchurl { src = fetchurl {
url = "https://repo.cider.sh/apt/pool/main/cider-v${version}-linux-x64.deb"; url = "https://repo.cider.sh/apt/pool/main/cider-v${version}-linux-x64.deb";
hash = "sha256-XKyzt8QkPNQlgFxR12KA5t+PCJki7UuFpn4SGmoGkpg="; hash = "sha256-2gd/ThI59GFU/lMKFLtwHeRWSqp14jFd8YMrV8Cu/oQ=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
asar
dpkg dpkg
autoPatchelfHook autoPatchelfHook
makeWrapper makeWrapper
@@ -32,6 +36,7 @@ stdenv.mkDerivation rec {
alsa-lib alsa-lib
gtk3 gtk3
libgbm libgbm
libGL
nspr nspr
nss nss
]; ];
@@ -54,10 +59,25 @@ stdenv.mkDerivation rec {
runHook postInstall runHook postInstall
''; '';
postInstall = ''
${lib.getExe asar} extract $out/lib/cider/resources/app.asar ./cider-build
# Patch login popup webview creation
substituteInPlace ./cider-build/.vite/build/events-*.js \
--replace-fail 'else if(c.includes(r))return{action:"allow"}' 'else if(c.includes(r))return{action:"allow",overrideBrowserWindowOptions:{webPreferences:{devTools:!0,nodeIntegration:!1,contextIsolation:!0,webSecurity:!1,sandbox:!1,experimentalFeatures:!0}}}'
${lib.getExe asar} pack ./cider-build $out/lib/cider/resources/app.asar
rm -rf ./cider-build
# Install Widevine CDM for DRM support
ln -sf ${widevine-cdm}/share/google/chrome/WidevineCdm $out/lib/cider/
'';
postFixup = '' postFixup = ''
makeWrapper $out/lib/cider/Cider $out/bin/${pname} \ makeWrapper $out/lib/cider/Cider $out/bin/${pname} \
--add-flags "\$\{NIXOS_OZONE_WL:+\$\{WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true\}\}" \ --add-flags "\$\{NIXOS_OZONE_WL:+\$\{WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true\}\}" \
--add-flags "--no-sandbox --disable-gpu-sandbox" --add-flags "--no-sandbox --disable-gpu-sandbox" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}"
mv $out/share/applications/cider.desktop $out/share/applications/${pname}.desktop mv $out/share/applications/cider.desktop $out/share/applications/${pname}.desktop
substituteInPlace $out/share/applications/${pname}.desktop \ substituteInPlace $out/share/applications/${pname}.desktop \