From ba28a10b1a5bf09ea2df70c1becb52627d66cc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Dami=C3=A1n=20Schonborn?= Date: Fri, 18 Apr 2025 13:14:12 -0300 Subject: [PATCH] opensurge: init at 0.6.1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Federico Damián Schonborn --- pkgs/by-name/op/opensurge/package.nix | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 pkgs/by-name/op/opensurge/package.nix diff --git a/pkgs/by-name/op/opensurge/package.nix b/pkgs/by-name/op/opensurge/package.nix new file mode 100644 index 000000000000..566a189e706c --- /dev/null +++ b/pkgs/by-name/op/opensurge/package.nix @@ -0,0 +1,64 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + ninja, + allegro5, + libglvnd, + surgescript, + physfs, + xorg, + versionCheckHook, + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "opensurge"; + version = "0.6.1.2"; + + src = fetchFromGitHub { + owner = "alemart"; + repo = "opensurge"; + tag = "v${finalAttrs.version}"; + hash = "sha256-HvpKZ62mYy7XkZOnIn7QRA2rFVREFnKO1NO83aCR76k="; + }; + + nativeBuildInputs = [ + cmake + ninja + ]; + + buildInputs = [ + allegro5 + libglvnd + physfs + surgescript + xorg.libX11 + ]; + + cmakeFlags = [ + "-DGAME_BINDIR=${placeholder "out"}/bin" + "-DDESKTOP_ICON_PATH=${placeholder "out"}/share/pixmaps" + "-DDESKTOP_METAINFO_PATH=${placeholder "out"}/share/metainfo" + "-DDESKTOP_ENTRY_PATH=${placeholder "out"}/share/applications" + "-DWANT_BUILD_DATE=OFF" + ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + # Darwin fails with "Critical error: required built-in appearance SystemAppearance not found" + doInstallCheck = !stdenv.hostPlatform.isDarwin; + + passthru.updateScript = nix-update-script { }; + + meta = { + mainProgram = "opensurge"; + description = "Fun 2D retro platformer inspired by Sonic games and a game creation system"; + homepage = "https://opensurge2d.org/"; + downloadPage = "https://github.com/alemart/opensurge"; + changelog = "https://github.com/alemart/opensurge/blob/v${finalAttrs.version}/CHANGES.md"; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ federicoschonborn ]; + }; +})