vscode-extensions.saoudrizwan.claude-dev: 3.1.11 -> 3.2.5 (#375877)
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / teamspeak / server.nix
blobba8a5c5fa61052c109d69bb0a22e2c175f6bacbb
2   lib,
3   stdenv,
4   fetchurl,
5   postgresql,
6   autoPatchelfHook,
7   writeScript,
8 }:
10 let
11   arch = if stdenv.hostPlatform.is64bit then "amd64" else "x86";
13 stdenv.mkDerivation rec {
14   pname = "teamspeak-server";
15   version = "3.13.7";
17   src = fetchurl {
18     url = "https://files.teamspeak-services.com/releases/server/${version}/teamspeak3-server_linux_${arch}-${version}.tar.bz2";
19     sha256 =
20       if stdenv.hostPlatform.is64bit then
21         "sha256-d1pXMamAmAHkyPkGbNm8ViobNoVTE5wSSfKgdA1QBB4="
22       else
23         "sha256-aMEDOnvBeKfzG8lDFhU8I5DYgG53IsCDBMV2MUyJi2g=";
24   };
26   buildInputs = [
27     stdenv.cc.cc
28     postgresql.lib
29   ];
31   nativeBuildInputs = [ autoPatchelfHook ];
33   installPhase = ''
34     runHook preInstall
36     # Install files.
37     mkdir -p $out/lib/teamspeak
38     mv * $out/lib/teamspeak/
40     # Make symlinks to the binaries from bin.
41     mkdir -p $out/bin/
42     ln -s $out/lib/teamspeak/ts3server $out/bin/ts3server
43     ln -s $out/lib/teamspeak/tsdns/tsdnsserver $out/bin/tsdnsserver
45     runHook postInstall
46   '';
48   passthru.updateScript = writeScript "update-teampeak-server" ''
49     #!/usr/bin/env nix-shell
50     #!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused jq pup
52     set -eu -o pipefail
54     version=$( \
55       curl https://www.teamspeak.com/en/downloads/ \
56         | pup "#server .linux .version json{}" \
57         | jq -r ".[0].text"
58     )
60     versionOld=$(nix-instantiate --eval --strict -A "teamspeak_server.version")
62     nixFile=pkgs/applications/networking/instant-messengers/teamspeak/server.nix
64     update-source-version teamspeak_server "$version" --system=i686-linux
66     sed -i -e "s/version = \"$version\";/version = $versionOld;/" "$nixFile"
68     update-source-version teamspeak_server "$version" --system=x86_64-linux
69   '';
71   meta = with lib; {
72     description = "TeamSpeak voice communication server";
73     homepage = "https://teamspeak.com/";
74     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
75     # See distribution-permit.txt for a confirmation that nixpkgs is allowed to distribute TeamSpeak.
76     license = licenses.unfreeRedistributable;
77     platforms = platforms.linux;
78     maintainers = with maintainers; [
79       arobyn
80       gerschtli
81     ];
82   };