1 { lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake, mesa }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-JuqnLLD5+Ec8kQI0SK98V1O6TTbGM6+yKn5KCHe85eM=";
15 # Pull fix pending upstream inclusion for -fno-common toolchains:
16 # https://github.com/gak/gravit/pull/100
18 name = "fno-common.patch";
19 url = "https://github.com/gak/gravit/commit/0f848834889212f16201fd404d2d5b9bb5b47d23.patch";
20 hash = "sha256-k1aMIg7idMt53o6dFgIKJflOMp0Jp5NwgWEijcIwXrQ=";
24 buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image lua5 libpng libSM libICE ];
26 nativeBuildInputs = [ autoconf automake ];
31 # Build fails on Linux with windres.
32 export ac_cv_prog_WINDRES=
35 enableParallelBuilding = true;
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;
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.
54 inherit (mesa.meta) platforms;
55 hydraPlatforms = lib.platforms.linux; # darwin times out