mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 02:44:30 +00:00
terraria-server: 1.3.5.3 -> 1.4.0.3
Also use autoPatchelfHook and nixfmt it
This commit is contained in:
parent
4f6cd4f6c6
commit
466fb98bcd
@ -1,36 +1,30 @@
|
|||||||
{ stdenv, lib, file, fetchurl, unzip }:
|
{ stdenv, lib, file, fetchurl, autoPatchelfHook, unzip }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "terraria-server";
|
pname = "terraria-server";
|
||||||
version = "1.3.5.3";
|
version = "1.4.0.3";
|
||||||
urlVersion = lib.replaceChars ["."] [""] version;
|
urlVersion = lib.replaceChars [ "." ] [ "" ] version;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://terraria.org/server/terraria-server-${urlVersion}.zip";
|
url = "https://terraria.org/system/dedicated_servers/archives/000/000/037/original/terraria-server-${urlVersion}.zip";
|
||||||
sha256 = "0l7j2n6ip4hxph7dfal7kzdm3dqnm1wba6zc94gafkh97wr35ck3";
|
sha256 = "1g9rd0a40gsljk8xp3bkvwy8ngywjzk8chf2x9l43s2kf40ib0p8";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ file unzip ];
|
buildInputs = [ file unzip ];
|
||||||
|
nativeBuildInputs = [ autoPatchelfHook ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp -r Linux $out/
|
cp -r Linux $out/
|
||||||
chmod +x "$out/Linux/TerrariaServer.bin.x86_64"
|
chmod +x "$out/Linux/TerrariaServer.bin.x86_64"
|
||||||
ln -s "$out/Linux/TerrariaServer.bin.x86_64" $out/bin/TerrariaServer
|
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; {
|
meta = with lib; {
|
||||||
homepage = "http://terraria.org";
|
homepage = "https://terraria.org";
|
||||||
description = "Dedicated server for Terraria, a 2D action-adventure sandbox";
|
description =
|
||||||
platforms = ["x86_64-linux"];
|
"Dedicated server for Terraria, a 2D action-adventure sandbox";
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user