From 5ed554543c2e570de87c81abcfb894c0af0f6e2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Aug 2021 10:01:37 +0100 Subject: [PATCH] [Backport release-21.05] terraria-server: update source URL (#132855) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * terraria-server: update source URL The old URL redirects to the main page. (cherry picked from commit 1e919bfeedae2abefb520a4fad7e9e37e98be8e0) * Apply suggestions from code review Co-authored-by: Naïm Favier Co-authored-by: Jörg Thalheim --- pkgs/games/terraria-server/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/games/terraria-server/default.nix b/pkgs/games/terraria-server/default.nix index b5a8c7e486b..95510266c45 100644 --- a/pkgs/games/terraria-server/default.nix +++ b/pkgs/games/terraria-server/default.nix @@ -6,7 +6,7 @@ stdenv.mkDerivation rec { urlVersion = lib.replaceChars [ "." ] [ "" ] version; src = fetchurl { - url = "https://terraria.org/system/dedicated_servers/archives/000/000/046/original/terraria-server-${urlVersion}.zip"; + url = "https://terraria.org/api/download/pc-dedicated-server/terraria-server-${urlVersion}.zip"; sha256 = "0qm4pbm1d9gax47fk4zhw9rcxvajxs36w7dghirli89i994r7g8j"; }; @@ -14,16 +14,19 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoPatchelfHook unzip ]; installPhase = '' + runHook preInstall + mkdir -p $out/bin cp -r Linux $out/ chmod +x "$out/Linux/TerrariaServer.bin.x86_64" ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer + + runHook postInstall ''; meta = with lib; { homepage = "https://terraria.org"; - description = - "Dedicated server for Terraria, a 2D action-adventure sandbox"; + description = "Dedicated server for Terraria, a 2D action-adventure sandbox"; platforms = [ "x86_64-linux" ]; license = licenses.unfree; };