2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, freeglut, libGLU, libGL }:
|
2015-07-06 10:36:21 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "newtonwars";
|
2015-07-06 10:36:21 +01:00
|
|
|
version = "20150609";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Draradech";
|
|
|
|
repo = "NewtonWars";
|
|
|
|
rev = "98bb99a1797fd0073e0fd25ef9218468d3a9f7cb";
|
|
|
|
sha256 = "0g63fwfcdxxlnqlagj1fb8ngm385gmv8f7p8b4r1z5cny2znxdvs";
|
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ freeglut libGL libGLU ];
|
2015-07-06 10:36:21 +01: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 \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" ${freeglut}/lib \
|
2019-11-10 16:44:34 +00:00
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libGLU}/lib \
|
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libGL}/lib
|
2015-07-06 10:36:21 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-07-06 10:36:21 +01:00
|
|
|
description = "A space battle game with gravity as the main theme";
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
platforms = platforms.linux;
|
2018-08-09 11:57:42 +01:00
|
|
|
license = licenses.mit;
|
2015-07-06 10:36:21 +01:00
|
|
|
};
|
|
|
|
}
|