ruffle: drop openh264 override; add x11 argument; fix version (#448931)
This commit is contained in:
@@ -2,14 +2,17 @@
|
|||||||
lib,
|
lib,
|
||||||
stdenv,
|
stdenv,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
withRuffleTools ? false,
|
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
jre_minimal,
|
jre_minimal,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
autoPatchelfHook,
|
autoPatchelfHook,
|
||||||
alsa-lib,
|
alsa-lib,
|
||||||
wayland,
|
wayland,
|
||||||
xorg,
|
libXcursor,
|
||||||
|
libXrandr,
|
||||||
|
libXi,
|
||||||
|
libX11,
|
||||||
|
libxcb,
|
||||||
vulkan-loader,
|
vulkan-loader,
|
||||||
udev,
|
udev,
|
||||||
libxkbcommon,
|
libxkbcommon,
|
||||||
@@ -18,25 +21,41 @@
|
|||||||
curl,
|
curl,
|
||||||
jq,
|
jq,
|
||||||
nix-update,
|
nix-update,
|
||||||
|
withX11 ? true,
|
||||||
|
withRuffleTools ? false,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
pname = "ruffle";
|
pname = "ruffle";
|
||||||
version = "0.2-nightly-2025-10-05";
|
version = "0.2.0-nightly-2025-10-05";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "ruffle-rs";
|
owner = "ruffle-rs";
|
||||||
repo = "ruffle";
|
repo = "ruffle";
|
||||||
tag = lib.strings.removePrefix "0.2-" finalAttrs.version;
|
tag = lib.strings.removePrefix "0.2.0-" finalAttrs.version;
|
||||||
hash = "sha256-u12Qfc0fmcs7TU35/gqfRxjSpw9SDbc4+ebR7lGpvJI=";
|
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=";
|
cargoHash = "sha256-v/3vf7YYJiz+PMBsznvOJsNLtv6bEQ9pffAI33rLVuw=";
|
||||||
cargoBuildFlags = lib.optional withRuffleTools "--workspace";
|
cargoBuildFlags = lib.optional withRuffleTools "--workspace";
|
||||||
|
|
||||||
env =
|
env =
|
||||||
let
|
let
|
||||||
tag = lib.strings.removePrefix "0.2-" finalAttrs.version;
|
tag = lib.strings.removePrefix "0.2.0-" finalAttrs.version;
|
||||||
versionDate = lib.strings.removePrefix "0.2-nightly-" finalAttrs.version;
|
versionDate = lib.strings.removePrefix "0.2.0-nightly-" finalAttrs.version;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
VERGEN_IDEMPOTENT = "1";
|
VERGEN_IDEMPOTENT = "1";
|
||||||
@@ -60,32 +79,21 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
(lib.getLib stdenv.cc.cc)
|
(lib.getLib stdenv.cc.cc)
|
||||||
];
|
];
|
||||||
|
|
||||||
# Prevents ruffle from downloading openh264 at runtime for Linux
|
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux (
|
||||||
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
|
wayland
|
||||||
xorg.libXcursor
|
|
||||||
xorg.libXrandr
|
|
||||||
xorg.libXi
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libxcb
|
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
vulkan-loader
|
vulkan-loader
|
||||||
finalAttrs.openh264-241
|
openh264
|
||||||
];
|
]
|
||||||
|
++ lib.optionals withX11 [
|
||||||
|
libXcursor
|
||||||
|
libXrandr
|
||||||
|
libXi
|
||||||
|
libX11
|
||||||
|
libxcb
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mv $out/bin/ruffle_desktop $out/bin/ruffle
|
mv $out/bin/ruffle_desktop $out/bin/ruffle
|
||||||
@@ -116,7 +124,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
curl https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1 | \
|
curl https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1 | \
|
||||||
jq -r ".[0].tag_name" \
|
jq -r ".[0].tag_name" \
|
||||||
)"
|
)"
|
||||||
exec nix-update --version "0.2-$version" ruffle
|
exec nix-update --version "0.2.0-$version" ruffle
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -135,11 +143,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
homepage = "https://ruffle.rs/";
|
homepage = "https://ruffle.rs/";
|
||||||
downloadPage = "https://ruffle.rs/downloads";
|
downloadPage = "https://ruffle.rs/downloads";
|
||||||
changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${lib.strings.removePrefix "0.2" finalAttrs.version}";
|
|
||||||
license = [
|
license = [
|
||||||
lib.licenses.mit
|
lib.licenses.mit
|
||||||
lib.licenses.asl20
|
lib.licenses.asl20
|
||||||
];
|
];
|
||||||
|
changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${lib.strings.removePrefix "0.2.0-" finalAttrs.version}";
|
||||||
maintainers = [
|
maintainers = [
|
||||||
lib.maintainers.jchw
|
lib.maintainers.jchw
|
||||||
lib.maintainers.normalcea
|
lib.maintainers.normalcea
|
||||||
|
|||||||
Reference in New Issue
Block a user