2021-01-15 04:31:39 +00:00
|
|
|
{ lib, stdenv, fetchurl, libvorbis, libogg, libtheora, SDL, libXft, SDL_image, zlib, libX11, libpng, openal, runtimeShell, requireFile, commercialVersion ? false }:
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2021-06-22 22:44:58 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "andyetitmoves";
|
2022-01-03 14:07:11 +00:00
|
|
|
version = "1.2.2";
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2022-01-03 14:07:11 +00:00
|
|
|
src =
|
|
|
|
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"
|
2012-02-19 21:36:54 +00:00
|
|
|
then
|
2022-01-03 14:07:11 +00:00
|
|
|
let
|
|
|
|
postfix = if stdenv.hostPlatform.system == "i686-linux" then "i386" else "x86_64";
|
|
|
|
commercialName = "${pname}-${version}_${postfix}.tar.gz";
|
|
|
|
demoUrl = "http://www.andyetitmoves.net/demo/${pname}Demo-${version}_${postfix}.tar.gz";
|
2012-02-19 21:36:54 +00:00
|
|
|
in
|
|
|
|
if commercialVersion
|
2022-01-03 14:07:11 +00:00
|
|
|
then
|
|
|
|
requireFile
|
|
|
|
{
|
|
|
|
message = ''
|
|
|
|
We cannot download the commercial version automatically, as you require a license.
|
|
|
|
Once you bought a license, you need to add your downloaded version to the nix store.
|
|
|
|
You can do this by using "nix-prefetch-url file:///\$PWD/${commercialName}" in the
|
|
|
|
directory where yousaved it.
|
|
|
|
'';
|
|
|
|
name = commercialName;
|
|
|
|
sha256 =
|
|
|
|
if stdenv.hostPlatform.system == "i686-linux"
|
|
|
|
then "15wvzmmidvykwjrbnq70h5jrvnjx1hcrm0357qj85q4aqbzavh01"
|
|
|
|
else "1v8z16qa9ka8sf7qq45knsxj87s6sipvv3a7xq11pb5xk08fb2ql";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
|
|
|
url = demoUrl;
|
|
|
|
sha256 =
|
|
|
|
if stdenv.hostPlatform.system == "i686-linux"
|
|
|
|
then "0f14vrrbq05hsbdajrb5y9za65fpng1lc8f0adb4aaz27x7sh525"
|
|
|
|
else "0mg41ya0b27blq3b5498kwl4rj46dj21rcd7qd0rw1kyvr7sx4v4";
|
|
|
|
}
|
2012-02-19 21:36:54 +00:00
|
|
|
else
|
2012-02-20 17:25:35 +00:00
|
|
|
throw "And Yet It Moves nix package only supports linux and intel cpu's.";
|
2012-02-19 21:36:54 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/{opt/andyetitmoves,bin}
|
2012-02-19 21:36:54 +00:00
|
|
|
cp -r * $out/opt/andyetitmoves/
|
|
|
|
|
2016-04-30 21:56:43 +01:00
|
|
|
fullPath=${stdenv.cc.cc.lib}/lib64
|
2012-12-28 18:20:09 +00:00
|
|
|
for i in $nativeBuildInputs; do
|
2012-02-19 21:36:54 +00:00
|
|
|
fullPath=$fullPath''${fullPath:+:}$i/lib
|
|
|
|
done
|
|
|
|
|
|
|
|
binName=${if commercialVersion then "AndYetItMoves" else "AndYetItMovesDemo"}
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath $fullPath $out/opt/andyetitmoves/lib/$binName
|
2012-02-19 21:36:54 +00:00
|
|
|
cat > $out/bin/$binName << EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2012-02-19 21:36:54 +00:00
|
|
|
cd $out/opt/andyetitmoves
|
|
|
|
exec ./lib/$binName
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/$binName
|
|
|
|
'';
|
|
|
|
|
2022-01-03 14:07:11 +00:00
|
|
|
buildInputs = [ libvorbis libogg libtheora SDL libXft SDL_image zlib libX11 libpng openal ];
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2022-01-03 14:07:11 +00:00
|
|
|
meta = with lib; {
|
2012-02-19 21:36:54 +00:00
|
|
|
description = "Physics/Gravity Platform game";
|
|
|
|
longDescription = ''
|
|
|
|
And Yet It Moves is an award-winning physics-based platform game in which players rotate the game world at will to solve challenging puzzles. Tilting the world turns walls into floors, slides into platforms, and stacks of rocks into dangerous hazards.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.andyetitmoves.net/";
|
2022-01-03 14:07:11 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ bluescreen303 ];
|
2012-02-19 21:36:54 +00:00
|
|
|
};
|
|
|
|
}
|