mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 05:00:16 +00:00
space-orbit: port to mkDerivation
Also - rename to space-orbit - use mirror://debian - add some meta information See also #4210
This commit is contained in:
parent
0bd54a6d5d
commit
69b0ba2634
|
@ -1,44 +0,0 @@
|
|||
{ stdenv, fetchurl, builderDefs, mesa, libXi, libXt, libXext, libX11
|
||||
, libXmu, freeglut }:
|
||||
|
||||
with builderDefs;
|
||||
let localDefs = builderDefs.passthru.function (rec {
|
||||
src = /* put a fetchurl here */
|
||||
fetchurl {
|
||||
sha256 = "1kx69f9jqnfzwjh47cl1df8p8hn3bnp6bznxnb6c4wx32ijn5gri";
|
||||
url = http://ftp.de.debian.org/debian/pool/main/s/space-orbit/space-orbit_1.01.orig.tar.gz;
|
||||
};
|
||||
|
||||
buildInputs = [mesa libXi libXt libXext libX11 libXmu freeglut];
|
||||
configureFlags = [];
|
||||
debianPatch =
|
||||
fetchurl {
|
||||
url = http://ftp.de.debian.org/debian/pool/main/s/space-orbit/space-orbit_1.01-9.diff.gz;
|
||||
sha256 = "1v3s97day6fhv08l2rn81waiprhi1lfyjjsj55axfh6n6zqfn1w2";
|
||||
};
|
||||
customBuild = fullDepEntry (''
|
||||
gunzip < ${debianPatch} | patch -Np1
|
||||
cd src
|
||||
sed -e 's@/usr/share/games/orbit/@'$out'/dump/@g' -i *.c
|
||||
sed -e '/DIR=/d; s/-lesd//; s/-DESD//;' -i Makefile
|
||||
make
|
||||
mkdir -p $out/bin
|
||||
cp -r .. $out/dump
|
||||
cat >$out/bin/space-orbit <<EOF
|
||||
#! /bin/sh
|
||||
$out/dump/orbit "\$@"
|
||||
EOF
|
||||
chmod a+x $out/bin/space-orbit
|
||||
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
|
||||
});
|
||||
in with localDefs;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "space-orbit-1.01";
|
||||
builder = writeScript (name + "-builder")
|
||||
(textClosure localDefs
|
||||
[ customBuild doForceShare doPropagate]);
|
||||
meta = {
|
||||
description = "Orbit space flight simulator";
|
||||
};
|
||||
}
|
||||
|
45
pkgs/games/space-orbit/default.nix
Normal file
45
pkgs/games/space-orbit/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ stdenv, fetchurl
|
||||
, mesa, libXi, libXt, libXext, libX11, libXmu, freeglut
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "space-orbit-${version}";
|
||||
version = "1.01";
|
||||
patchversion = "9";
|
||||
|
||||
buildInputs = [ mesa 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 stdenv.lib; {
|
||||
description = "A space combat simulator";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
|
@ -95,6 +95,7 @@ doNotDisplayTwice rec {
|
|||
saneBackendsGit = sane-backends-git; # added 2016-01-02
|
||||
saneFrontends = sane-frontends; # added 2016-01-02
|
||||
scim = sc-im; # added 2016-01-22
|
||||
spaceOrbit = space-orbit; # addewd 2016-05-23
|
||||
speedtest_cli = speedtest-cli; # added 2015-02-17
|
||||
sqliteInteractive = sqlite-interactive; # added 2014-12-06
|
||||
system_config_printer = system-config-printer; # added 2016-01-03
|
||||
|
|
|
@ -15281,7 +15281,7 @@ in
|
|||
};
|
||||
|
||||
# You still can override by passing more arguments.
|
||||
spaceOrbit = callPackage ../games/orbit { };
|
||||
space-orbit = callPackage ../games/space-orbit { };
|
||||
|
||||
spring = callPackage ../games/spring {
|
||||
boost = boost155;
|
||||
|
|
Loading…
Reference in a new issue