diff options
author | Robert Helgesson <robert@rycee.net> | 2015-12-29 17:02:16 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2015-12-29 20:31:01 +0100 |
commit | a04916cdc48f5e1a993eb7c48d65a6c816569d94 (patch) | |
tree | 3806efb3f73fc4e8d37930427b72fb7f382948e4 /pkgs/games/sauerbraten | |
parent | aca3851b88c995e0cbb42bcf3822f5202fec7648 (diff) |
sauerbraten: use stdenv
This replaces use of builderDefsPackage (#4210).
Diffstat (limited to 'pkgs/games/sauerbraten')
-rw-r--r-- | pkgs/games/sauerbraten/default.nix | 103 |
1 files changed, 41 insertions, 62 deletions
diff --git a/pkgs/games/sauerbraten/default.nix b/pkgs/games/sauerbraten/default.nix index 8f3fb53f7e318..61a9310ae212c 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"]; - - 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, fetchsvn, mesa, SDL, SDL_image, SDL_mixer +, libpng, zlib, libjpeg, imagemagick, libX11 +}: + +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 + "/"; - - inherit (sourceInfo) name version; - inherit buildInputs; - - phaseNames = ["setVars" "doMakeInstall" "doCreateScripts"]; + buildInputs = [ + mesa SDL SDL_image SDL_mixer libpng zlib libjpeg imagemagick + libX11 + ]; - 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 <<EOF + #!${stdenv.shell} + cd $out/share/sauerbraten + ./sauer_server "\$@" + EOF + cat > $out/bin/sauerbraten_client <<EOF + #!${stdenv.shell} + cd $out/share/sauerbraten + ./sauer_client "\$@" + EOF chmod a+x $out/bin/sauerbraten_* - '' ["minInit" "defEnsureDir"]; - - meta = { + ''; + + meta = with stdenv.lib; { description = ""; - maintainers = with a.lib.maintainers; - [ - raskin - ]; + maintainers = [ maintainers.raskin ]; hydraPlatforms = # raskin: tested amd64-linux; # not setting platforms because it is 0.5+ GiB of game data []; license = "freeware"; # as an aggregate - data files have different licenses # code is under zlib license + platforms = platforms.linux; }; -}) x - +} |