blobby: wrap to create the configs in $HOME without user actions

This commit is contained in:
Michael Raskin 2016-10-31 18:36:53 +01:00
parent ea92304a6a
commit f6c61ebe3d
2 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,10 @@
#! @shell@
test -d ~/.blobby || {
mkdir ~/.blobby
cp -r "@out@/share/blobby"/* ~/.blobby
chmod u+w -R ~/.blobby
( cd ~/.blobby; for i in *.zip; do @unzip@/bin/unzip "$i"; done )
}
@out@/bin/blobby.bin

View file

@ -1,5 +1,5 @@
{stdenv, fetchurl, SDL2, SDL2_image, mesa, cmake, physfs, boost, zip, zlib
, pkgconfig}:
, pkgconfig, unzip}:
stdenv.mkDerivation rec {
version = "1.0";
name = "blobby-volley-${version}";
@ -9,12 +9,22 @@ stdenv.mkDerivation rec {
sha256 = "1qpmbdlyhfbrdsq4vkb6cb3b8mh27fpizb71q4a21ala56g08yms";
};
buildInputs = [SDL2 SDL2_image mesa cmake physfs boost zip zlib pkgconfig];
buildInputs = [SDL2 SDL2_image mesa cmake physfs boost zip zlib pkgconfig
unzip];
preConfigure=''
sed -e '1i#include <iostream>' -i src/NetworkMessage.cpp
'';
inherit unzip;
postInstall = ''
cp ../data/Icon.bmp "$out/share/blobby/"
mv "$out/bin"/blobby{,.bin}
substituteAll "${./blobby.sh}" "$out/bin/blobby"
chmod a+x "$out/bin/blobby"
'';
meta = {
description = ''A blobby volleyball game'';
license = stdenv.lib.licenses.bsd3;