Skip to content

Commit 5faf70b

Browse files
committed
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. - cisco/openh264#3837 (original issue) - cisco/openh264#3868 (patch) - cisco/openh264#3873 (reason for using 2.4.1) This removes the security vulnerability CVEs for 2.4.1.
1 parent 3c023c2 commit 5faf70b

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

pkgs/by-name/ru/ruffle/package.nix

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ rustPlatform.buildRustPackage (finalAttrs: {
3636
hash = "sha256-u12Qfc0fmcs7TU35/gqfRxjSpw9SDbc4+ebR7lGpvJI=";
3737
};
3838

39+
postPatch =
40+
let
41+
versionList = lib.versions.splitVersion openh264.version;
42+
major = lib.elemAt versionList 0;
43+
minor = lib.elemAt versionList 1;
44+
patch = lib.elemAt versionList 2;
45+
in
46+
''
47+
substituteInPlace video/external/src/decoder/openh264.rs \
48+
--replace-fail "OpenH264Version(2, 4, 1)" \
49+
"OpenH264Version(${major}, ${minor}, ${patch})"
50+
'';
51+
3952
cargoHash = "sha256-v/3vf7YYJiz+PMBsznvOJsNLtv6bEQ9pffAI33rLVuw=";
4053
cargoBuildFlags = lib.optional withRuffleTools "--workspace";
4154

@@ -66,27 +79,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
6679
(lib.getLib stdenv.cc.cc)
6780
];
6881

69-
# Prevents ruffle from downloading openh264 at runtime for Linux
70-
openh264-241 =
71-
if stdenv.hostPlatform.isLinux then
72-
openh264.overrideAttrs (_: rec {
73-
version = "2.4.1";
74-
src = fetchFromGitHub {
75-
owner = "cisco";
76-
repo = "openh264";
77-
tag = "v${version}";
78-
hash = "sha256-ai7lcGcQQqpsLGSwHkSs7YAoEfGCIbxdClO6JpGA+MI=";
79-
};
80-
})
81-
else
82-
null;
83-
8482
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux (
8583
[
8684
wayland
8785
libxkbcommon
8886
vulkan-loader
89-
finalAttrs.openh264-241
87+
openh264
9088
]
9189
++ lib.optionals withX11 [
9290
libXcursor

0 commit comments

Comments
 (0)