mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 10:43:27 +00:00
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.1 KiB
Nix
40 lines
1.1 KiB
Nix
{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, sfml, fribidi, taglib }:
|
|
stdenv.mkDerivation rec {
|
|
pname = "mars";
|
|
version = "0.7.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "thelaui";
|
|
repo = "M.A.R.S.";
|
|
rev = "c855d044094a1d92317e38935d81ba938946132e";
|
|
sha256 = "1r4c5gap1z2zsv4yjd34qriqkxaq4lb4rykapyzkkdf4g36lc3nh";
|
|
};
|
|
nativeBuildInputs = [ cmake ];
|
|
buildInputs = [ libGLU libGL sfml fribidi taglib ];
|
|
patches = [
|
|
./unbind_fix.patch
|
|
./fix-gluortho2d.patch
|
|
];
|
|
installPhase = ''
|
|
cd ..
|
|
find -name '*.svn' -exec rm -rf {} \;
|
|
mkdir -p "$out/share/mars/"
|
|
mkdir -p "$out/bin/"
|
|
cp -rv data resources credits.txt license.txt "$out/share/mars/"
|
|
cp -v mars "$out/bin/mars.bin"
|
|
cat << EOF > "$out/bin/mars"
|
|
#! ${stdenv.shell}
|
|
cd "$out/share/mars/"
|
|
exec "$out/bin/mars.bin" "\$@"
|
|
EOF
|
|
chmod +x "$out/bin/mars"
|
|
'';
|
|
meta = with lib; {
|
|
homepage = "http://mars-game.sourceforge.net/";
|
|
description = "A game about fighting with ships in a 2D space setting";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = [ maintainers.astsmtl ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|