From f3840380fd3107712b9cadf0b17236cd6d91403e Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:11:06 +0100 Subject: [PATCH 01/16] teamspeak_client: don't wrap with cc's libdir This pulls in the entire C compiler into the runtime closure. It works just fine without this. --- .../networking/instant-messengers/teamspeak/client.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 6aa7e45ac117..649df6509a22 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -31,8 +31,6 @@ let arch = "amd64"; - libDir = "lib64"; - deps = [ zlib glib @@ -109,7 +107,7 @@ stdenv.mkDerivation rec { 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} \ + --set-rpath ${lib.makeLibraryPath deps} \ --force-rpath \ ts3client ''; From c056c7dd7a110dc296268d3473748dfa142ff2b9 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:12:04 +0100 Subject: [PATCH 02/16] teamspeak_client: use regular libcxx No reason to use the one from LLVM. --- .../networking/instant-messengers/teamspeak/client.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 649df6509a22..cd9c8de55df6 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -24,7 +24,7 @@ quazip, which, perl, - llvmPackages, + libcxx, }: let @@ -56,7 +56,7 @@ let qtwebsockets libpulseaudio quazip - llvmPackages.libcxx + libcxx ]; desktopItem = makeDesktopItem { From cdd40cb89c34fb7c6b33130f4d762073a86054ec Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:16:28 +0100 Subject: [PATCH 03/16] teamspeak_client: refactor QT deps This is the modern method of accessing them and is compatible with by-name. --- .../instant-messengers/teamspeak/client.nix | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index cd9c8de55df6..57118a5b95ed 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -12,16 +12,12 @@ openssl, xorg, fontconfig, - qtbase, - qtwebengine, - qtwebchannel, - qtsvg, - qtwebsockets, + qt5, + libsForQt5, xkeyboard_config, alsa-lib, libpulseaudio ? null, libredirect, - quazip, which, perl, libcxx, @@ -49,15 +45,16 @@ let xorg.libXext xorg.libX11 alsa-lib + libpulseaudio + libsForQt5.quazip + libcxx + ] ++ (with qt5; [ qtbase qtwebengine qtwebchannel qtsvg qtwebsockets - libpulseaudio - quazip - libcxx - ]; + ]); desktopItem = makeDesktopItem { name = "teamspeak"; @@ -104,7 +101,7 @@ stdenv.mkDerivation rec { buildPhase = '' mv ts3client_linux_${arch} ts3client echo "patching ts3client..." - patchelf --replace-needed libquazip.so ${quazip}/lib/libquazip1-qt5.so ts3client + patchelf --replace-needed libquazip.so ${libsForQt5.quazip}/lib/libquazip1-qt5.so ts3client patchelf \ --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath ${lib.makeLibraryPath deps} \ @@ -135,7 +132,7 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/ts3client \ --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ - --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}" \ + --set QT_PLUGIN_PATH "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}" \ '' # wayland is currently broken, remove when TS3 fixes that + '' --set QT_QPA_PLATFORM xcb \ From 0f029a19c62beb5064d0dab178d0414e9dcfd9d1 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:23:35 +0100 Subject: [PATCH 04/16] teamspeak_client: run phase hooks --- .../instant-messengers/teamspeak/client.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 57118a5b95ed..4a3ca9352b52 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -94,11 +94,17 @@ stdenv.mkDerivation rec { # + PAGER_PATH= # it's looking for a dependency and didn't find it. Check the script and make sure the dep is in nativeBuildInputs. unpackPhase = '' + runHook preUnpack + echo -e '\ny' | PAGER=cat sh -xe $src cd TeamSpeak* + + runHook postUnpack ''; buildPhase = '' + runHook preBuild + mv ts3client_linux_${arch} ts3client echo "patching ts3client..." patchelf --replace-needed libquazip.so ${libsForQt5.quazip}/lib/libquazip1-qt5.so ts3client @@ -107,10 +113,14 @@ stdenv.mkDerivation rec { --set-rpath ${lib.makeLibraryPath deps} \ --force-rpath \ ts3client + + runHook postBuild ''; installPhase = '' + runHook preInstall + # Delete unecessary libraries - these are provided by nixos. rm *.so.* *.so rm QtWebEngineProcess @@ -137,6 +147,8 @@ stdenv.mkDerivation rec { + '' --set QT_QPA_PLATFORM xcb \ --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb + + runHook postInstall ''; dontStrip = true; From 56a739f756c9f427e1a99d9f719d4944f5c623b8 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:23:58 +0100 Subject: [PATCH 05/16] teamspeak_client: make libredirect a regular runtimeDep I don't see a need to preload here --- .../networking/instant-messengers/teamspeak/client.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 4a3ca9352b52..649d4b9f994e 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -48,6 +48,7 @@ let libpulseaudio libsForQt5.quazip libcxx + libredirect ] ++ (with qt5; [ qtbase qtwebengine @@ -141,7 +142,6 @@ stdenv.mkDerivation rec { ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client wrapProgram $out/bin/ts3client \ - --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \ --set QT_PLUGIN_PATH "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}" \ '' # wayland is currently broken, remove when TS3 fixes that + '' From 1a5940c3e8b33b356e26eb5d86bd5c1f637911d7 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:27:34 +0100 Subject: [PATCH 06/16] teamspeak_client: use wrapQtAppsHook --- .../networking/instant-messengers/teamspeak/client.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 649d4b9f994e..5f343bc26d83 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -88,6 +88,7 @@ stdenv.mkDerivation rec { makeWrapper which perl # Installer script needs `shasum` + qt5.wrapQtAppsHook ]; # This just runs the installer script. If it gets stuck at something like @@ -141,14 +142,16 @@ stdenv.mkDerivation rec { mkdir -p $out/bin/ ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client + runHook postInstall + ''; + + preFixup = + '' wrapProgram $out/bin/ts3client \ - --set QT_PLUGIN_PATH "${qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}" \ '' # wayland is currently broken, remove when TS3 fixes that + '' --set QT_QPA_PLATFORM xcb \ --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb - - runHook postInstall ''; dontStrip = true; From cba4002e45b381bc618e7b294976949f653c59b4 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:37:02 +0100 Subject: [PATCH 07/16] teamspeak_client: refactor libquazip patching --- .../networking/instant-messengers/teamspeak/client.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 5f343bc26d83..9f71359f7194 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -109,7 +109,9 @@ stdenv.mkDerivation rec { mv ts3client_linux_${arch} ts3client echo "patching ts3client..." - patchelf --replace-needed libquazip.so ${libsForQt5.quazip}/lib/libquazip1-qt5.so ts3client + # Our libquazip's so name has this suffix and there is no symlink + patchelf --replace-needed libquazip.so libquazip1-qt5.so ts3client + patchelf \ --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath ${lib.makeLibraryPath deps} \ From 9db530c94c90dcadd5b62b0940cd99777facf436 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 06:51:04 +0100 Subject: [PATCH 08/16] teamspeak_client: use autoPatchelfHook rather than manual patchelf --- .../instant-messengers/teamspeak/client.nix | 99 +++++++++---------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 9f71359f7194..52c46461a59c 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -21,42 +21,13 @@ which, perl, libcxx, + autoPatchelfHook, }: let arch = "amd64"; - 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 - libpulseaudio - libsForQt5.quazip - libcxx - libredirect - ] ++ (with qt5; [ - qtbase - qtwebengine - qtwebchannel - qtsvg - qtwebsockets - ]); - desktopItem = makeDesktopItem { name = "teamspeak"; exec = "ts3client"; @@ -89,8 +60,39 @@ stdenv.mkDerivation rec { which perl # Installer script needs `shasum` qt5.wrapQtAppsHook + autoPatchelfHook ]; + buildInputs = [ + 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 + libpulseaudio + libsForQt5.quazip + libcxx + libredirect + ] ++ (with qt5; [ + qtbase + qtwebengine + qtwebchannel + qtsvg + qtwebsockets + ]); + # This just runs the installer script. If it gets stuck at something like # ++ exec # + PAGER_PATH= @@ -99,38 +101,36 @@ stdenv.mkDerivation rec { runHook preUnpack echo -e '\ny' | PAGER=cat sh -xe $src - cd TeamSpeak* + + mv TeamSpeak3-Client-linux_${arch}/* . runHook postUnpack ''; - buildPhase = '' - runHook preBuild + patchPhase = '' + runHook prePatch + + # Delete unecessary libraries - these are provided by nixos. + find . -\( -name '*.so' -or -name '*.so.*' -\) -print0 | xargs -0 rm # I hate find. + + rm QtWebEngineProcess + rm qt.conf mv ts3client_linux_${arch} ts3client - echo "patching ts3client..." + # Our libquazip's so name has this suffix and there is no symlink - patchelf --replace-needed libquazip.so libquazip1-qt5.so ts3client + patchelf --replace-needed libquazip.so libquazip1-qt5.so ts3client error_report - patchelf \ - --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath ${lib.makeLibraryPath deps} \ - --force-rpath \ - ts3client - - runHook postBuild + runHook postPatch ''; + dontConfigure = true; + dontBuild = true; + installPhase = '' runHook preInstall - # 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/ @@ -156,9 +156,6 @@ stdenv.mkDerivation rec { --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb ''; - dontStrip = true; - dontPatchELF = true; - meta = with lib; { description = "TeamSpeak voice communication tool"; homepage = "https://teamspeak.com/"; From 49a5c6431cb9fca75f7291492ff0cb82d1a93c6e Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 07:19:04 +0100 Subject: [PATCH 09/16] teamspeak_client: remove unnecessary dependencies I honestly don't know what these are here for but they're not in any of the binaries' NEEDED sections, so let's yeet them. autoPatchelfHook ensures we have all required libraries. --- .../instant-messengers/teamspeak/client.nix | 53 +++++-------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 52c46461a59c..154d00bf0e71 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -5,20 +5,10 @@ fetchzip, makeWrapper, makeDesktopItem, - zlib, glib, - libpng, - freetype, - openssl, - xorg, - fontconfig, qt5, libsForQt5, xkeyboard_config, - alsa-lib, - libpulseaudio ? null, - libredirect, - which, perl, libcxx, autoPatchelfHook, @@ -57,41 +47,24 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper - which perl # Installer script needs `shasum` qt5.wrapQtAppsHook autoPatchelfHook ]; - buildInputs = [ - 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 - libpulseaudio - libsForQt5.quazip - libcxx - libredirect - ] ++ (with qt5; [ - qtbase - qtwebengine - qtwebchannel - qtsvg - qtwebsockets - ]); + buildInputs = + [ + libsForQt5.quazip + glib + libcxx + ] + ++ (with qt5; [ + qtbase + qtwebengine + qtwebchannel + qtwebsockets + qtsvg + ]); # This just runs the installer script. If it gets stuck at something like # ++ exec From 3830a3dbf6410d37fa1250a5c222c4148988207a Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 07:32:01 +0100 Subject: [PATCH 10/16] teamspeak_client: modernise installPhase --- .../instant-messengers/teamspeak/client.nix | 72 +++++++++---------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 154d00bf0e71..ecb191fa8563 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -3,7 +3,6 @@ stdenv, fetchurl, fetchzip, - makeWrapper, makeDesktopItem, glib, qt5, @@ -12,20 +11,15 @@ perl, libcxx, autoPatchelfHook, + copyDesktopItems, }: let - arch = "amd64"; - desktopItem = makeDesktopItem { - name = "teamspeak"; - exec = "ts3client"; - icon = "teamspeak"; - comment = "The TeamSpeak voice communication tool"; - desktopName = "TeamSpeak"; - genericName = "TeamSpeak"; - categories = [ "Network" ]; + pluginsdk = fetchzip { + url = "https://files.teamspeak-services.com/releases/sdk/3.3.1/ts_sdk_3.3.1.zip"; + hash = "sha256-wx4pBZHpFPoNvEe4xYE80KnXGVda9XcX35ho4R8QxrQ="; }; in @@ -39,17 +33,11 @@ stdenv.mkDerivation rec { hash = "sha256-WfEQQ4lxoj+QSnAOfdCoEc+Z1Oa5dbo6pFli1DsAZCI="; }; - # grab the plugin sdk for the desktop icon - pluginsdk = fetchzip { - url = "https://files.teamspeak-services.com/releases/sdk/3.3.1/ts_sdk_3.3.1.zip"; - hash = "sha256-wx4pBZHpFPoNvEe4xYE80KnXGVda9XcX35ho4R8QxrQ="; - }; - nativeBuildInputs = [ - makeWrapper perl # Installer script needs `shasum` qt5.wrapQtAppsHook autoPatchelfHook + copyDesktopItems ]; buildInputs = @@ -100,34 +88,38 @@ stdenv.mkDerivation rec { dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall + desktopItems = [ + (makeDesktopItem { + name = "teamspeak"; + exec = "ts3client"; + icon = "teamspeak"; + comment = "The TeamSpeak voice communication tool"; + desktopName = "TeamSpeak"; + genericName = "TeamSpeak"; + categories = [ "Network" ]; + }) + ]; - # Install files. - mkdir -p $out/lib/teamspeak - mv * $out/lib/teamspeak/ + qtWrapperArgs = [ + # wayland is currently broken, remove when TS3 fixes that + "--set QT_QPA_PLATFORM xcb" + "--set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb" + ]; - # Make a desktop item - mkdir -p $out/share/applications/ $out/share/icons/hicolor/64x64/apps/ - cp ${pluginsdk}/doc/_static/logo.png $out/share/icons/hicolor/64x64/apps/teamspeak.png - cp ${desktopItem}/share/applications/* $out/share/applications/ + installPhase = '' + runHook preInstall - # Make a symlink to the binary from bin. - mkdir -p $out/bin/ - ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client + mkdir -p $out/lib/teamspeak + mv * $out/lib/teamspeak/ - runHook postInstall - ''; + # Grab the desktop icon from the plugin sdk + install ${pluginsdk}/doc/_static/logo.png -D $out/share/icons/hicolor/64x64/apps/teamspeak.png - preFixup = - '' - wrapProgram $out/bin/ts3client \ - '' # wayland is currently broken, remove when TS3 fixes that - + '' - --set QT_QPA_PLATFORM xcb \ - --set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb - ''; + mkdir -p $out/bin/ + ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client + + runHook postInstall + ''; meta = with lib; { description = "TeamSpeak voice communication tool"; From 2568cfa348896fc53df0cc3dfe41bf34fef5acb5 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 07:44:53 +0100 Subject: [PATCH 11/16] teamspeak_client: install to opt/ subdirectory This is not a library. This actually matters somewhat because lib/ is installed into the system-wide path on NixOS for whatever reason. --- .../networking/instant-messengers/teamspeak/client.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index ecb191fa8563..6cd0b0a3e4a0 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -109,14 +109,14 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall - mkdir -p $out/lib/teamspeak - mv * $out/lib/teamspeak/ + mkdir -p $out/opt/teamspeak + mv * $out/opt/teamspeak/ # Grab the desktop icon from the plugin sdk install ${pluginsdk}/doc/_static/logo.png -D $out/share/icons/hicolor/64x64/apps/teamspeak.png mkdir -p $out/bin/ - ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client + ln -s $out/opt/teamspeak/ts3client $out/bin/ts3client runHook postInstall ''; From e5017770eb89ef432bb5880681347ca05c48d7d2 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 07:50:25 +0100 Subject: [PATCH 12/16] teamspeak_client: run installer script without -x by default It's only relevant for debugging the package when updating. --- .../instant-messengers/teamspeak/client.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix index 6cd0b0a3e4a0..17643f0a4ee6 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix @@ -54,14 +54,19 @@ stdenv.mkDerivation rec { qtsvg ]); - # This just runs the installer script. If it gets stuck at something like + # This runs the installer script. If it gets stuck, run it with -x. + # If it then gets stuck at something like: + # # ++ exec # + PAGER_PATH= - # it's looking for a dependency and didn't find it. Check the script and make sure the dep is in nativeBuildInputs. + # + # it's looking for a dependency and didn't find it. Check the script and make + # sure the dep is in nativeBuildInputs. unpackPhase = '' runHook preUnpack - echo -e '\ny' | PAGER=cat sh -xe $src + # Run the installer script non-interactively + echo -e '\ny' | PAGER=cat sh -e $src mv TeamSpeak3-Client-linux_${arch}/* . From 4d98fc18e856b3776af9e9d08b9bd1f49323bdde Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 07:56:39 +0100 Subject: [PATCH 13/16] teamspeak3: rename from teamspeak_client This is what people would be looking for when searching for "teamspeak". Barely anyone will need the server and those who do will likely explicitly look for the server rather than just "teamspeak". teamspeak_server should probably be renamed to teamspeak3-server. --- .../teamspeak/client.nix => by-name/te/teamspeak3/package.nix} | 2 +- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) rename pkgs/{applications/networking/instant-messengers/teamspeak/client.nix => by-name/te/teamspeak3/package.nix} (99%) diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/by-name/te/teamspeak3/package.nix similarity index 99% rename from pkgs/applications/networking/instant-messengers/teamspeak/client.nix rename to pkgs/by-name/te/teamspeak3/package.nix index 17643f0a4ee6..42bf8a65029d 100644 --- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix +++ b/pkgs/by-name/te/teamspeak3/package.nix @@ -24,7 +24,7 @@ let in stdenv.mkDerivation rec { - pname = "teamspeak-client"; + pname = "teamspeak3"; version = "3.6.2"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index cd0b0dffff68..b3369ae32820 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1184,6 +1184,7 @@ mapAliases { tclx = tclPackages.tclx; # Added 2024-10-02 tdesktop = telegram-desktop; # Added 2023-04-07 tdom = tclPackages.tdom; # Added 2024-10-02 + teamspeak_client = teamspeak3; # Added 2024-11-07 teck-programmer = throw "teck-programmer was removed because it was broken and unmaintained"; # added 2024-08-23 teleport_13 = throw "teleport 13 has been removed as it is EOL. Please upgrade to Teleport 14 or later"; # Added 2024-05-26 teleport_14 = throw "teleport 14 has been removed as it is EOL. Please upgrade to Teleport 15 or later"; # Added 2024-10-18 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b3226511390c..a2c821712fa2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16087,7 +16087,6 @@ with pkgs; tamgamp.lv2 = callPackage ../applications/audio/tamgamp.lv2 { }; - teamspeak_client = libsForQt5.callPackage ../applications/networking/instant-messengers/teamspeak/client.nix { }; teamspeak5_client = callPackage ../applications/networking/instant-messengers/teamspeak/client5.nix { }; teamspeak_server = callPackage ../applications/networking/instant-messengers/teamspeak/server.nix { }; From 585c5ae3bcfa10c71f5d0609eca4448eaf2b92d0 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 13:59:45 +0100 Subject: [PATCH 14/16] teamspeak3: remove NIX_REDIRECTS The lib was removed earlier, so this doen't have any effect. It didn't appear to cause any issues. --- pkgs/by-name/te/teamspeak3/package.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/by-name/te/teamspeak3/package.nix b/pkgs/by-name/te/teamspeak3/package.nix index 42bf8a65029d..b7ccde2d1390 100644 --- a/pkgs/by-name/te/teamspeak3/package.nix +++ b/pkgs/by-name/te/teamspeak3/package.nix @@ -7,7 +7,6 @@ glib, qt5, libsForQt5, - xkeyboard_config, perl, libcxx, autoPatchelfHook, @@ -108,7 +107,6 @@ stdenv.mkDerivation rec { qtWrapperArgs = [ # wayland is currently broken, remove when TS3 fixes that "--set QT_QPA_PLATFORM xcb" - "--set NIX_REDIRECTS /usr/share/X11/xkb=${xkeyboard_config}/share/X11/xkb" ]; installPhase = '' From e4ea814f0c8e49424f6cc5c5de3f62530bf04227 Mon Sep 17 00:00:00 2001 From: Atemu Date: Thu, 7 Nov 2024 14:01:05 +0100 Subject: [PATCH 15/16] teamspeak3: avoid `with lib;` --- pkgs/by-name/te/teamspeak3/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/te/teamspeak3/package.nix b/pkgs/by-name/te/teamspeak3/package.nix index b7ccde2d1390..d47810b46132 100644 --- a/pkgs/by-name/te/teamspeak3/package.nix +++ b/pkgs/by-name/te/teamspeak3/package.nix @@ -124,17 +124,17 @@ stdenv.mkDerivation rec { runHook postInstall ''; - meta = with lib; { + meta = { description = "TeamSpeak voice communication tool"; homepage = "https://teamspeak.com/"; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = { # See distribution-permit.txt for a confirmation that nixpkgs is allowed to distribute TeamSpeak. fullName = "Teamspeak client license"; url = "https://www.teamspeak.com/en/privacy-and-terms/"; free = false; }; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ lhvwb lukegb atemu From 93a01b05975ad74b0b02cd409f5d0a2847b43949 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 9 Nov 2024 21:41:02 +0000 Subject: [PATCH 16/16] teamspeak3: drop 'arch' variable This variable is always set to "amd64", so there's no point keeping it. If there's an aarch64 version in future it can be added back. --- pkgs/by-name/te/teamspeak3/package.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/te/teamspeak3/package.nix b/pkgs/by-name/te/teamspeak3/package.nix index d47810b46132..01e5739b169f 100644 --- a/pkgs/by-name/te/teamspeak3/package.nix +++ b/pkgs/by-name/te/teamspeak3/package.nix @@ -14,8 +14,6 @@ }: let - arch = "amd64"; - pluginsdk = fetchzip { url = "https://files.teamspeak-services.com/releases/sdk/3.3.1/ts_sdk_3.3.1.zip"; hash = "sha256-wx4pBZHpFPoNvEe4xYE80KnXGVda9XcX35ho4R8QxrQ="; @@ -28,7 +26,7 @@ stdenv.mkDerivation rec { version = "3.6.2"; src = fetchurl { - url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run"; + url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_amd64-${version}.run"; hash = "sha256-WfEQQ4lxoj+QSnAOfdCoEc+Z1Oa5dbo6pFli1DsAZCI="; }; @@ -67,7 +65,7 @@ stdenv.mkDerivation rec { # Run the installer script non-interactively echo -e '\ny' | PAGER=cat sh -e $src - mv TeamSpeak3-Client-linux_${arch}/* . + cd TeamSpeak3-Client-linux_amd64 runHook postUnpack ''; @@ -81,7 +79,7 @@ stdenv.mkDerivation rec { rm QtWebEngineProcess rm qt.conf - mv ts3client_linux_${arch} ts3client + mv ts3client_linux_amd64 ts3client # Our libquazip's so name has this suffix and there is no symlink patchelf --replace-needed libquazip.so libquazip1-qt5.so ts3client error_report