Merge pull request #12026 from rycee/migrate/stdenv

Migrate packages in games to stdenv from builderDefsPackage
This commit is contained in:
Domen Kožar 2015-12-29 21:00:22 +01:00
commit bea60e1409
7 changed files with 124 additions and 254 deletions

View file

@ -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
}

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; }

View file

@ -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;
};
}

View file

@ -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 <<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
}

View file

@ -1,62 +1,31 @@
x@{builderDefsPackage
, zlib, libtiff, libxml2, SDL, xproto, libX11, libXi, inputproto, libXmu
, libXext, xextproto, mesa
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
[];
{ stdenv, fetchurl, zlib, libtiff, libxml2, SDL, xproto, libX11
, libXi, inputproto, libXmu, libXext, xextproto, mesa }:
buildInputs = map (n: builtins.getAttr n x)
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
sourceInfo = rec {
baseName="stardust";
version="0.1.13";
name="${baseName}-${version}";
url="http://iwar.free.fr/IMG/gz/${name}.tar.gz";
hash="19rs9lz5y5g2yiq1cw0j05b11digw40gar6rw8iqc7bk3s8355xp";
};
in
rec {
src = a.fetchurl {
url = sourceInfo.url;
sha256 = sourceInfo.hash;
stdenv.mkDerivation rec {
name = "stardust-${version}";
version = "0.1.13";
src = fetchurl {
url = "http://iwar.free.fr/IMG/gz/${name}.tar.gz";
sha256 = "19rs9lz5y5g2yiq1cw0j05b11digw40gar6rw8iqc7bk3s8355xp";
};
inherit (sourceInfo) name version;
inherit buildInputs;
/* doConfigure should be removed if not needed */
phaseNames = ["doConfigure" "fixPaths" "doMakeInstall"];
configureFlags = [
"--bindir=$out/bin"
"--datadir=$out/share"
];
makeFlags = [
"bindir=$out/bin"
"datadir=$out/share"
buildInputs = [
zlib libtiff libxml2 SDL xproto libX11 libXi inputproto
libXmu libXext xextproto mesa
];
fixPaths = a.fullDepEntry (''
sed -e "s@#define PACKAGE .*@#define PACKAGE \"stardust\"@" -i config.h
'') ["minInit"];
installFlags = [ "bindir=\${out}/bin" ];
meta = {
postConfigure = ''
substituteInPlace config.h \
--replace '#define PACKAGE ""' '#define PACKAGE "stardust"'
'';
meta = with stdenv.lib; {
description = "Space flight simulator";
maintainers = with a.lib.maintainers;
[
raskin
];
platforms = with a.lib.platforms;
linux;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
license = licenses.gpl2Plus;
};
passthru = {
updateInfo = {
downloadPage = "http://iwar.free.fr/article.php3?id_article=6";
};
};
}) x
}

View file

@ -1,64 +1,28 @@
x@{builderDefsPackage
, qt4, box2d, which
,fetchsvn, cmake
, ...}:
builderDefsPackage
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
["fetchsvn"];
{ stdenv, fetchurl, qt4, box2d, which, cmake }:
buildInputs = map (n: builtins.getAttr n x)
(builtins.attrNames (builtins.removeAttrs x helperArgNames));
sourceInfo = rec {
baseName="tbe";
revision="2048";
version="r${revision}";
name="${baseName}-${version}";
url="https://tbe.svn.sourceforge.net/svnroot/tbe/trunk";
hash="19pqpkil4r5y9j4nszkbs70lq720nvqw8g8magd8nf2n3l9nqm51";
stdenv.mkDerivation rec {
name = "tbe-${version}";
version = "0.9.2.1";
src = fetchurl {
url = "https://github.com/kaa-ching/tbe/archive/v${version}.tar.gz";
sha256 = "1cs4q9qiakfd2m1lvfsvfgf8yvhxzmc06glng5d80piwyn6ymzxg";
};
in
rec {
srcDrv = a.fetchsvn {
url = sourceInfo.url;
sha256 = sourceInfo.hash;
rev = sourceInfo.revision;
};
src = srcDrv + "/";
inherit (sourceInfo) name version;
inherit buildInputs;
buildInputs = [ qt4 box2d which cmake ];
phaseNames = ["setVars" "doCmake" "doMakeInstall" "doDeploy"];
setVars = a.noDepEntry ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.box2d}/include/Box2D"
installPhase = ''
make DESTDIR=.. install
mkdir -p $out/bin
cp ../usr/games/tbe $out/bin
cp -r ../usr/share $out/
'';
doDeploy = a.fullDepEntry ''
mkdir -p "$out/share/tbe"
cp -r . "$out/share/tbe/build-dir"
mkdir -p "$out/bin"
echo '#!${a.stdenv.shell}' >> "$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
}

View file

@ -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;
};