2024-03-26 00:40:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2024-06-20 04:39:23 +00:00
|
|
|
, libglut
|
2024-03-26 00:40:15 +00:00
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
}:
|
2015-07-06 09:36:21 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "newtonwars";
|
2024-03-26 00:40:15 +00:00
|
|
|
version = "unstable-2023-04-08";
|
2015-07-06 09:36:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Draradech";
|
|
|
|
repo = "NewtonWars";
|
2024-03-26 00:40:15 +00:00
|
|
|
rev = "a32ea49f8f1d2bdb8983c28d24735696ac987617";
|
|
|
|
hash = "sha256-qkvgQraYR+EXWUQkEvSOcbNFn2oRTjwj5U164tVto8M=";
|
2015-07-06 09:36:21 +00:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2024-06-20 04:39:23 +00:00
|
|
|
buildInputs = [ libglut libGL libGLU ];
|
2015-07-06 09:36:21 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i "s;font24.raw;$out/share/font24.raw;g" display.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = "sh build-linux.sh";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
cp nw $out/bin
|
|
|
|
cp font24.raw $out/share
|
|
|
|
|
|
|
|
wrapProgram $out/bin/nw \
|
2024-06-20 04:39:23 +00:00
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libglut}/lib \
|
2019-11-10 16:44:34 +00:00
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libGLU}/lib \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libGL}/lib
|
2015-07-06 09:36:21 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-07-06 09:36:21 +00:00
|
|
|
description = "Space battle game with gravity as the main theme";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "nw";
|
2015-07-06 09:36:21 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
platforms = platforms.linux;
|
2018-08-09 10:57:42 +00:00
|
|
|
license = licenses.mit;
|
2015-07-06 09:36:21 +00:00
|
|
|
};
|
|
|
|
}
|