4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.0 KiB
Nix
40 lines
1.0 KiB
Nix
{ lib, stdenv, fetchFromGitHub, makeWrapper, freeglut, libGLU, libGL }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "newtonwars";
|
|
version = "20150609";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Draradech";
|
|
repo = "NewtonWars";
|
|
rev = "98bb99a1797fd0073e0fd25ef9218468d3a9f7cb";
|
|
sha256 = "0g63fwfcdxxlnqlagj1fb8ngm385gmv8f7p8b4r1z5cny2znxdvs";
|
|
};
|
|
|
|
buildInputs = [ makeWrapper freeglut libGL libGLU ];
|
|
|
|
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 \
|
|
--prefix LD_LIBRARY_PATH ":" ${libGLU}/lib \
|
|
--prefix LD_LIBRARY_PATH ":" ${libGL}/lib
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A space battle game with gravity as the main theme";
|
|
maintainers = with maintainers; [ pSub ];
|
|
platforms = platforms.linux;
|
|
license = licenses.mit;
|
|
};
|
|
}
|