nixpkgs/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
a-n-n-a-l-e-e ce789e7e35
llvmPackages_{12,13,14,15,16,17,git}.{libcxx,libcxxabi}: merge libcxxabi into libcxx (#292043)
- merge libcxxabi into libcxx for LLVM 12, 13, 14, 15, 16, 17, and git.
- remove the link time workaround `-lc++ -lc++abi` from 58 packages as it is no longer required.
- fixes https://github.com/NixOS/nixpkgs/issues/166205
- provides alternative fixes for. https://github.com/NixOS/nixpkgs/issues/269548 https://github.com/NixOS/nix/issues/9640
- pkgsCross.x86_64-freebsd builds work again

This change can be represented in 3 stages
1. merge libcxxabi into libcxx -- files: pkgs/development/compilers/llvm/[12, git]/{libcxx, libcxxabi}
2. update stdenv to account for merge -- files: stdenv.{adapters, cc.wrapper, darwin}
3. remove all references to libcxxabi outside of llvm (about 58 packages modified)

### merging libcxxabi into libcxx
- take the union of the libcxxabi and libcxx cmake flags
- eliminate the libcxx-headers-only package - it was only needed to break libcxx <-> libcxxabi circular dependency
- libcxx.cxxabi is removed. external cxxabi (freebsd) will symlink headers / libs into libcxx.
- darwin will re-export the libcxxabi symbols into libcxx so linking `-lc++` is sufficient.
- linux/freebsd `libc++.so` is a linker script `LINK(libc++.so.1, -lc++abi)` making `-lc++` sufficient.
- libcxx/default.nix [12, 17] are identical except for patches and `LIBCXX_ADDITIONAL_LIBRARIES` (only used in 16+)
- git/libcxx/defaul.nix  does not link with -nostdlib when useLLVM is true so flag is removed. this is not much different than before as libcxxabi used -nostdlib where libcxx did not, so libc was linked in anyway.

### stdenv changes
- darwin bootstrap, remove references to libcxxabi and cxxabi
- cc-wrapper: remove c++ link workaround when libcxx.cxxabi doesn't exist (still exists for LLVM pre 12)
- adapter: update overrideLibcxx to account for a pkgs.stdenv that only has libcxx

### 58 package updates
- remove `NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}` as no longer needed
- swift, nodejs_v8 remove libcxxabi references in the clang override

https://github.com/NixOS/nixpkgs/pull/292043
2024-03-11 03:53:37 -07:00

157 lines
4.6 KiB
Nix

{ 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, perl, llvmPackages
}:
let
arch = "amd64";
libDir = "lib64";
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.libcxx
];
desktopItem = makeDesktopItem {
name = "teamspeak";
exec = "ts3client";
icon = "teamspeak";
comment = "The TeamSpeak voice communication tool";
desktopName = "TeamSpeak";
genericName = "TeamSpeak";
categories = [ "Network" ];
};
in
stdenv.mkDerivation rec {
pname = "teamspeak-client";
version = "3.6.2";
src = fetchurl {
url = "https://files.teamspeak-services.com/releases/client/${version}/TeamSpeak3-Client-linux_${arch}-${version}.run";
hash = "sha256-WfEQQ4lxoj+QSnAOfdCoEc+Z1Oa5dbo6pFli1DsAZCI=";
};
# 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
which
unzip
perl # Installer script needs `shasum`
];
# This just runs the installer script. If it 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.
unpackPhase =
''
echo -e '\ny' | PAGER=cat 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}" \
'' /* 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
'';
dontStrip = true;
dontPatchELF = true;
meta = with lib; {
description = "The TeamSpeak voice communication tool";
homepage = "https://teamspeak.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = {
fullName = "Teamspeak client license";
url = "https://www.teamspeak.com/en/privacy-and-terms/";
free = false;
};
maintainers = with maintainers; [ lhvwb lukegb atemu ];
mainProgram = "ts3client";
platforms = [ "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)
*/