3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/games/terraria-server/default.nix

37 lines
1.2 KiB
Nix
Raw Normal View History

2016-06-03 21:40:25 +01:00
{ stdenv, lib, file, fetchurl, unzip }:
stdenv.mkDerivation rec {
name = "terraria-server-${version}";
2018-04-06 08:39:51 +01:00
version = "1.3.5.3";
2016-06-03 21:40:25 +01:00
urlVersion = lib.replaceChars ["."] [""] version;
src = fetchurl {
2016-06-03 21:40:25 +01:00
url = "http://terraria.org/server/terraria-server-${urlVersion}.zip";
2018-04-06 08:39:51 +01:00
sha256 = "0l7j2n6ip4hxph7dfal7kzdm3dqnm1wba6zc94gafkh97wr35ck3";
};
2016-06-03 21:40:25 +01:00
buildInputs = [ file unzip ];
installPhase = ''
mkdir -p $out/bin
2016-06-03 21:40:25 +01:00
cp -r Linux $out/
2016-08-07 02:58:38 +01:00
chmod +x "$out/Linux/TerrariaServer.bin.x86_64"
2016-06-03 21:40:25 +01:00
ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer
# Fix "/lib64/ld-linux-x86-64.so.2" like references in ELF executables.
find "$out" | while read filepath; do
if file "$filepath" | grep -q "ELF.*executable"; then
echo "setting interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) in $filepath"
patchelf --set-interpreter "$(cat "$NIX_CC"/nix-support/dynamic-linker)" "$filepath"
test $? -eq 0 || { echo "patchelf failed to process $filepath"; exit 1; }
fi
done
'';
meta = with lib; {
homepage = http://terraria.org;
2016-06-03 21:40:25 +01:00
description = "Dedicated server for Terraria, a 2D action-adventure sandbox";
platforms = ["x86_64-linux"];
license = licenses.unfree;
};
}