Skip to content

Commit 3c023c2

Browse files
committed
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.
1 parent 7957a73 commit 3c023c2

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

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

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
lib,
33
stdenv,
44
rustPlatform,
5-
withRuffleTools ? false,
65
fetchFromGitHub,
76
jre_minimal,
87
pkg-config,
98
autoPatchelfHook,
109
alsa-lib,
1110
wayland,
12-
xorg,
11+
libXcursor,
12+
libXrandr,
13+
libXi,
14+
libX11,
15+
libxcb,
1316
vulkan-loader,
1417
udev,
1518
libxkbcommon,
@@ -18,7 +21,10 @@
1821
curl,
1922
jq,
2023
nix-update,
24+
withX11 ? true,
25+
withRuffleTools ? false,
2126
}:
27+
2228
rustPlatform.buildRustPackage (finalAttrs: {
2329
pname = "ruffle";
2430
version = "0.2.0-nightly-2025-10-05";
@@ -75,17 +81,21 @@ rustPlatform.buildRustPackage (finalAttrs: {
7581
else
7682
null;
7783

78-
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [
79-
wayland
80-
xorg.libXcursor
81-
xorg.libXrandr
82-
xorg.libXi
83-
xorg.libX11
84-
xorg.libxcb
85-
libxkbcommon
86-
vulkan-loader
87-
finalAttrs.openh264-241
88-
];
84+
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux (
85+
[
86+
wayland
87+
libxkbcommon
88+
vulkan-loader
89+
finalAttrs.openh264-241
90+
]
91+
++ lib.optionals withX11 [
92+
libXcursor
93+
libXrandr
94+
libXi
95+
libX11
96+
libxcb
97+
]
98+
);
8999

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

0 commit comments

Comments
 (0)