summary refs log tree commit diff
path: root/pkgs/games/atanks
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2015-12-29 15:39:45 +0100
committerRobert Helgesson <robert@rycee.net>2015-12-29 20:31:01 +0100
commitb9f1140e4d14ef91a05e0e1eeda57b84fff5f627 (patch)
treecb41002d42e41604ea5145c2695107081420b524 /pkgs/games/atanks
parent73184f5f59db0ecb46d09cf6a26111493496c1ea (diff)
downloadnixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar.gz
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar.bz2
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar.lz
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar.xz
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.tar.zst
nixpkgs-b9f1140e4d14ef91a05e0e1eeda57b84fff5f627.zip
atanks: use stdenv
This replaces use of builderDefsPackage (#4210).
Diffstat (limited to 'pkgs/games/atanks')
-rw-r--r--pkgs/games/atanks/default.nix65
-rw-r--r--pkgs/games/atanks/default.upstream5
2 files changed, 19 insertions, 51 deletions
diff --git a/pkgs/games/atanks/default.nix b/pkgs/games/atanks/default.nix
index 9ebfb724779..4b9b097bbb7 100644
--- a/pkgs/games/atanks/default.nix
+++ b/pkgs/games/atanks/default.nix
@@ -1,53 +1,26 @@
-x@{builderDefsPackage
-  , allegro
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
+{ stdenv, fetchurl, allegro }:
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="atanks";
-    version = "6.2";
-    name="${baseName}-${version}";
-    project="${baseName}";
-    url="mirror://sourceforge/project/${project}/${baseName}/${name}/${name}.tar.gz";
+stdenv.mkDerivation rec {
+  name = "atanks-${version}";
+  version = "6.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/atanks/atanks/${name}/${name}.tar.gz";
     sha256 = "1s1lb87ind0y9d6hmfaf1b9wks8q3hd6w5n9dibq75rxqmcfvlpy";
   };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.sha256;
-  };
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  buildInputs = [ allegro ];
+
+  patchPhase = ''
+    substituteInPlace Makefile --replace /usr $out
+  '';
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["fixInstall" "doMakeInstall"];
-  makeFlags=[
-    "PREFIX=$out/"
-  ];
-  fixInstall = a.fullDepEntry (''
-    sed -e "s@INSTALL=.*bin/install @INSTALL=install @" -i Makefile
-    sed -e "s@-g 0 -m ... -o 0@@" -i Makefile
-    sed -e 's@/usr/@'"$out"'@g' -i Makefile
-  '') ["doUnpack" "minInit"];
-      
-  meta = {
+  makeFlags = [ "PREFIX=$(out)/" "INSTALL=install" ];
+
+  meta = with stdenv.lib; {
     description = "Atomic Tanks ballistics game";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    downloadPage = "http://sourceforge.net/projects/atanks/files/atanks/";
-    inherit version;
+    homepage = http://atanks.sourceforge.net/;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
   };
-}) x
-
+}
diff --git a/pkgs/games/atanks/default.upstream b/pkgs/games/atanks/default.upstream
deleted file mode 100644
index f52364b3427..00000000000
--- a/pkgs/games/atanks/default.upstream
+++ /dev/null
@@ -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; }