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 ]; - /* 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 = { + patchPhase = '' + substituteInPlace Makefile --replace /usr $out + ''; + + 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; } diff --git a/pkgs/games/liquidwar/default.nix b/pkgs/games/liquidwar/default.nix index 602daa1ee86..ce346459201 100644 --- a/pkgs/games/liquidwar/default.nix +++ b/pkgs/games/liquidwar/default.nix @@ -1,11 +1,20 @@ -a @ { xproto, libX11, libXrender +{ stdenv, fetchurl, xproto, libX11, libXrender , gmp, mesa, libjpeg, libpng -, expat, gettext, perl +, expat, gettext, perl, guile , SDL, SDL_image, SDL_mixer, SDL_ttf , curl, sqlite -, libogg, libvorbis, libcaca, csound, cunit, ... } : -let - buildInputs = with a; [ +, libogg, libvorbis, libcaca, csound, cunit } : + +stdenv.mkDerivation rec { + name = "liquidwar6-${version}"; + version = "0.6.3902"; + + src = fetchurl { + url = "mirror://gnu/liquidwar6/${name}.tar.gz"; + sha256 = "1976nnl83d8wspjhb5d5ivdvdxgb8lp34wp54jal60z4zad581fn"; + }; + + buildInputs = [ xproto libX11 gmp guile mesa libjpeg libpng expat gettext perl @@ -14,34 +23,15 @@ let libogg libvorbis csound libXrender libcaca cunit ]; -in -rec { - name = "liquidwar6-${meta.version}"; - src = a.fetchurl { - url = "mirror://gnu/liquidwar6/${name}.tar.gz"; - sha256 = "1976nnl83d8wspjhb5d5ivdvdxgb8lp34wp54jal60z4zad581fn"; - }; + # To avoid problems finding SDL_types.h. + configureFlags = [ "CFLAGS=-I${SDL}/include/SDL" ]; - inherit buildInputs; - configureFlags = []; - - /* doConfigure should be removed if not needed */ - phaseNames = ["setVars" "doConfigure" "doMakeInstall"]; - - setVars = a.noDepEntry ('' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.SDL}/include/SDL" - ''); - - meta = { + meta = with stdenv.lib; { description = "Quick tactics game"; - maintainers = [ - a.lib.maintainers.raskin - ]; - platforms = with a.lib.platforms; - linux; - homepage = "http://www.gnu.org/software/liquidwar6/"; - version = "0.6.3902"; - updateWalker=true; + homepage = "http://www.gnu.org/software/liquidwar6/"; + maintainers = [ maintainers.raskin ]; + license = licenses.gpl3Plus; + platforms = platforms.linux; }; } diff --git a/pkgs/games/sauerbraten/default.nix b/pkgs/games/sauerbraten/default.nix index 8f3fb53f7e3..61a9310ae21 100644 --- a/pkgs/games/sauerbraten/default.nix +++ b/pkgs/games/sauerbraten/default.nix @@ -1,77 +1,56 @@ -x@{builderDefsPackage - , fetchsvn, mesa, SDL, SDL_image, SDL_mixer - , libpng, zlib, libjpeg, imagemagick, libX11 - , ...}: -builderDefsPackage -(a : -let - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ - ["fetchsvn"]; +{ stdenv, fetchsvn, mesa, SDL, SDL_image, SDL_mixer +, libpng, zlib, libjpeg, imagemagick, libX11 +}: - buildInputs = map (n: builtins.getAttr n x) - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); - sourceInfo = rec { - baseName="sauerbraten"; - version="5000"; - name="${baseName}-r${version}"; - url="https://svn.code.sf.net/p/sauerbraten/code"; - hash="17libj7dslprlwppdk3vyxdcigbsa4czln8gdyz9j264m11z1cbh"; - }; -in -rec { - srcDrv = a.fetchsvn { - url = sourceInfo.url; - sha256 = sourceInfo.hash; - rev = sourceInfo.version; +stdenv.mkDerivation rec { + name = "sauerbraten-r${version}"; + version = "5000"; + + src = fetchsvn { + url = "https://svn.code.sf.net/p/sauerbraten/code"; + sha256 = "17libj7dslprlwppdk3vyxdcigbsa4czln8gdyz9j264m11z1cbh"; + rev = version; }; - src = srcDrv + "/"; + buildInputs = [ + mesa SDL SDL_image SDL_mixer libpng zlib libjpeg imagemagick + libX11 + ]; - inherit (sourceInfo) name version; - inherit buildInputs; - - phaseNames = ["setVars" "doMakeInstall" "doCreateScripts"]; - - setVars = a.noDepEntry '' + preBuild = '' export NIX_LDFLAGS="$NIX_LDFLAGS -lX11" + pushd src ''; - doUnpack = a.fullDepEntry '' - mkdir -p $out/share/sauerbraten/build-dir - ln -s $out/share/sauerbraten/build-dir - cd $out/share/sauerbraten/build-dir - (cd ${src}; find . -type d) | tail -n +2 | xargs -L 1 mkdir - (cd ${src}; find . -type f) | while read; do ln -s ${src}/"$REPLY" "$(dirname "$REPLY")"; done - cd src - ls - make clean - sed -e '/[.]h[.]gch/,/-o/s@-o@-x c++-header -o@' -i Makefile - '' ["minInit" "addInputs" "defEnsureDir"]; - - doCreateScripts = a.fullDepEntry '' - cd .. - mkdir -p $out/bin - echo '#! /bin/sh' >> $out/bin/sauerbraten_server - echo 'cd "'"$out"'/share/sauerbraten/build-dir"' >> $out/bin/sauerbraten_server - echo './bin_unix/native_server "$@"' >> $out/bin/sauerbraten_server - echo '#! /bin/sh' >> $out/bin/sauerbraten_client - echo 'cd "'"$out"'/share/sauerbraten/build-dir"' >> $out/bin/sauerbraten_client - echo './bin_unix/native_client "$@"' >> $out/bin/sauerbraten_client + installPhase = '' + popd + mkdir -p $out/bin $out/share/sauerbraten $out/share/doc/sauerbraten + cp -rv "docs/"* $out/share/doc/sauerbraten/ + cp -v src/sauer_client src/sauer_server $out/share/sauerbraten/ + cp -rv packages $out/share/sauerbraten/ + cp -rv data $out/share/sauerbraten/ + cat > $out/bin/sauerbraten_server < $out/bin/sauerbraten_client <> "$out/bin/tbe" - echo "$out/share/tbe/build-dir/tbe \"\$@\"" >> "$out/bin/tbe" - chmod a+x "$out/bin/tbe" - '' ["minInit" "doMake" "defEnsureDir"]; - - meta = { + meta = with stdenv.lib; { description = "A physics-based game vaguely similar to Incredible Machine"; - maintainers = with a.lib.maintainers; - [ - raskin - ]; - platforms = with a.lib.platforms; - linux; - license = a.stdenv.lib.licenses.gpl2; + homepage = http://the-butterfly-effect.org/; + maintainers = [ maintainers.raskin ]; + platforms = platforms.linux; + license = licenses.gpl2; }; - passthru = { - inherit srcDrv; - updateInfo = { - downloadPage = "http://sourceforge.net/projects/tbe/files/"; - }; - }; -}) x +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 510b65d73fa..50b2669e96d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14138,7 +14138,7 @@ let lincity_ng = callPackage ../games/lincity/ng.nix {}; - liquidwar = builderDefsPackage (callPackage ../games/liquidwar) { + liquidwar = callPackage ../games/liquidwar { guile = guile_1_8; };