base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / gr / gravit / package.nix
blobb734ea9750dcc6e584f0548eaaf28561b591c0ae
1 { lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake, mesa }:
3 stdenv.mkDerivation rec {
4   pname = "gravit";
5   version = "0.5.1";
7   src = fetchFromGitHub {
8     owner = "gak";
9     repo = pname;
10     rev = version;
11     hash = "sha256-JuqnLLD5+Ec8kQI0SK98V1O6TTbGM6+yKn5KCHe85eM=";
12   };
14   patches = [
15     # Pull fix pending upstream inclusion for -fno-common toolchains:
16     #   https://github.com/gak/gravit/pull/100
17     (fetchpatch {
18       name = "fno-common.patch";
19       url = "https://github.com/gak/gravit/commit/0f848834889212f16201fd404d2d5b9bb5b47d23.patch";
20       hash = "sha256-k1aMIg7idMt53o6dFgIKJflOMp0Jp5NwgWEijcIwXrQ=";
21     })
22   ];
24   buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image lua5 libpng libSM libICE ];
26   nativeBuildInputs = [ autoconf automake ];
28   preConfigure = ''
29     ./autogen.sh
31     # Build fails on Linux with windres.
32     export ac_cv_prog_WINDRES=
33   '';
35   enableParallelBuilding = true;
37   meta = {
38     broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
39     homepage = "https://github.com/gak/gravit";
40     description = "Beautiful OpenGL-based gravity simulator";
41     mainProgram = "gravit";
42     license = lib.licenses.gpl2Plus;
44     longDescription = ''
45       Gravit is a gravity simulator which runs under Linux, Windows and
46       macOS. It uses Newtonian physics using the Barnes-Hut N-body
47       algorithm. Although the main goal of Gravit is to be as accurate
48       as possible, it also creates beautiful looking gravity patterns.
49       It records the history of each particle so it can animate and
50       display a path of its travels. At any stage you can rotate your
51       view in 3D and zoom in and out.
52     '';
54     inherit (mesa.meta) platforms;
55     hydraPlatforms = lib.platforms.linux; # darwin times out
56   };