2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "gravit";
|
|
|
|
version = "0.5.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gak";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-JuqnLLD5+Ec8kQI0SK98V1O6TTbGM6+yKn5KCHe85eM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull fix pending upstream inclusion for -fno-common toolchains:
|
|
|
|
# https://github.com/gak/gravit/pull/100
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/gak/gravit/commit/0f848834889212f16201fd404d2d5b9bb5b47d23.patch";
|
|
|
|
hash = "sha256-k1aMIg7idMt53o6dFgIKJflOMp0Jp5NwgWEijcIwXrQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libGLU libGL 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 = {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://github.com/gak/gravit";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Beautiful OpenGL-based gravity simulator";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "gravit";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
platforms = lib.platforms.mesaPlatforms;
|
|
|
|
hydraPlatforms = lib.platforms.linux; # darwin times out
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|