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 21:44:58 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "andyetitmoves";
|
|
|
|
version = "1.2.2";
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2018-08-20 19:11:29 +00:00
|
|
|
src = if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux"
|
2012-02-19 21:36:54 +00:00
|
|
|
then
|
2018-08-20 19:11:29 +00:00
|
|
|
let postfix = if stdenv.hostPlatform.system == "i686-linux" then "i386" else "x86_64";
|
2021-06-22 21:44:58 +00:00
|
|
|
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
|
|
|
|
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;
|
2018-08-20 19:11:29 +00:00
|
|
|
sha256 = if stdenv.hostPlatform.system == "i686-linux"
|
2012-02-19 21:36:54 +00:00
|
|
|
then "15wvzmmidvykwjrbnq70h5jrvnjx1hcrm0357qj85q4aqbzavh01"
|
|
|
|
else "1v8z16qa9ka8sf7qq45knsxj87s6sipvv3a7xq11pb5xk08fb2ql";
|
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = demoUrl;
|
2018-08-20 19:11:29 +00:00
|
|
|
sha256 = if stdenv.hostPlatform.system == "i686-linux"
|
2012-02-19 21:36:54 +00:00
|
|
|
then "0f14vrrbq05hsbdajrb5y9za65fpng1lc8f0adb4aaz27x7sh525"
|
|
|
|
else "0mg41ya0b27blq3b5498kwl4rj46dj21rcd7qd0rw1kyvr7sx4v4";
|
|
|
|
}
|
|
|
|
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
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 12:56:10 +00:00
|
|
|
mkdir -p $out/{opt/andyetitmoves,bin}
|
2012-02-19 21:36:54 +00:00
|
|
|
cp -r * $out/opt/andyetitmoves/
|
|
|
|
|
2016-04-30 20:56:43 +00: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
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [libvorbis libogg libtheora SDL libXft SDL_image zlib libX11 libpng openal];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
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 01:11:51 +00:00
|
|
|
homepage = "http://www.andyetitmoves.net/";
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.unfree;
|
2012-02-19 21:36:54 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
maintainers = with lib.maintainers; [bluescreen303];
|
2012-02-19 21:36:54 +00:00
|
|
|
};
|
|
|
|
}
|