@@ -1,26 +1,23 @@
1−{ stdenv, lib, file, fetchurl }:
1+{ stdenv, lib, file, fetchurl, unzip }:
22assert stdenv.system == "x86_64-linux";
33
44stdenv.mkDerivation rec {
55 name = "terraria-server-${version}";
6− version = "1308";
6+ version = "1.3.1.1";
7+ urlVersion = lib.replaceChars ["."] [""] version;
78
89 src = fetchurl {
9− url = http://terraria.org/server/terraria-server-linux-1308.tar.gz;
10− sha256 = "0cx3nx7wmzcw9l0nz9zm4amccl8nrd09hlb3jc1yrqcaswbyxc8a";
10+ url = "http://terraria.org/server/terraria-server-${urlVersion}.zip";
11+ sha256 = "0bwh0na0dy6cjc1xchd5sp3c7av50q38hk03219dmqd72n9p44rq";
1112 };
1213
13− buildInputs = [ file ];
14−
15− sourceRoot = ".";
14+ buildInputs = [ file unzip ];
1615
1716 installPhase = ''
1817 mkdir -p $out/bin
19− cp -r * $out/
20− ln -s $out/terraria-server-linux-${version}/TerrariaServer.bin.x86_64 $out/bin/TerrariaServer
21−
18+ cp -r Linux $out/
19+ ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer
2220 # Fix "/lib64/ld-linux-x86-64.so.2" like references in ELF executables.
23− echo "running patchelf on prebuilt binaries:"
2421 find "$out" | while read filepath; do
2522 if file "$filepath" | grep -q "ELF.*executable"; then
2623 echo "setting interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) in $filepath"
@@ -32,7 +29,7 @@ stdenv.mkDerivation rec {
3229
3330 meta = with lib; {
3431 homepage = http://terraria.org;
35− description = "Dedicated server for the main game";
32+ description = "Dedicated server for Terraria, a 2D action-adventure sandbox";
3633 platforms = platforms.linux;
3734 license = licenses.unfree;
3835 };