Merge pull request #125013 from NixOS/backport-124601-to-release-21.05

This commit is contained in:
Artturi 2021-08-06 16:34:51 +03:00 committed by GitHub
commit 6a694d5e9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -4,13 +4,13 @@ let
arch = if stdenv.is64bit then "amd64" else "x86";
in stdenv.mkDerivation rec {
pname = "teamspeak-server";
version = "3.13.3";
version = "3.13.5";
src = fetchurl {
url = "https://files.teamspeak-services.com/releases/server/${version}/teamspeak3-server_linux_${arch}-${version}.tar.bz2";
sha256 = if stdenv.is64bit
then "sha256-+b9S0ekQmXF5KwvVcmHIDpp0iZRO2W1ls8eYhDzjUUw="
else "sha256-Qu6xPzbUdqO93j353cfQILlFYqmwFSnFWG9TjniX0+c=";
then "sha256-2tSX/ET2lZsi0mVB3KnbnBXMSTRsneGUA8w6mZ6TmlY="
else "sha256-RdxG4nGXTTSY+P5oZu4uP5l7gKcU9C6uIILyNldSK50=";
};
buildInputs = [ stdenv.cc.cc postgresql.lib ];
@ -18,6 +18,8 @@ in stdenv.mkDerivation rec {
nativeBuildInputs = [ autoPatchelfHook ];
installPhase = ''
runHook preInstall
# Install files.
mkdir -p $out/lib/teamspeak
mv * $out/lib/teamspeak/
@ -26,18 +28,20 @@ in stdenv.mkDerivation rec {
mkdir -p $out/bin/
ln -s $out/lib/teamspeak/ts3server $out/bin/ts3server
ln -s $out/lib/teamspeak/tsdns/tsdnsserver $out/bin/tsdnsserver
runHook postInstall
'';
passthru.updateScript = writeScript "update-teampeak-server" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused
#!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused jq pup
set -eu -o pipefail
version=$( \
curl -s "https://www.teamspeak.de/download/teamspeak-3-amd64-server-linux/" \
| grep softwareVersion \
| sed -E -e 's/^.*<span itemprop="softwareVersion">([^<]+)<\/span>.*$/\1/' \
curl https://www.teamspeak.com/en/downloads/ \
| pup "#server .linux .version json{}" \
| jq -r ".[0].text"
)
versionOld=$(nix-instantiate --eval --strict -A "teamspeak_server.version")