mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 19:02:57 +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
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ lib, stdenv, fetchurl
|
|
, libGLU, libGL, libXi, libXt, libXext, libX11, libXmu, freeglut
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "space-orbit";
|
|
version = "1.01";
|
|
patchversion = "9";
|
|
|
|
buildInputs = [ libGLU libGL libXi libXt libXext libX11 libXmu freeglut ];
|
|
|
|
src = fetchurl {
|
|
url = "mirror://debian/pool/main/s/space-orbit/space-orbit_${version}.orig.tar.gz";
|
|
sha256 = "1kx69f9jqnfzwjh47cl1df8p8hn3bnp6bznxnb6c4wx32ijn5gri";
|
|
};
|
|
|
|
patches = [
|
|
(fetchurl {
|
|
url = "mirror://debian/pool/main/s/space-orbit/space-orbit_${version}-${patchversion}.diff.gz";
|
|
sha256 = "1v3s97day6fhv08l2rn81waiprhi1lfyjjsj55axfh6n6zqfn1w2";
|
|
})
|
|
];
|
|
|
|
preBuild = ''
|
|
cd src
|
|
sed -e 's@/usr/share/games/orbit/@'$out'/dump/@g' -i *.c
|
|
sed -e '/DIR=/d; s/-lesd//; s/-DESD//;' -i Makefile
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp -r .. $out/dump
|
|
cat >$out/bin/space-orbit <<EOF
|
|
#! ${stdenv.shell}
|
|
exec $out/dump/orbit "\$@"
|
|
EOF
|
|
chmod a+x $out/bin/space-orbit
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A space combat simulator";
|
|
license = licenses.gpl2;
|
|
platforms = platforms.all;
|
|
};
|
|
}
|