12 stdenv.mkDerivation rec {
17 url = "http://static.tibia.com/download/tibia${lib.replaceStrings [ "." ] [ "" ] version}.tgz";
18 sha256 = "11mkh2dynmbpay51yfaxm5dmcys3rnpk579s9ypfkhblsrchbkhx";
23 # These binaries come stripped already and trying to strip after the
24 # files are in $out/res and after patchelf just breaks them.
25 # Strangely it works if the files are in $out but then nix doesn't
26 # put them in our PATH. We set all the files to $out/res because
27 # we'll be using a wrapper to start the program which will go into
35 patchelf --set-interpreter ${glibc.out}/lib/ld-linux.so.2 \
46 # We've patchelf'd the files. The main ‘Tibia’ binary is a bit
47 # dumb so it looks for ‘./Tibia.dat’. This requires us to be in
48 # the same directory as the file itself but that's very tedious,
49 # especially with nix which changes store hashes. Here we generate
50 # a simple wrapper that we put in $out/bin which will do the
51 # directory changing for us.
55 # The wrapper script itself. We use $LD_LIBRARY_PATH for libGL.
56 cat << EOF > "$out/bin/Tibia"
59 ${glibc.out}/lib/ld-linux.so.2 --library-path \$LD_LIBRARY_PATH ./Tibia "\$@"
62 chmod +x $out/bin/Tibia
67 description = "Top-down MMORPG set in a fantasy world";
68 homepage = "http://tibia.com";
69 license = lib.licenses.unfree;
70 platforms = [ "i686-linux" ];