|
1 |
| -{ stdenv, lib, file, fetchurl, unzip }: |
| 1 | +{ stdenv, lib, file, fetchurl, autoPatchelfHook, unzip }: |
2 | 2 |
|
3 | 3 | stdenv.mkDerivation rec {
|
4 | 4 | pname = "terraria-server";
|
5 |
| - version = "1.3.5.3"; |
6 |
| - urlVersion = lib.replaceChars ["."] [""] version; |
| 5 | + version = "1.4.0.3"; |
| 6 | + urlVersion = lib.replaceChars [ "." ] [ "" ] version; |
7 | 7 |
|
8 | 8 | src = fetchurl {
|
9 |
| - url = "https://terraria.org/server/terraria-server-${urlVersion}.zip"; |
10 |
| - sha256 = "0l7j2n6ip4hxph7dfal7kzdm3dqnm1wba6zc94gafkh97wr35ck3"; |
| 9 | + url = "https://terraria.org/system/dedicated_servers/archives/000/000/037/original/terraria-server-${urlVersion}.zip"; |
| 10 | + sha256 = "1g9rd0a40gsljk8xp3bkvwy8ngywjzk8chf2x9l43s2kf40ib0p8"; |
11 | 11 | };
|
12 | 12 |
|
13 | 13 | buildInputs = [ file unzip ];
|
| 14 | + nativeBuildInputs = [ autoPatchelfHook ]; |
14 | 15 |
|
15 | 16 | installPhase = ''
|
16 | 17 | mkdir -p $out/bin
|
17 | 18 | cp -r Linux $out/
|
18 | 19 | chmod +x "$out/Linux/TerrariaServer.bin.x86_64"
|
19 | 20 | ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer
|
20 |
| - # Fix "/lib64/ld-linux-x86-64.so.2" like references in ELF executables. |
21 |
| - find "$out" | while read filepath; do |
22 |
| - if file "$filepath" | grep -q "ELF.*executable"; then |
23 |
| - echo "setting interpreter $(cat "$NIX_CC"/nix-support/dynamic-linker) in $filepath" |
24 |
| - patchelf --set-interpreter "$(cat "$NIX_CC"/nix-support/dynamic-linker)" "$filepath" |
25 |
| - test $? -eq 0 || { echo "patchelf failed to process $filepath"; exit 1; } |
26 |
| - fi |
27 |
| - done |
28 | 21 | '';
|
29 | 22 |
|
30 | 23 | meta = with lib; {
|
31 |
| - homepage = "http://terraria.org"; |
32 |
| - description = "Dedicated server for Terraria, a 2D action-adventure sandbox"; |
33 |
| - platforms = ["x86_64-linux"]; |
| 24 | + homepage = "https://terraria.org"; |
| 25 | + description = |
| 26 | + "Dedicated server for Terraria, a 2D action-adventure sandbox"; |
| 27 | + platforms = [ "x86_64-linux" ]; |
34 | 28 | license = licenses.unfree;
|
35 | 29 | };
|
36 | 30 | }
|
0 commit comments