about summary refs log tree commit diff
path: root/nix/overgrowth.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/overgrowth.nix')
-rw-r--r--nix/overgrowth.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/nix/overgrowth.nix b/nix/overgrowth.nix
new file mode 100644
index 0000000..5b59134
--- /dev/null
+++ b/nix/overgrowth.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, makeDesktopItem
+, libGL, libGLU, SDL2, SDL2_net, gtk2, glib
+, openal, libogg, libvorbis, libtheora
+, libjpeg, freeimage, freetype, bzip2
+, aux-data ? "" }:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "overgrowth";
+    desktopName = "Overgrowth";
+    icon = "overgrowth";
+    exec = "overgrowth";
+    path = aux-data;
+    categories = [ "Game" ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "overgrowth";
+  version = "unstable-2022-04-29";
+
+  src = fetchFromGitHub {
+    owner = "WolfireGames";
+    repo = pname;
+    rev = "dbe069e42e1cea27654a8fb618fdde77f41ac257";
+    sha256 = "sha256-81VKN0mU8XFdOZb6jrii2FeyVXCUiytcF2pgdO0je0s=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    libGL libGLU SDL2 SDL2_net gtk2 glib
+    openal libogg libvorbis libtheora
+    libjpeg freeimage freetype bzip2
+  ];
+
+  cmakeFlags = [
+    "-S../Projects"
+    "-DAUX_DATA=${aux-data}"
+    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
+    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
+  ];
+  hardeningDisable = [ "format" ];
+
+  installPhase = ''
+    install -D build/Overgrowth.bin.* $out/bin/overgrowth
+    install -D Projects/OGIcon.png\
+      $out/share/icons/hicolor/1024x1024/apps/overgrowth.png
+    install -D ${desktopItem}/share/applications/overgrowth.desktop \
+      $out/share/applications/overgrowth.desktop
+  '';
+
+  meta = {
+    description = "Third person ninja rabbit fighting game";
+    homepage = "https://overgrowth.wolfire.com";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.McSinyx ];
+    platforms = lib.platforms.linux;
+  };
+}