From 7142f594baaffd8822ca92712015b33a9571fe9f Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Fri, 16 Apr 2021 18:30:17 +0200 Subject: [PATCH 1/2] godot-export-templates: init at 3.2.3 --- .../tools/godot/export-templates.nix | 17 +++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/development/tools/godot/export-templates.nix diff --git a/pkgs/development/tools/godot/export-templates.nix b/pkgs/development/tools/godot/export-templates.nix new file mode 100644 index 000000000000..bfcf3e3b3dca --- /dev/null +++ b/pkgs/development/tools/godot/export-templates.nix @@ -0,0 +1,17 @@ +{ godot, lib }: + +# https://docs.godotengine.org/en/stable/development/compiling/compiling_for_x11.html#building-export-templates +godot.overrideAttrs (oldAttrs: rec { + pname = "godot-export-templates"; + sconsFlags = "target=release platform=x11 tools=no"; + installPhase = '' + # The godot export command expects the export templates at + # .../share/godot/templates/3.2.3.stable with 3.2.3 being the godot version. + mkdir -p "$out/share/godot/templates/${oldAttrs.version}.stable" + cp bin/godot.x11.opt.64 $out/share/godot/templates/${oldAttrs.version}.stable/linux_x11_64_release + ''; + outputs = [ "out" ]; + meta.description = + "Free and Open Source 2D and 3D game engine (export templates)"; + meta.maintainers = with lib.maintainers; [ twey jojosch ]; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 13be95c1d873..0b4cbe7fe004 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5046,6 +5046,8 @@ in godot = callPackage ../development/tools/godot {}; + godot-export-templates = callPackage ../development/tools/godot/export-templates.nix { }; + godot-headless = callPackage ../development/tools/godot/headless.nix { }; godot-server = callPackage ../development/tools/godot/server.nix { }; From 0ed5aa8f6ad3d9b08909c3a0a64d1fdb6a5c1c6a Mon Sep 17 00:00:00 2001 From: Johannes Schleifenbaum Date: Fri, 16 Apr 2021 18:30:49 +0200 Subject: [PATCH 2/2] oh-my-git: init at 0.6.4 --- pkgs/games/oh-my-git/default.nix | 115 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 117 insertions(+) create mode 100644 pkgs/games/oh-my-git/default.nix diff --git a/pkgs/games/oh-my-git/default.nix b/pkgs/games/oh-my-git/default.nix new file mode 100644 index 000000000000..89dc1bdd50ea --- /dev/null +++ b/pkgs/games/oh-my-git/default.nix @@ -0,0 +1,115 @@ +{ lib +, copyDesktopItems +, fetchFromGitHub +, makeDesktopItem +, stdenv +, alsaLib +, gcc-unwrapped +, git +, godot-export-templates +, godot-headless +, libGLU +, libX11 +, libXcursor +, libXext +, libXfixes +, libXi +, libXinerama +, libXrandr +, libXrender +, libglvnd +, libpulseaudio +, zlib +}: + +stdenv.mkDerivation rec { + pname = "oh-my-git"; + version = "0.6.4"; + + src = fetchFromGitHub { + owner = "git-learning-game"; + repo = "oh-my-git"; + rev = version; + sha256 = "sha256-GQLHyBUXF+yqEZ/LYutAn6TBCXFX8ViOaERQEm2J6CY="; + }; + + nativeBuildInputs = [ + copyDesktopItems + godot-headless + ]; + + buildInputs = [ + alsaLib + gcc-unwrapped.lib + git + libGLU + libX11 + libXcursor + libXext + libXfixes + libXi + libXinerama + libXrandr + libXrender + libglvnd + libpulseaudio + zlib + ]; + + desktopItems = [ + (makeDesktopItem { + name = "oh-my-git"; + exec = "oh-my-git"; + icon = "oh-my-git"; + desktopName = "oh-my-git"; + comment = "An interactive Git learning game!"; + genericName = "An interactive Git learning game!"; + categories = "Game;"; + }) + ]; + + buildPhase = '' + runHook preBuild + + # Cannot create file '/homeless-shelter/.config/godot/projects/...' + export HOME=$TMPDIR + + # Link the export-templates to the expected location. The --export commands + # expects the template-file at .../templates/3.2.3.stable/linux_x11_64_release + # with 3.2.3 being the version of godot. + mkdir -p $HOME/.local/share/godot + ln -s ${godot-export-templates}/share/godot/templates $HOME/.local/share/godot + + mkdir -p $out/share/oh-my-git + godot-headless --export "Linux" $out/share/oh-my-git/oh-my-git + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + ln -s $out/share/oh-my-git/oh-my-git $out/bin + + # Patch binaries. + interpreter=$(cat $NIX_CC/nix-support/dynamic-linker) + patchelf \ + --set-interpreter $interpreter \ + --set-rpath ${lib.makeLibraryPath buildInputs} \ + $out/share/oh-my-git/oh-my-git + + mkdir -p $out/share/pixmaps + cp images/oh-my-git.png $out/share/pixmaps/oh-my-git.png + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://ohmygit.org/"; + description = "An interactive Git learning game"; + license = with licenses; [ blueOak100 ]; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ jojosch ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0b4cbe7fe004..d7e73394b161 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2753,6 +2753,8 @@ in meritous = callPackage ../games/meritous { }; + oh-my-git = callPackage ../games/oh-my-git { }; + opendune = callPackage ../games/opendune { }; merriweather = callPackage ../data/fonts/merriweather { };