Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruffle-bin: init at 2025-01-13 (#285887) #373520

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions pkgs/by-name/ru/ruffle-bin/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
lib,
stdenvNoCC,
fetchurl,
fetchFromGitHub,
wrapGAppsHook3,
autoPatchelfHook,
alsa-lib,
wayland,
libxkbcommon,
vulkan-loader,
xorg,
openh264,
withXorg ? stdenvNoCC.hostPlatform.isLinux,
}:
let
pname = "ruffle-bin";
version = "nightly-2025-01-13";

openh264-2-4-1 = openh264.overrideAttrs (old: {
src = fetchFromGitHub {
owner = "cisco";
repo = "openh264";
rev = "v2.4.1";
hash = "sha256-ai7lcGcQQqpsLGSwHkSs7YAoEfGCIbxdClO6JpGA+MI=";
};
postPatch = "";
});
urlPrefix =
version:
"https://github.com/ruffle-rs/ruffle/releases/download/${version}/ruffle-nightly-${
builtins.replaceStrings [ "-" ] [ "_" ] (lib.strings.removePrefix "nightly-" version)
}";
x86_64-linux = stdenvNoCC.mkDerivation (finalAttrs: {
inherit
pname
version
meta
;

src = fetchurl {
url = "${urlPrefix 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
openh264-2-4-1
]
++ lib.optionals withXorg [
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 = stdenvNoCC.mkDerivation (finalAttrs: {
inherit
pname
version
meta
;

src = fetchurl {
url = "${urlPrefix finalAttrs.version}-macos-universal.tar.gz";
hash = "sha256-q252R1IVhfa4YC/pwhxK/EEz7/3NOy2uwkMdtKIZE/Q=";
};

sourceRoot = ".";

installPhase = ''
runHook preInstall

mkdir -p "$out/Applications"
cp -R Ruffle.app "$out/Applications"

mkdir -p $out/bin
ln -s "$out/Applications/Ruffle.app/Contents/MacOS/ruffle" "$out/bin/ruffle"

runHook postInstall
'';
});

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