summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/teamspeak
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-05-31 09:59:33 +0000
committerAlyssa Ross <hi@alyssa.is>2022-05-31 09:59:57 +0000
commit9ff36293d1e428cd7bf03e8d4b03611b6d361c28 (patch)
tree1ab51a42b868c55b83f6ccdb80371b9888739dd9 /pkgs/applications/networking/instant-messengers/teamspeak
parent1c4fcd0d4b0541e674ee56ace1053e23e562cc80 (diff)
parentddc3c396a51918043bb0faa6f676abd9562be62c (diff)
downloadnixpkgs-archive.tar
nixpkgs-archive.tar.gz
nixpkgs-archive.tar.bz2
nixpkgs-archive.tar.lz
nixpkgs-archive.tar.xz
nixpkgs-archive.tar.zst
nixpkgs-archive.zip
Last good Nixpkgs for Weston+nouveau? archive
I came this commit hash to terwiz[m] on IRC, who is trying to figure out
what the last version of Spectrum that worked on their NUC with Nvidia
graphics is.
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/teamspeak')
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/client.nix148
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/server.nix100
2 files changed, 248 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
new file mode 100644
index 00000000000..80d04eabc82
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
@@ -0,0 +1,148 @@
+{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, zlib, glib, libpng, freetype, openssl
+, xorg, fontconfig, qtbase, qtwebengine, qtwebchannel, qtsvg, qtwebsockets, xkeyboard_config
+, alsa-lib, libpulseaudio ? null, libredirect, quazip, which, unzip, llvmPackages_10, writeShellScriptBin
+}:
+
+let
+
+  arch = if stdenv.is64bit then "amd64" else "x86";
+
+  libDir = if stdenv.is64bit then "lib64" else "lib";
+
+  deps =
+    [ zlib glib libpng freetype xorg.libSM xorg.libICE xorg.libXrender openssl
+      xorg.libXrandr xorg.libXfixes xorg.libXcursor xorg.libXinerama
+      xorg.libxcb fontconfig xorg.libXext xorg.libX11 alsa-lib qtbase qtwebengine qtwebchannel qtsvg
+      qtwebsockets libpulseaudio quazip llvmPackages_10.libcxx llvmPackages_10.libcxxabi # llvmPackages_11 and higher crash https://github.com/NixOS/nixpkgs/issues/161395
+    ];
+
+  desktopItem = makeDesktopItem {
+    name = "teamspeak";
+    exec = "ts3client";
+    icon = "teamspeak";
+    comment = "The TeamSpeak voice communication tool";
+    desktopName = "TeamSpeak";
+    genericName = "TeamSpeak";
+    categories = [ "Network" ];
+  };
+
+  fakeLess = writeShellScriptBin "less" "cat";
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "teamspeak-client";
+
+  version = "3.5.6";
+
+  src = fetchurl {
+    url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run";
+    sha256 = if stdenv.is64bit
+                then "sha256:0hjai1bd4mq3g2dlyi0zkn8s4zlgxd38skw77mb78nc4di5gvgpg"
+                else "sha256:1y1c65nap91nv9xkvd96fagqbfl56p9n0rl6iac0i29bkysdmija";
+  };
+
+  # grab the plugin sdk for the desktop icon
+  pluginsdk = fetchurl {
+    url = "http://dl.4players.de/ts/client/pluginsdk/pluginsdk_3.1.1.1.zip";
+    sha256 = "1bywmdj54glzd0kffvr27r84n4dsd0pskkbmh59mllbxvj0qwy7f";
+  };
+
+  nativeBuildInputs = [ makeWrapper fakeLess which unzip ];
+
+  unpackPhase =
+    ''
+      echo -e '\ny' | sh -xe $src
+      cd TeamSpeak*
+    '';
+
+  buildPhase =
+    ''
+      mv ts3client_linux_${arch} ts3client
+      echo "patching ts3client..."
+      patchelf --replace-needed libquazip.so ${quazip}/lib/libquazip1-qt5.so ts3client
+      patchelf \
+        --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath ${lib.makeLibraryPath deps}:$(cat $NIX_CC/nix-support/orig-cc)/${libDir} \
+        --force-rpath \
+        ts3client
+    '';
+
+  installPhase =
+    ''
+      # Delete unecessary libraries - these are provided by nixos.
+      rm *.so.* *.so
+      rm QtWebEngineProcess
+      rm qt.conf
+      rm -r platforms # contains libqxcb.so
+
+      # Install files.
+      mkdir -p $out/lib/teamspeak
+      mv * $out/lib/teamspeak/
+
+      # Make a desktop item
+      mkdir -p $out/share/applications/ $out/share/icons/hicolor/64x64/apps/
+      unzip ${pluginsdk}
+      cp pluginsdk/docs/client_html/images/logo.png $out/share/icons/hicolor/64x64/apps/teamspeak.png
+      cp ${desktopItem}/share/applications/* $out/share/applications/
+
+      # Make a symlink to the binary from bin.
+      mkdir -p $out/bin/
+      ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client
+
+      wrapProgram $out/bin/ts3client \
+        --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
+        --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}" \
+        --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb
+    '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  meta = with lib; {
+    description = "The TeamSpeak voice communication tool";
+    homepage = "https://teamspeak.com/";
+    license = {
+      fullName = "Teamspeak client license";
+      url = "https://www.teamspeak.com/en/privacy-and-terms/";
+      free = false;
+    };
+    maintainers = with maintainers; [ lhvwb lukegb ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
+
+/*
+License issues:
+Date: Mon, 10 Dec 2007 19:55:16 -0500
+From: TeamSpeak Sales <sales@tritoncia.com>
+To: 'Marc Weber' <marco-oweber@gmx.de>
+Subject: RE: teamspeak on nix?
+
+Yes, that would be fine.  As long as you are not renting servers or selling
+TeamSpeak then you are more than welcome to distribute it.
+
+Thank you,
+
+TeamSpeak Sales Team
+________________________________
+e-Mail: sales@tritoncia.com
+TeamSpeak: http://www.TeamSpeak.com
+Account Login: https://sales.TritonCIA.com/users
+
+
+
+-----Original Message-----
+From: Marc Weber [mailto:marco-oweber@gmx.de]
+Sent: Monday, December 10, 2007 5:03 PM
+To: sales@tritoncia.com
+Subject: teamspeak on nix?
+
+Hello,
+
+nix is very young software distribution system (http://nix.cs.uu.nl/)
+I'd like to ask wether you permit us to add teamspeak (server/ client?)
+
+Sincerly
+Marc Weber (small nix contributor)
+*/
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/server.nix b/pkgs/applications/networking/instant-messengers/teamspeak/server.nix
new file mode 100644
index 00000000000..44430ef62e2
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/server.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchurl, postgresql, autoPatchelfHook, writeScript }:
+
+let
+  arch = if stdenv.is64bit then "amd64" else "x86";
+in stdenv.mkDerivation rec {
+  pname = "teamspeak-server";
+  version = "3.13.6";
+
+  src = fetchurl {
+    url = "https://files.teamspeak-services.com/releases/server/${version}/teamspeak3-server_linux_${arch}-${version}.tar.bz2";
+    sha256 = if stdenv.is64bit
+      then "sha256-U3BNJ4Jjhd39gD7iMsHT8CGtm/GFQDE2kYQa2btyK+w="
+      else "sha256-8UKiFedv6w5bmqNvo3AXwQnUROwbZnU0ZTh9V17zmxQ=";
+  };
+
+  buildInputs = [ stdenv.cc.cc postgresql.lib ];
+
+  nativeBuildInputs = [ autoPatchelfHook ];
+
+  installPhase = ''
+    runHook preInstall
+
+    # Install files.
+    mkdir -p $out/lib/teamspeak
+    mv * $out/lib/teamspeak/
+
+    # Make symlinks to the binaries from bin.
+    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 jq pup
+
+    set -eu -o pipefail
+
+    version=$( \
+      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")
+
+    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 lib; {
+    description = "TeamSpeak voice communication server";
+    homepage = "https://teamspeak.com/";
+    license = licenses.unfreeRedistributable;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ arobyn gerschtli ];
+  };
+}
+
+/*
+License issues:
+Date: Mon, 10 Dec 2007 19:55:16 -0500
+From: TeamSpeak Sales <sales@tritoncia.com>
+To: 'Marc Weber' <marco-oweber@gmx.de>
+Subject: RE: teamspeak on nix?
+
+Yes, that would be fine.  As long as you are not renting servers or selling
+TeamSpeak then you are more than welcome to distribute it.
+
+Thank you,
+
+TeamSpeak Sales Team
+________________________________
+e-Mail: sales@tritoncia.com
+TeamSpeak: http://www.TeamSpeak.com
+Account Login: https://sales.TritonCIA.com/users
+
+
+
+-----Original Message-----
+From: Marc Weber [mailto:marco-oweber@gmx.de]
+Sent: Monday, December 10, 2007 5:03 PM
+To: sales@tritoncia.com
+Subject: teamspeak on nix?
+
+Hello,
+
+nix is very young software distribution system (http://nix.cs.uu.nl/)
+I'd like to ask wether you permit us to add teamspeak (server/ client?)
+
+Sincerly
+Marc Weber (small nix contributor)
+*/