2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook,
|
2020-10-27 00:29:36 +00:00
|
|
|
fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto,
|
2020-04-24 23:36:52 +00:00
|
|
|
libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst,
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute, dbus, systemd, which,
|
2020-04-24 23:36:52 +00:00
|
|
|
withX ? true }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "open-vm-tools";
|
2020-11-30 08:33:03 +00:00
|
|
|
version = "11.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vmware";
|
|
|
|
repo = "open-vm-tools";
|
|
|
|
rev = "stable-${version}";
|
2020-11-30 08:33:03 +00:00
|
|
|
sha256 = "125y3zdhj353dmmjmssdaib2zp1jg5aiqmvpgkrzhnh5nx2icfv6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "${src.name}/open-vm-tools";
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
|
2020-10-27 00:29:36 +00:00
|
|
|
buildInputs = [ fuse glib icu libdnet libmspack libtirpc openssl pam procps rpcsvc-proto xercesc ]
|
2020-06-15 15:56:04 +00:00
|
|
|
++ lib.optionals withX [ gdk-pixbuf-xlib gtk3 gtkmm3 libX11 libXext libXinerama libXi libXrender libXrandr libXtst ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
2020-07-18 16:06:22 +00:00
|
|
|
sed -i 's,usr/bin,''${prefix}/usr/bin,' scripts/Makefile.am
|
2020-04-24 23:36:52 +00:00
|
|
|
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 <sys/sysmacros.h>' -i lib/wiper/wiperPosix.c
|
|
|
|
|
|
|
|
# Make reboot work, shutdown is not in /sbin on NixOS
|
|
|
|
sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [ "--without-kernel-modules" "--without-xmlsecurity" ]
|
|
|
|
++ lib.optional (!withX) "--without-x";
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \
|
|
|
|
--prefix PATH ':' "${lib.makeBinPath [ iproute dbus systemd which ]}"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/vmware/open-vm-tools";
|
|
|
|
description = "Set of tools for VMWare guests to improve host-guest interaction";
|
|
|
|
longDescription = ''
|
|
|
|
A set of services and modules that enable several features in VMware products for
|
|
|
|
better management of, and seamless user interactions with, guests.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
maintainers = with maintainers; [ joamaki ];
|
|
|
|
};
|
|
|
|
}
|