atanks: use stdenv

This replaces use of builderDefsPackage (#4210).
This commit is contained in:
Robert Helgesson 2015-12-29 15:39:45 +01:00
parent 73184f5f59
commit b9f1140e4d
2 changed files with 19 additions and 51 deletions

View File

@ -1,53 +1,26 @@
x@{builderDefsPackage { stdenv, fetchurl, allegro }:
, allegro
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)); name = "atanks-${version}";
sourceInfo = rec { version = "6.2";
baseName="atanks";
version = "6.2"; src = fetchurl {
name="${baseName}-${version}"; url = "mirror://sourceforge/project/atanks/atanks/${name}/${name}.tar.gz";
project="${baseName}";
url="mirror://sourceforge/project/${project}/${baseName}/${name}/${name}.tar.gz";
sha256 = "1s1lb87ind0y9d6hmfaf1b9wks8q3hd6w5n9dibq75rxqmcfvlpy"; sha256 = "1s1lb87ind0y9d6hmfaf1b9wks8q3hd6w5n9dibq75rxqmcfvlpy";
}; };
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
sha256 = sourceInfo.sha256;
};
inherit (sourceInfo) name version; buildInputs = [ allegro ];
inherit buildInputs;
/* doConfigure should be removed if not needed */ patchPhase = ''
phaseNames = ["fixInstall" "doMakeInstall"]; substituteInPlace Makefile --replace /usr $out
makeFlags=[ '';
"PREFIX=$out/"
]; makeFlags = [ "PREFIX=$(out)/" "INSTALL=install" ];
fixInstall = a.fullDepEntry (''
sed -e "s@INSTALL=.*bin/install @INSTALL=install @" -i Makefile meta = with stdenv.lib; {
sed -e "s@-g 0 -m ... -o 0@@" -i Makefile
sed -e 's@/usr/@'"$out"'@g' -i Makefile
'') ["doUnpack" "minInit"];
meta = {
description = "Atomic Tanks ballistics game"; description = "Atomic Tanks ballistics game";
maintainers = with a.lib.maintainers; homepage = http://atanks.sourceforge.net/;
[ maintainers = [ maintainers.raskin ];
raskin platforms = platforms.linux;
];
platforms = with a.lib.platforms;
linux;
downloadPage = "http://sourceforge.net/projects/atanks/files/atanks/";
inherit version;
}; };
}) x }

View File

@ -1,5 +0,0 @@
url http://sourceforge.net/projects/atanks/files/atanks/
version_link 'atanks[-][0-9.]+/$'
version_link '[.]tar[.][a-z0-9]+/download'
SF_redirect
do_overwrite () { do_overwrite_just_version; }