From 213f7a3b1606f62de82634df4934961a967bc40b Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Fri, 5 Sep 2025 14:49:04 -0500 Subject: [PATCH] snowemu: init at 1.1.0 --- pkgs/by-name/sn/snowemu/package.nix | 82 +++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 pkgs/by-name/sn/snowemu/package.nix diff --git a/pkgs/by-name/sn/snowemu/package.nix b/pkgs/by-name/sn/snowemu/package.nix new file mode 100644 index 000000000000..1659bb517991 --- /dev/null +++ b/pkgs/by-name/sn/snowemu/package.nix @@ -0,0 +1,82 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + makeWrapper, + makeDesktopItem, + SDL2, + pkg-config, + xorg, + wayland, + libxkbcommon, + libGL, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "snowemu"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "twvd"; + repo = "snow"; + tag = "v${finalAttrs.version}"; + hash = "sha256-m3CPKswOB2j2r/BTf9RzCvwPVq3gbKemtk11HKS1nHk="; + fetchSubmodules = true; + }; + cargoHash = "sha256-+FS5785F8iWPt6Db+IKRbOFAYNEfHC+jvPVdwkLZ5YI="; + + nativeBuildInputs = [ + pkg-config + makeWrapper + ]; + + buildInputs = [ + SDL2.dev + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + ]; + + postInstall = '' + mv $out/bin/snow_frontend_egui $out/bin/snowemu + + install -Dm644 docs/images/snow_icon.png $out/share/icons/hicolor/apps/snowemu.png + + wrapProgram $out/bin/snowemu \ + --prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + wayland + libxkbcommon + libGL + ] + } + ''; + + desktopItems = makeDesktopItem { + name = "snowemu"; + exec = "snowemu"; + icon = "snowemu"; + desktopName = "Snow Emulator"; + comment = finalAttrs.meta.description; + genericName = "Vintage Macintosh emulator"; + categories = [ + "Game" + "Emulator" + ]; + }; + + meta = { + description = "Early Macintosh emulator"; + longDescription = '' + Snow emulates classic (Motorola 680x0-based) Macintosh computers. It features a graphical user interface to operate the emulated machine and provides extensive debugging capabilities. The aim of this project is to emulate the Macintosh on a hardware-level as much as possible, as opposed to emulators that patch the ROM or intercept system calls. + It currently emulates the Macintosh 128K, Macintosh 512K, Macintosh Plus, Macintosh SE, Macintosh Classic and Macintosh II. + ''; + homepage = "https://snowemu.com/"; + changelog = "https://github.com/twvd/snow/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ nulleric ]; + platforms = lib.platforms.linux; + mainProgram = "snowemu"; + }; +})