From f5332168e9a7a4799e515946684025482fe7807a Mon Sep 17 00:00:00 2001 From: Rampoina Date: Sun, 30 Apr 2023 17:41:20 +0200 Subject: [PATCH] marble-marcher-ce: init at 1.4.5 --- pkgs/games/marble-marcher-ce/default.nix | 68 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/games/marble-marcher-ce/default.nix diff --git a/pkgs/games/marble-marcher-ce/default.nix b/pkgs/games/marble-marcher-ce/default.nix new file mode 100644 index 000000000000..08ff58addf59 --- /dev/null +++ b/pkgs/games/marble-marcher-ce/default.nix @@ -0,0 +1,68 @@ +{ lib +, stdenv +, makeWrapper +, makeDesktopItem +, copyDesktopItems +, fetchFromGitHub +, sfml +, anttweakbar +, glm +, eigen +, glew +, cmake +}: +stdenv.mkDerivation rec { + pname = "marble-marcher-ce"; + version = "1.4.5"; + + src = fetchFromGitHub { + owner = "WAUthethird"; + repo = "Marble-Marcher-Community-Edition"; + rev = version; + hash = "sha256-m5i/Q4k5S4wcojHqMYS7e1W/Ph7q/95j3oOK2xbrHSk="; + }; + + buildInputs = [ sfml anttweakbar glm eigen glew ]; + nativeBuildInputs = [ cmake makeWrapper copyDesktopItems ]; + installFlags = [ "DESTDIR=$(out)" ]; + + prePatch = '' + # the path /home/MMCE is always added to DESTDIR + # we change this to a more sensible path + # see https://github.com/WAUthethird/Marble-Marcher-Community-Edition/issues/23 + substituteInPlace CMakeLists.txt \ + --replace '/home/MMCE' '/share/MMCE' + ''; + + postInstall = '' + mkdir $out/bin + mkdir -p $out/share/icons/ + # The executable has to be run from the same directory the assets are in + makeWrapper $out/share/MMCE/MarbleMarcher $out/bin/${pname} --chdir $out/share/MMCE + ln -s $out/share/MMCE/images/MarbleMarcher.png $out/share/icons/${pname}.png + ''; + + desktopItems = [ + (makeDesktopItem { + name = pname; + exec = pname; + icon = pname; + desktopName = pname; + comment = meta.description; + categories = [ "Game" ]; + }) + ]; + + meta = with lib; { + description = "A fractal physics game."; + longDescription = "A community-developed version of the original Marble Marcher - a fractal physics game."; + homepage = "https://michaelmoroz.itch.io/mmce"; + license = with licenses; [ + gpl2Plus # Code + cc-by-30 # Assets + ofl # Fonts + ]; + maintainers = with maintainers; [ rampoina ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0bfebbf56bd3..35279e86e669 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36301,6 +36301,8 @@ with pkgs; manaplus = callPackage ../games/manaplus { stdenv = gcc11Stdenv; }; + marble-marcher-ce = callPackage ../games/marble-marcher-ce { }; + mars = callPackage ../games/mars { }; megaglest = callPackage ../games/megaglest { };