From af32e9affa26d9542464dd79de5338267a27add7 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sun, 13 Oct 2024 20:57:07 +0200 Subject: [PATCH] vmware-workstation: use system X11 libraries --- .../vmware-workstation/default.nix | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/virtualization/vmware-workstation/default.nix b/pkgs/applications/virtualization/vmware-workstation/default.nix index 976ab974ec589..4aad879e7da06 100644 --- a/pkgs/applications/virtualization/vmware-workstation/default.nix +++ b/pkgs/applications/virtualization/vmware-workstation/default.nix @@ -12,7 +12,6 @@ , readline70 , xz , cups -, glibc , libaio , vulkan-loader , alsa-lib @@ -20,8 +19,7 @@ , libxcrypt-legacy , libGL , numactl -, libX11 -, libXi +, xorg , kmod , python3 , autoPatchelfHook @@ -73,7 +71,6 @@ stdenv.mkDerivation rec { readline xz cups - glibc libaio vulkan-loader alsa-lib @@ -81,9 +78,21 @@ stdenv.mkDerivation rec { libxcrypt-legacy libGL numactl - libX11 - libXi - kmod + xorg.libX11 + xorg.libXau + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXdmcp + xorg.libXext + xorg.libXfixes + xorg.libXft + xorg.libXinerama + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst ]; nativeBuildInputs = [ python3 vmware-unpack-env autoPatchelfHook makeWrapper ] @@ -217,8 +226,8 @@ stdenv.mkDerivation rec { --add-needed ${libpulseaudio}/lib/libpulse.so.0 \ --add-needed ${libGL}/lib/libEGL.so.1 \ --add-needed ${numactl}/lib/libnuma.so.1 \ - --add-needed ${libX11}/lib/libX11.so.6 \ - --add-needed ${libXi}/lib/libXi.so.6 \ + --add-needed ${xorg.libX11}/lib/libX11.so.6 \ + --add-needed ${xorg.libXi}/lib/libXi.so.6 \ --add-needed ${libGL}/lib/libGL.so.1 \ $out/lib/vmware/bin/$binary done @@ -345,6 +354,14 @@ stdenv.mkDerivation rec { rm $out/lib/vmware/bin/vmware-vmx ln -s /run/wrappers/bin/vmware-vmx $out/lib/vmware/bin/vmware-vmx + # Remove shipped X11 libraries + for lib in $out/lib/vmware/lib/* $out/lib/vmware-ovftool/lib*.so*; do + lib_name="$(basename "$lib")" + if [[ "$lib_name" == libX* || "$lib_name" == libxcb* ]]; then + rm -rf "$lib" + fi + done + runHook postInstall '';