stardust: use stdenv

This replaces use of builderDefsPackage (#4210).

+23 -54
+23 -54
pkgs/games/stardust/default.nix
··· 1 - x@{builderDefsPackage 2 - , zlib, libtiff, libxml2, SDL, xproto, libX11, libXi, inputproto, libXmu 3 - , libXext, xextproto, mesa 4 - , ...}: 5 - builderDefsPackage 6 - (a : 7 - let 8 - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 9 - []; 1 + { stdenv, fetchurl, zlib, libtiff, libxml2, SDL, xproto, libX11 2 + , libXi, inputproto, libXmu, libXext, xextproto, mesa }: 10 3 11 - buildInputs = map (n: builtins.getAttr n x) 12 - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); 13 - sourceInfo = rec { 14 - baseName="stardust"; 15 - version="0.1.13"; 16 - name="${baseName}-${version}"; 17 - url="http://iwar.free.fr/IMG/gz/${name}.tar.gz"; 18 - hash="19rs9lz5y5g2yiq1cw0j05b11digw40gar6rw8iqc7bk3s8355xp"; 19 - }; 20 - in 21 - rec { 22 - src = a.fetchurl { 23 - url = sourceInfo.url; 24 - sha256 = sourceInfo.hash; 4 + stdenv.mkDerivation rec { 5 + name = "stardust-${version}"; 6 + version = "0.1.13"; 7 + 8 + src = fetchurl { 9 + url = "http://iwar.free.fr/IMG/gz/${name}.tar.gz"; 10 + sha256 = "19rs9lz5y5g2yiq1cw0j05b11digw40gar6rw8iqc7bk3s8355xp"; 25 11 }; 26 12 27 - inherit (sourceInfo) name version; 28 - inherit buildInputs; 13 + buildInputs = [ 14 + zlib libtiff libxml2 SDL xproto libX11 libXi inputproto 15 + libXmu libXext xextproto mesa 16 + ]; 29 17 30 - /* doConfigure should be removed if not needed */ 31 - phaseNames = ["doConfigure" "fixPaths" "doMakeInstall"]; 18 + installFlags = [ "bindir=\${out}/bin" ]; 32 19 33 - configureFlags = [ 34 - "--bindir=$out/bin" 35 - "--datadir=$out/share" 36 - ]; 37 - 38 - makeFlags = [ 39 - "bindir=$out/bin" 40 - "datadir=$out/share" 41 - ]; 42 - 43 - fixPaths = a.fullDepEntry ('' 44 - sed -e "s@#define PACKAGE .*@#define PACKAGE \"stardust\"@" -i config.h 45 - '') ["minInit"]; 20 + postConfigure = '' 21 + substituteInPlace config.h \ 22 + --replace '#define PACKAGE ""' '#define PACKAGE "stardust"' 23 + ''; 46 24 47 - meta = { 25 + meta = with stdenv.lib; { 48 26 description = "Space flight simulator"; 49 - maintainers = with a.lib.maintainers; 50 - [ 51 - raskin 52 - ]; 53 - platforms = with a.lib.platforms; 54 - linux; 27 + maintainers = [ maintainers.raskin ]; 28 + platforms = platforms.linux; 29 + license = licenses.gpl2Plus; 55 30 }; 56 - passthru = { 57 - updateInfo = { 58 - downloadPage = "http://iwar.free.fr/article.php3?id_article=6"; 59 - }; 60 - }; 61 - }) x 62 - 31 + }