about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
new file mode 100644
index 000000000000..03d0018f237b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU_combined, libpng, lua5, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  name = "gravit-0.5.1";
+
+  src = fetchurl {
+    url = "https://gravit.slowchop.com/media/downloads/${name}.tgz";
+    sha256 = "14vf7zj2bgrl96wsl3f1knsggc8h9624354ajzd72l46y09x5ky7";
+  };
+
+  buildInputs = [ libGLU_combined SDL SDL_ttf SDL_image lua5 libpng libSM libICE ];
+
+  nativeBuildInputs = [ autoconf automake ];
+
+  preConfigure = ''
+    ./autogen.sh
+
+    # Build fails on Linux with windres.
+    export ac_cv_prog_WINDRES=
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://gravit.slowchop.com;
+    description = "Beautiful OpenGL-based gravity simulator";
+    license = stdenv.lib.licenses.gpl2;
+
+    longDescription = ''
+      Gravit is a gravity simulator which runs under Linux, Windows and
+      macOS. It uses Newtonian physics using the Barnes-Hut N-body
+      algorithm. Although the main goal of Gravit is to be as accurate
+      as possible, it also creates beautiful looking gravity patterns.
+      It records the history of each particle so it can animate and
+      display a path of its travels. At any stage you can rotate your
+      view in 3D and zoom in and out.
+    '';
+
+    platforms = stdenv.lib.platforms.mesaPlatforms;
+    hydraPlatforms = stdenv.lib.platforms.linux; # darwin times out
+  };
+}