Skip to content

Commit

Permalink
ruffle-bin: init at 2025-01-13 (#285887)
Browse files Browse the repository at this point in the history
  • Loading branch information
normalcea committed Jan 13, 2025
1 parent 5d06898 commit f7976d2
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions pkgs/by-name/ru/ruffle-bin/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
lib,
stdenvNoCC,
fetchurl,
wrapGAppsHook3,
autoPatchelfHook,
alsa-lib,
wayland,
libxkbcommon,
vulkan-loader,
xorg,
nix-update-script,
xorgSupport ? stdenvNoCC.hostPlatform.isLinux,
}:
let
pname = "ruffle-bin";
version = "nightly-2025-01-13";
passthru.updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; };

x86_64-linux = stdenvNoCC.mkDerivation (finalAttrs: {
inherit
pname
version
passthru
meta
;

src = fetchurl {
url = "https://github.com/ruffle-rs/ruffle/releases/download/${finalAttrs.version}/ruffle-nightly-${
builtins.replaceStrings [ "-" ] [ "_" ] (lib.strings.removePrefix "nightly-" finalAttrs.version)
}-linux-x86_64.tar.gz";
hash = "sha256-pn+3cWgMnH06VCBgRxVGB9Dx9Kxq5IAm6ytLa744OOY=";
};

nativeBuildInputs = [
wrapGAppsHook3
autoPatchelfHook
];

buildInputs = [
alsa-lib # libasound.so.2
];

runtimeDependencies =
[
wayland
libxkbcommon
vulkan-loader
]
++ lib.optionals xorgSupport [
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libxcb
xorg.libXrender
];

sourceRoot = ".";

installPhase = ''
runHook preInstall
install -Dm755 -t $out/bin/ ruffle
install -Dm644 -t $out/share/icons/hicolor/scalable/apps/ extras/rs.ruffle.Ruffle.svg
install -Dm644 -t $out/share/applications/ extras/rs.ruffle.Ruffle.desktop
install -Dm644 -t $out/share/metainfo/ extras/rs.ruffle.Ruffle.metainfo.xml
install -Dm644 -t $out/share/doc/ruffle LICENSE.md
install -Dm644 -t $out/share/doc/ruffle README.md
runHook postInstall
'';
});

# TODO: Add Darwin support.
darwin = null;

meta = {
description = "Nightly pre-built binary release of ruffle, the Adobe Flash Player emulator";
homepage = "https://ruffle.rs/";
license = [
lib.licenses.mit
lib.licenses.asl20
];
downloadPage = "https://ruffle.rs/downloads";
changelog = "https://github.com/ruffle-rs/ruffle/releases/tag/nightly-${version}";
maintainers = [ ];
platforms = lib.platforms.darwin ++ [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
mainProgram = "ruffle";
};
in
if stdenvNoCC.hostPlatform.isDarwin then darwin else x86_64-linux

0 comments on commit f7976d2

Please sign in to comment.