Commit 3e77df99 authored by liberodark's avatar liberodark
Browse files

ruffle: nightly-2025-01-25 -> nightly-2025-03-28

parent e51ecca9
Loading
Loading
Loading
Loading
+81 −86
Original line number Diff line number Diff line
{
  alsa-lib,
  lib,
  stdenvNoCC,
  rustPlatform,
  withRuffleTools ? false,
  fetchFromGitHub,
  makeWrapper,
  openssl,
  jre_minimal,
  pkg-config,
  python3,
  rustPlatform,
  stdenvNoCC,
  lib,
  wrapGAppsHook3,
  darwin,
  alsa-lib,
  gtk3,
  openssl,
  wayland,
  xorg,
  vulkan-loader,
  udev,
  jre_minimal,
  cairo,
  gtk3,
  wrapGAppsHook3,
  gsettings-desktop-schemas,
  glib,
  libxkbcommon,
  openh264,
  darwin,
  writeShellApplication,
  curl,
  jq,
  nix-update,
}:
let
rustPlatform.buildRustPackage (finalAttrs: {
  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 {
  inherit pname version;
  version = "0-nightly-2025-03-28";

  src = fetchFromGitHub {
    owner = "ruffle-rs";
    repo = pname;
    tag = version;
    hash = "sha256-JLh0tatP70rYo2QXLKu6M9jJ1gFpY76sYaUJqW9U4E0=";
    repo = "ruffle";
    tag = lib.strings.removePrefix "0-" finalAttrs.version;
    hash = "sha256-p2EEoHXseIXms4Xjyi3aNWCU0W9slXkeqrCrPvq1BjI=";
  };

  patches = [ ./remove-deterministic-feature.patch ];

  useFetchCargoVendor = true;
  cargoHash = "sha256-PbNp/V+xmU6Lo24a6pd9XoT/LQmINztjOHKoikG9N4Y=";
  cargoHash = "sha256-RcCIt6xVZaQA7eSgKngHtsGafHFwv1bISK0XKWoNWtI=";
  cargoBuildFlags = lib.optional withRuffleTools "--workspace";

  env =
    let
      tag = lib.strings.removePrefix "0-" finalAttrs.version;
      versionDate = lib.strings.removePrefix "0-nightly-" finalAttrs.version;
    in
    {
      VERGEN_IDEMPOTENT = "1";
      VERGEN_GIT_SHA = tag;
      VERGEN_GIT_COMMIT_DATE = versionDate;
      VERGEN_GIT_COMMIT_TIMESTAMP = "${versionDate}T00:00:00Z";
    };

  nativeBuildInputs =
    [ jre_minimal ]
    ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [
      glib
      gsettings-desktop-schemas
      makeWrapper
      pkg-config
      python3
      wrapGAppsHook3
    ]
    ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
@@ -71,32 +59,19 @@ rustPlatform.buildRustPackage {
  buildInputs =
    lib.optionals stdenvNoCC.hostPlatform.isLinux [
      alsa-lib
      cairo
      gtk3
      openssl
      wayland
      xorg.libX11
      xorg.libXcursor
      xorg.libXi
      xorg.libxcb
      xorg.libXrender
      vulkan-loader
      udev
    ]
    ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];

  cargoBuildFlags = [ "--workspace" ];

  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
      install -Dm644 LICENSE.md -t $out/share/doc/ruffle
      install -Dm644 README.md -t $out/share/doc/ruffle
    ''
    + lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
      install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.desktop \
@@ -107,32 +82,52 @@ rustPlatform.buildRustPackage {

      install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml \
                     -t $out/share/metainfo/

      rm $out/bin/ruffle_web_safari
    '';

  # Prevents ruffle from downloading openh264 at runtime for Linux
  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;

  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
    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${
      lib.makeLibraryPath [
        libxkbcommon
        finalAttrs.openh264-241
        vulkan-loader
        wayland
      ]
    })
  '';

  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[@]}"
  passthru = {
    updateScript = lib.getExe (writeShellApplication {
      name = "ruffle-update";
      runtimeInputs = [
        curl
        jq
        nix-update
      ];
      text = ''
        version="$( \
          curl https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1 | \
          jq -r ".[0].tag_name" \
        )"
        exec nix-update --version "0-$version" ruffle
      '';
    });
  };

  meta = {
    description = "Cross platform Adobe Flash Player emulator";
@@ -142,13 +137,13 @@ rustPlatform.buildRustPackage {
      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.
      Additionally, overriding the `withRuffleTools` input to
      `true` will build all the available packages in the ruffle
      project, including the `exporter` and `scanner` utilities.
    '';
    homepage = "https://ruffle.rs/";
    downloadPage = "https://ruffle.rs/downloads";
    changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${version}";
    changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/${lib.strings.removePrefix "0-" finalAttrs.version}";
    license = [
      lib.licenses.mit
      lib.licenses.asl20
@@ -160,4 +155,4 @@ rustPlatform.buildRustPackage {
    mainProgram = "ruffle";
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
}
})
+0 −52
Original line number Diff line number Diff line
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" }
 No newline at end of file