From 936f34d99c0fba24973aa63172b0669cd62aa75b Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 9 Jul 2021 16:21:51 -0400 Subject: [PATCH 1/5] open-vm-tools: 11.2.5 -> 11.3.0 Move to the latest version of open-vm-tools. This fixes automatic KMS. (cherry picked from commit 398cab1a2b7a957a5abc6a5f19089f09ae07df78) --- .../virtualization/open-vm-tools/default.nix | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index e7479957444..2a87b906788 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -1,18 +1,19 @@ { stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook, fetchpatch, - fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto, + bash, fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst, pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which, + linux-pam, libdrm, udev, withX ? true }: stdenv.mkDerivation rec { pname = "open-vm-tools"; - version = "11.2.5"; + version = "11.3.0"; src = fetchFromGitHub { owner = "vmware"; repo = "open-vm-tools"; rev = "stable-${version}"; - sha256 = "sha256-Jv+NSKw/+l+b4lfVGgCZFlcTScO/WAO/d7DtI0FAEV4="; + sha256 = "1yfffxc7drr1hyg28jcvly7jn1bm4ca76lmma5ykbmba2qqszx49"; }; sourceRoot = "${src.name}/open-vm-tools"; @@ -20,26 +21,10 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ]; - buildInputs = [ fuse glib icu libdnet libmspack libtirpc openssl pam procps rpcsvc-proto xercesc ] + buildInputs = [ fuse glib icu libdnet libdrm libmspack libtirpc openssl pam procps rpcsvc-proto udev xercesc ] ++ lib.optionals withX [ gdk-pixbuf-xlib gtk3 gtkmm3 libX11 libXext libXinerama libXi libXrender libXrandr libXtst ]; - patches = [ - # Fix building with glib 2.68. Remove after next release. - # We drop AUTHORS due to conflicts when applying. - # https://github.com/vmware/open-vm-tools/pull/505 - (fetchpatch { - url = "https://github.com/vmware/open-vm-tools/commit/82931a1bcb39d5132910c7fb2ddc086c51d06662.patch"; - stripLen = 1; - excludes = [ "AUTHORS" ]; - sha256 = "0yz5hnngr5vd4416hvmh8734a9vxa18d2xd37kl7if0p9vik6zlg"; - }) - ]; - postPatch = '' - # Build bugfix for 10.1.0, stolen from Arch PKGBUILD - mkdir -p common-agent/etc/config - sed -i 's|.*common-agent/etc/config/Makefile.*|\\|' configure.ac - sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' Makefile.am sed -i 's,^confdir = ,confdir = ''${prefix},' scripts/Makefile.am sed -i 's,usr/bin,''${prefix}/usr/bin,' scripts/Makefile.am @@ -60,10 +45,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; NIX_CFLAGS_COMPILE = builtins.toString [ - # igrone glib-2.62 deprecations - # Drop in next stable release. - "-DGLIB_DISABLE_DEPRECATION_WARNINGS" - # fix build with gcc9 "-Wno-error=address-of-packed-member" "-Wno-error=format-overflow" From 94f0dea33bb9f6c7d793b68051681cd127c0e6b3 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sun, 11 Jul 2021 18:42:02 -0400 Subject: [PATCH 2/5] open-vm-tools: Copy the udev files over correctly (cherry picked from commit 42ea61bc7dacc8360eb87152635f5f14f003c18d) --- nixos/modules/virtualisation/vmware-guest.nix | 2 ++ .../applications/virtualization/open-vm-tools/default.nix | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/virtualisation/vmware-guest.nix b/nixos/modules/virtualisation/vmware-guest.nix index 962a9059ea4..9465a8d6800 100644 --- a/nixos/modules/virtualisation/vmware-guest.nix +++ b/nixos/modules/virtualisation/vmware-guest.nix @@ -56,5 +56,7 @@ in ${open-vm-tools}/bin/vmware-user-suid-wrapper ''; }; + + services.udev.packages = [ open-vm-tools ]; }; } diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index 2a87b906788..4fa334da040 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -30,7 +30,6 @@ stdenv.mkDerivation rec { sed -i 's,usr/bin,''${prefix}/usr/bin,' scripts/Makefile.am sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' services/vmtoolsd/Makefile.am sed -i 's,$(PAM_PREFIX),''${prefix}/$(PAM_PREFIX),' services/vmtoolsd/Makefile.am - sed -i 's,$(UDEVRULESDIR),''${prefix}/$(UDEVRULESDIR),' udev/Makefile.am # Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror. sed 1i'#include ' -i lib/wiper/wiperPosix.c @@ -39,7 +38,7 @@ stdenv.mkDerivation rec { sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c ''; - configureFlags = [ "--without-kernel-modules" "--without-xmlsecurity" ] + configureFlags = [ "--without-kernel-modules" "--without-xmlsecurity" "--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d" ] ++ lib.optional (!withX) "--without-x"; enableParallelBuilding = true; @@ -50,9 +49,14 @@ stdenv.mkDerivation rec { "-Wno-error=format-overflow" ]; + preConfigure = '' + mkdir -p ${placeholder "out"}/lib/udev/rules.d + ''; + postInstall = '' wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \ --prefix PATH ':' "${lib.makeBinPath [ iproute2 dbus systemd which ]}" + substituteInPlace "$out/lib/udev/rules.d/99-vmware-scsi-udev.rules" --replace "/bin/sh" "${bash}/bin/sh" ''; meta = with lib; { From 22180dc1d0f90b90032bb03900b75a06e4bce359 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Mon, 12 Jul 2021 06:34:38 -0400 Subject: [PATCH 3/5] Update pkgs/applications/virtualization/open-vm-tools/default.nix Co-authored-by: Sandro (cherry picked from commit 808ee853e73efd91fcff13059ff9cc8777e85af9) --- pkgs/applications/virtualization/open-vm-tools/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index 4fa334da040..e57de946e11 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -38,8 +38,11 @@ stdenv.mkDerivation rec { sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c ''; - configureFlags = [ "--without-kernel-modules" "--without-xmlsecurity" "--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d" ] - ++ lib.optional (!withX) "--without-x"; + configureFlags = [ + "--without-kernel-modules" + "--without-xmlsecurity" + "--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d" + ] ++ lib.optional (!withX) "--without-x"; enableParallelBuilding = true; From 91fcbe8f4f14356ab889d826c955075bfb70b3d6 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Mon, 12 Jul 2021 06:40:10 -0400 Subject: [PATCH 4/5] Remove unused dependencies (cherry picked from commit 5f093827334ab825c8e9f9fc367ad20adbd7103a) --- pkgs/applications/virtualization/open-vm-tools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index e57de946e11..3c8c90a98a3 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -1,8 +1,8 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook, fetchpatch, +{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook, bash, fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst, pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which, - linux-pam, libdrm, udev, + libdrm, udev, withX ? true }: stdenv.mkDerivation rec { From ef3ff52c1eb3246d61dc7df8eceb42f29acd45e9 Mon Sep 17 00:00:00 2001 From: Sandro Date: Wed, 14 Jul 2021 02:14:35 +0200 Subject: [PATCH 5/5] Update pkgs/applications/virtualization/open-vm-tools/default.nix (cherry picked from commit c619e11879529877bd102b5f1eeff7e78daa4c87) --- .../virtualization/open-vm-tools/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix index 3c8c90a98a3..da0a07c60a5 100644 --- a/pkgs/applications/virtualization/open-vm-tools/default.nix +++ b/pkgs/applications/virtualization/open-vm-tools/default.nix @@ -1,9 +1,10 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook, - bash, fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto, - libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst, - pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which, - libdrm, udev, - withX ? true }: +{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook +, bash, fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto +, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst +, pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which +, libdrm, udev +, withX ? true +}: stdenv.mkDerivation rec { pname = "open-vm-tools";