Merge pull request #84650 from Gerschtli/update/ts3

teamspeak_server: 3.11.0 -> 3.12.1
This commit is contained in:
Mario Rodas 2020-04-12 04:18:32 -05:00 committed by GitHub
commit 537e891929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,16 @@
{ stdenv, fetchurl, autoPatchelfHook }:
{ stdenv, fetchurl, autoPatchelfHook, writeScript }:
let
arch = if stdenv.is64bit then "amd64" else "x86";
in stdenv.mkDerivation rec {
pname = "teamspeak-server";
version = "3.11.0";
version = "3.12.1";
src = fetchurl {
url = "https://files.teamspeak-services.com/releases/server/${version}/teamspeak3-server_linux_${arch}-${version}.tar.bz2";
sha256 = if stdenv.is64bit
then "18hsr119dq46rvhz5sb9snn2gfxwiig37g6bfzk24x6wlga3xihq"
else "1lyazw328azi0asvgvcsxglc1saqih6ss0g8pc8f5pzqngk9p953";
then "1dxbnk12ry6arn1p38hpv5jfak55pmfmxkkl7aihn3sp1aizpgyg"
else "0nfzx7pbzd95a7v08g29l84sc0lnv9fx8vz3mrmzhs0xqn9gxdkq";
};
buildInputs = [ stdenv.cc.cc ];
@ -28,6 +28,29 @@ in stdenv.mkDerivation rec {
ln -s $out/lib/teamspeak/tsdns/tsdnsserver $out/bin/tsdnsserver
'';
passthru.updateScript = writeScript "update-teampeak-server" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused
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/' \
)
versionOld=$(nix-instantiate --eval --strict -A "teamspeak_server.version")
nixFile=pkgs/applications/networking/instant-messengers/teamspeak/server.nix
update-source-version teamspeak_server "$version" --system=i686-linux
sed -i -e "s/version = \"$version\";/version = $versionOld;/" "$nixFile"
update-source-version teamspeak_server "$version" --system=x86_64-linux
'';
meta = with stdenv.lib; {
description = "TeamSpeak voice communication server";
homepage = "https://teamspeak.com/";