ruffle: nightly-2025-01-04 -> nightly-2025-01-25

Resolves #285887.
This commit is contained in:
normalc
2025-01-26 17:23:39 -05:00
parent b845aa355f
commit d1ed29454b
2 changed files with 143 additions and 51 deletions
+91 -51
View File
@@ -6,7 +6,7 @@
pkg-config,
python3,
rustPlatform,
stdenv,
stdenvNoCC,
lib,
wayland,
xorg,
@@ -19,25 +19,46 @@
gsettings-desktop-schemas,
glib,
libxkbcommon,
openh264,
darwin,
}:
let
version = "nightly-2025-01-04";
pname = "ruffle";
version = "nightly-2025-01-25";
# TODO: Remove overridden derivation once ruffle accepts upstream openh264-2.5.0
openh264-241 =
if stdenvNoCC.hostPlatform.isLinux then
openh264.overrideAttrs (_: rec {
version = "2.4.1";
src = fetchFromGitHub {
owner = "cisco";
repo = "openh264";
tag = "v${version}";
hash = "sha256-ai7lcGcQQqpsLGSwHkSs7YAoEfGCIbxdClO6JpGA+MI=";
};
postPatch = null;
})
else
null;
in
rustPlatform.buildRustPackage {
pname = "ruffle";
inherit version;
inherit pname version;
src = fetchFromGitHub {
owner = "ruffle-rs";
repo = "ruffle";
rev = version;
hash = "sha256-MxYl5fTTNerCwG3w34cltb6aasP6TvGRkvwf77lKIgs=";
repo = pname;
tag = version;
hash = "sha256-JLh0tatP70rYo2QXLKu6M9jJ1gFpY76sYaUJqW9U4E0=";
};
patches = [ ./remove-deterministic-feature.patch ];
useFetchCargoVendor = true;
cargoHash = "sha256-PbNp/V+xmU6Lo24a6pd9XoT/LQmINztjOHKoikG9N4Y=";
nativeBuildInputs =
[ jre_minimal ]
++ lib.optionals stdenv.hostPlatform.isLinux [
++ lib.optionals stdenvNoCC.hostPlatform.isLinux [
glib
gsettings-desktop-schemas
makeWrapper
@@ -45,10 +66,10 @@ rustPlatform.buildRustPackage {
python3
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
buildInputs =
lib.optionals stdenv.hostPlatform.isLinux [
lib.optionals stdenvNoCC.hostPlatform.isLinux [
alsa-lib
cairo
gtk3
@@ -62,53 +83,72 @@ rustPlatform.buildRustPackage {
vulkan-loader
udev
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];
dontWrapGApps = true;
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm644 -t $out/share/icons/hicolor/scalable/apps/ desktop/packages/linux/rs.ruffle.Ruffle.svg
install -Dm644 -t $out/share/applications/ desktop/packages/linux/rs.ruffle.Ruffle.desktop
substituteInPlace $out/share/applications/rs.ruffle.Ruffle.desktop \
--replace-fail "Exec=ruffle %u" "Exec=ruffle_desktop %u"
install -Dm644 -t $out/share/metainfo/ desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml
'';
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf $out/bin/ruffle_desktop \
--add-needed libxkbcommon-x11.so \
--add-needed libwayland-client.so \
--add-rpath ${libxkbcommon}/lib:${wayland}/lib
'';
postFixup =
''
# This name is too generic
mv $out/bin/exporter $out/bin/ruffle_exporter
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
vulkanWrapperArgs+=(
--prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
)
wrapProgram $out/bin/ruffle_exporter \
"''${vulkanWrapperArgs[@]}"
wrapProgram $out/bin/ruffle_desktop \
"''${vulkanWrapperArgs[@]}" \
"''${gappsWrapperArgs[@]}"
'';
++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];
cargoBuildFlags = [ "--workspace" ];
useFetchCargoVendor = true;
cargoHash = "sha256-q+9yhUjYolPlBt6W1xJPoyE7DgqDffEhkQqJmSX4y3Y=";
postInstall =
''
# Namespace binaries with "ruffle_"
mv $out/bin/exporter $out/bin/ruffle_exporter
mv $out/bin/mocket $out/bin/ruffle_mocket
mv $out/bin/stub-report $out/bin/ruffle_stub-report
mv $out/bin/build_playerglobal $out/bin/ruffle_build_playerglobal
# This name is too specific
mv $out/bin/ruffle_desktop $out/bin/ruffle
''
+ lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.desktop \
-t $out/share/applications/
install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.svg \
-t $out/share/icons/hicolor/scalable/apps/
install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml \
-t $out/share/metainfo/
rm $out/bin/ruffle_web_safari
'';
preFixup = lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
patchelf $out/bin/ruffle \
--add-needed libxkbcommon-x11.so \
--add-needed libwayland-client.so \
--add-needed libopenh264.so \
--add-rpath ${libxkbcommon}/lib:${wayland}/lib:${openh264-241}/lib
'';
dontWrapGApps = true;
postFixup = lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
vulkanWrapperArgs+=(
--prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
)
wrapProgram $out/bin/ruffle_exporter \
"''${vulkanWrapperArgs[@]}"
wrapProgram $out/bin/ruffle \
"''${vulkanWrapperArgs[@]}" \
"''${gappsWrapperArgs[@]}"
'';
meta = {
description = "Cross platform Adobe Flash Player emulator";
longDescription = ''
Ruffle is a cross platform emulator for running and preserving
Adobe Flash content. It is capable of running ActionScript 1, 2
and 3 programs with machine-native performance thanks to being
written in the Rust programming language.
This package for ruffle also includes the `exporter` and
`scanner` utilities which allow for generating screenshots as
PNGs and parsing `.swf` files in bulk respectively.
'';
homepage = "https://ruffle.rs/";
downloadPage = "https://ruffle.rs/downloads";
changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${version}";
license = [
lib.licenses.mit
lib.licenses.asl20
@@ -117,7 +157,7 @@ rustPlatform.buildRustPackage {
lib.maintainers.jchw
lib.maintainers.normalcea
];
mainProgram = "ruffle";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
mainProgram = "ruffle_desktop";
};
}
@@ -0,0 +1,52 @@
diff --git a/exporter/Cargo.toml b/exporter/Cargo.toml
index 93066a30d..0f8b71ae4 100644
--- a/exporter/Cargo.toml
+++ b/exporter/Cargo.toml
@@ -13,7 +13,7 @@ workspace = true
[dependencies]
clap = { workspace = true }
futures = { workspace = true }
-ruffle_core = { path = "../core", features = ["deterministic", "default_font"] }
+ruffle_core = { path = "../core", features = ["default_font"] }
ruffle_render_wgpu = { path = "../render/wgpu", features = ["clap"] }
image = { workspace = true, features = ["png"] }
walkdir = { workspace = true }
diff --git a/scanner/Cargo.toml b/scanner/Cargo.toml
index 59781ba79..40cf54c24 100644
--- a/scanner/Cargo.toml
+++ b/scanner/Cargo.toml
@@ -12,7 +12,7 @@ workspace = true
[dependencies]
clap = { workspace = true }
-ruffle_core = { path = "../core", features = ["deterministic"] }
+ruffle_core = { path = "../core" }
log = { workspace = true }
walkdir = { workspace = true }
serde = { workspace = true, features = ["derive"] }
diff --git a/tests/Cargo.toml b/tests/Cargo.toml
index 26bfc9a89..b7342b662 100644
--- a/tests/Cargo.toml
+++ b/tests/Cargo.toml
@@ -27,7 +27,7 @@ ruffle_render_wgpu = { path = "../render/wgpu", optional = true }
regex = "1.11.1"
[dev-dependencies]
-ruffle_core = { path = "../core", features = ["deterministic", "timeline_debug", "avm_debug", "audio", "mp3", "aac", "default_font", "test_only_as3"] }
+ruffle_core = { path = "../core", features = ["timeline_debug", "avm_debug", "audio", "mp3", "aac", "default_font", "test_only_as3"] }
ruffle_test_framework = { path = "framework" }
libtest-mimic = "0.8.1"
walkdir = { workspace = true }
diff --git a/tests/framework/Cargo.toml b/tests/framework/Cargo.toml
index ffc59e25b..639028578 100644
--- a/tests/framework/Cargo.toml
+++ b/tests/framework/Cargo.toml
@@ -11,7 +11,7 @@ version.workspace = true
workspace = true
[dependencies]
-ruffle_core = { path = "../../core", features = ["deterministic", "timeline_debug", "avm_debug", "audio", "mp3", "aac", "default_font", "serde"] }
+ruffle_core = { path = "../../core", features = ["timeline_debug", "avm_debug", "audio", "mp3", "aac", "default_font", "serde"] }
ruffle_render = { path = "../../render", features = ["serde"] }
ruffle_input_format = { path = "../input-format" }
ruffle_socket_format = { path = "../socket-format" }