From 7957a734e9199b6a6608819caeeb514797b04b14 Mon Sep 17 00:00:00 2001 From: Jasi Date: Sun, 5 Oct 2025 14:29:10 -0400 Subject: [PATCH 1/3] ruffle: use new version names; fix `meta.changelog` attribute --- pkgs/by-name/ru/ruffle/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ru/ruffle/package.nix b/pkgs/by-name/ru/ruffle/package.nix index d1728d030498..2e678bb7e129 100644 --- a/pkgs/by-name/ru/ruffle/package.nix +++ b/pkgs/by-name/ru/ruffle/package.nix @@ -21,12 +21,12 @@ }: rustPlatform.buildRustPackage (finalAttrs: { pname = "ruffle"; - version = "0.2-nightly-2025-10-05"; + version = "0.2.0-nightly-2025-10-05"; src = fetchFromGitHub { owner = "ruffle-rs"; repo = "ruffle"; - tag = lib.strings.removePrefix "0.2-" finalAttrs.version; + tag = lib.strings.removePrefix "0.2.0-" finalAttrs.version; hash = "sha256-u12Qfc0fmcs7TU35/gqfRxjSpw9SDbc4+ebR7lGpvJI="; }; @@ -35,8 +35,8 @@ rustPlatform.buildRustPackage (finalAttrs: { env = let - tag = lib.strings.removePrefix "0.2-" finalAttrs.version; - versionDate = lib.strings.removePrefix "0.2-nightly-" finalAttrs.version; + tag = lib.strings.removePrefix "0.2.0-" finalAttrs.version; + versionDate = lib.strings.removePrefix "0.2.0-nightly-" finalAttrs.version; in { VERGEN_IDEMPOTENT = "1"; @@ -116,7 +116,7 @@ rustPlatform.buildRustPackage (finalAttrs: { curl https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1 | \ jq -r ".[0].tag_name" \ )" - exec nix-update --version "0.2-$version" ruffle + exec nix-update --version "0.2.0-$version" ruffle ''; }); }; @@ -135,11 +135,11 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; homepage = "https://ruffle.rs/"; downloadPage = "https://ruffle.rs/downloads"; - changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${lib.strings.removePrefix "0.2" finalAttrs.version}"; license = [ lib.licenses.mit lib.licenses.asl20 ]; + changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${lib.strings.removePrefix "0.2.0-" finalAttrs.version}"; maintainers = [ lib.maintainers.jchw lib.maintainers.normalcea From 3c023c2bbb7ae076e7963d70322b626d8024c02d Mon Sep 17 00:00:00 2001 From: Jasi Date: Sun, 5 Oct 2025 13:11:10 -0400 Subject: [PATCH 2/3] ruffle: add `withX11` custom argument; clean-up arguments To allow for building ruffle without any X11 dependencie, create a custom pacakge attribute `withX`. This also substitutes the `xorg` attribute for flattened versions of each library listed separately for exactness. All custom package attributes are placed at the end of the argument list for readability. --- pkgs/by-name/ru/ruffle/package.nix | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ru/ruffle/package.nix b/pkgs/by-name/ru/ruffle/package.nix index 2e678bb7e129..83b8d0837682 100644 --- a/pkgs/by-name/ru/ruffle/package.nix +++ b/pkgs/by-name/ru/ruffle/package.nix @@ -2,14 +2,17 @@ lib, stdenv, rustPlatform, - withRuffleTools ? false, fetchFromGitHub, jre_minimal, pkg-config, autoPatchelfHook, alsa-lib, wayland, - xorg, + libXcursor, + libXrandr, + libXi, + libX11, + libxcb, vulkan-loader, udev, libxkbcommon, @@ -18,7 +21,10 @@ curl, jq, nix-update, + withX11 ? true, + withRuffleTools ? false, }: + rustPlatform.buildRustPackage (finalAttrs: { pname = "ruffle"; version = "0.2.0-nightly-2025-10-05"; @@ -75,17 +81,21 @@ rustPlatform.buildRustPackage (finalAttrs: { else null; - runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [ - wayland - xorg.libXcursor - xorg.libXrandr - xorg.libXi - xorg.libX11 - xorg.libxcb - libxkbcommon - vulkan-loader - finalAttrs.openh264-241 - ]; + runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux ( + [ + wayland + libxkbcommon + vulkan-loader + finalAttrs.openh264-241 + ] + ++ lib.optionals withX11 [ + libXcursor + libXrandr + libXi + libX11 + libxcb + ] + ); postInstall = '' mv $out/bin/ruffle_desktop $out/bin/ruffle From 5faf70b127ff53565041b21854802b3905a32c53 Mon Sep 17 00:00:00 2001 From: Jasi Date: Sun, 5 Oct 2025 23:10:54 -0400 Subject: [PATCH 3/3] ruffle: remove open264 override Cisco openh264 won't cut a 2.5.2 release for ruffle and so ruffle upstream has decided to hold back their openh264 dependency due to flatpak dropping it due to ABI breakage. Instead, patch ruffle to accept any openh264 version in nixpkgs. - https://github.com/cisco/openh264/issues/3837 (original issue) - https://github.com/cisco/openh264/pull/3868 (patch) - https://github.com/cisco/openh264/issues/3873 (reason for using 2.4.1) This removes the security vulnerability CVEs for 2.4.1. --- pkgs/by-name/ru/ruffle/package.nix | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/pkgs/by-name/ru/ruffle/package.nix b/pkgs/by-name/ru/ruffle/package.nix index 83b8d0837682..6f4a11b8decf 100644 --- a/pkgs/by-name/ru/ruffle/package.nix +++ b/pkgs/by-name/ru/ruffle/package.nix @@ -36,6 +36,19 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-u12Qfc0fmcs7TU35/gqfRxjSpw9SDbc4+ebR7lGpvJI="; }; + postPatch = + let + versionList = lib.versions.splitVersion openh264.version; + major = lib.elemAt versionList 0; + minor = lib.elemAt versionList 1; + patch = lib.elemAt versionList 2; + in + '' + substituteInPlace video/external/src/decoder/openh264.rs \ + --replace-fail "OpenH264Version(2, 4, 1)" \ + "OpenH264Version(${major}, ${minor}, ${patch})" + ''; + cargoHash = "sha256-v/3vf7YYJiz+PMBsznvOJsNLtv6bEQ9pffAI33rLVuw="; cargoBuildFlags = lib.optional withRuffleTools "--workspace"; @@ -66,27 +79,12 @@ rustPlatform.buildRustPackage (finalAttrs: { (lib.getLib stdenv.cc.cc) ]; - # Prevents ruffle from downloading openh264 at runtime for Linux - openh264-241 = - if stdenv.hostPlatform.isLinux then - openh264.overrideAttrs (_: rec { - version = "2.4.1"; - src = fetchFromGitHub { - owner = "cisco"; - repo = "openh264"; - tag = "v${version}"; - hash = "sha256-ai7lcGcQQqpsLGSwHkSs7YAoEfGCIbxdClO6JpGA+MI="; - }; - }) - else - null; - runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux ( [ wayland libxkbcommon vulkan-loader - finalAttrs.openh264-241 + openh264 ] ++ lib.optionals withX11 [ libXcursor