Unverified Commit 3c023c2b authored by Jasi's avatar Jasi
Browse files

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.
parent 7957a734
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -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 [
  runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux (
    [
      wayland
    xorg.libXcursor
    xorg.libXrandr
    xorg.libXi
    xorg.libX11
    xorg.libxcb
      libxkbcommon
      vulkan-loader
      finalAttrs.openh264-241
  ];
    ]
    ++ lib.optionals withX11 [
      libXcursor
      libXrandr
      libXi
      libX11
      libxcb
    ]
  );

  postInstall = ''
    mv $out/bin/ruffle_desktop $out/bin/ruffle