ruffle: refactor to correct dependencies

(cherry picked from commit d18a0c4b36)
This commit is contained in:
JS (normalc/ea) 2025-05-16 16:39:59 -04:00 committed by github-actions[bot]
parent a59eb78007
commit 12637abcd4

View file

@ -1,16 +1,15 @@
{
lib,
stdenvNoCC,
stdenv,
rustPlatform,
withRuffleTools ? false,
fetchFromGitHub,
jre_minimal,
pkg-config,
wrapGAppsHook3,
autoPatchelfHook,
alsa-lib,
gtk3,
openssl,
wayland,
xorg,
vulkan-loader,
udev,
libxkbcommon,
@ -49,41 +48,21 @@ rustPlatform.buildRustPackage (finalAttrs: {
nativeBuildInputs =
[ jre_minimal ]
++ lib.optionals stdenvNoCC.hostPlatform.isLinux [
++ lib.optionals stdenv.hostPlatform.isLinux [
pkg-config
wrapGAppsHook3
autoPatchelfHook
]
++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenvNoCC.hostPlatform.isLinux [
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
gtk3
openssl
wayland
vulkan-loader
udev
(lib.getLib stdenv.cc.cc)
];
postInstall =
''
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 \
-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/
'';
# Prevents ruffle from downloading openh264 at runtime for Linux
openh264-241 =
if stdenvNoCC.hostPlatform.isLinux then
if stdenv.hostPlatform.isLinux then
openh264.overrideAttrs (_: rec {
version = "2.4.1";
src = fetchFromGitHub {
@ -92,20 +71,37 @@ rustPlatform.buildRustPackage (finalAttrs: {
tag = "v${version}";
hash = "sha256-ai7lcGcQQqpsLGSwHkSs7YAoEfGCIbxdClO6JpGA+MI=";
};
postPatch = null;
})
else
null;
preFixup = lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
libxkbcommon
finalAttrs.openh264-241
vulkan-loader
runtimeDependencies = [
wayland
]
})
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libX11
xorg.libxcb
libxkbcommon
vulkan-loader
finalAttrs.openh264-241
];
postInstall =
''
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 stdenv.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/
'';
passthru = {