2021-07-14 02:26:58 +01:00
|
|
|
{ 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
|
|
|
|
}:
|
2015-05-13 09:31:32 +01:00
|
|
|
|
2016-12-01 14:59:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "open-vm-tools";
|
2021-10-04 13:52:51 +01:00
|
|
|
version = "11.3.5";
|
2016-12-01 14:59:53 +00:00
|
|
|
|
2016-04-23 02:06:25 +01:00
|
|
|
src = fetchFromGitHub {
|
2017-08-15 10:24:41 +01:00
|
|
|
owner = "vmware";
|
|
|
|
repo = "open-vm-tools";
|
|
|
|
rev = "stable-${version}";
|
2021-10-04 13:52:51 +01:00
|
|
|
sha256 = "03fahljrijq4ij8a4v8d7806mpf22ppkgr61n5s974g3xfdvpl13";
|
2015-05-13 09:31:32 +01:00
|
|
|
};
|
|
|
|
|
2016-04-23 02:06:25 +01:00
|
|
|
sourceRoot = "${src.name}/open-vm-tools";
|
|
|
|
|
2016-12-01 14:59:53 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
|
2021-07-14 02:26:58 +01:00
|
|
|
buildInputs = [ fuse glib icu libdnet libdrm libmspack libtirpc openssl pam procps rpcsvc-proto udev xercesc ]
|
2020-06-16 17:15:59 +01:00
|
|
|
++ lib.optionals withX [ gdk-pixbuf-xlib gtk3 gtkmm3 libX11 libXext libXinerama libXi libXrender libXrandr libXtst ];
|
|
|
|
|
2016-04-23 02:06:25 +01:00
|
|
|
postPatch = ''
|
2019-12-11 14:45:44 +00:00
|
|
|
sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' Makefile.am
|
2015-05-13 09:31:32 +01:00
|
|
|
sed -i 's,^confdir = ,confdir = ''${prefix},' scripts/Makefile.am
|
2020-07-14 12:29:34 +01:00
|
|
|
sed -i 's,usr/bin,''${prefix}/usr/bin,' scripts/Makefile.am
|
2015-05-13 09:31:32 +01:00
|
|
|
sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' services/vmtoolsd/Makefile.am
|
2016-12-01 14:59:53 +00:00
|
|
|
sed -i 's,$(PAM_PREFIX),''${prefix}/$(PAM_PREFIX),' services/vmtoolsd/Makefile.am
|
2017-02-22 15:54:07 +00:00
|
|
|
|
|
|
|
# Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror.
|
|
|
|
sed 1i'#include <sys/sysmacros.h>' -i lib/wiper/wiperPosix.c
|
2017-10-23 12:59:37 +01:00
|
|
|
|
|
|
|
# Make reboot work, shutdown is not in /sbin on NixOS
|
|
|
|
sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c
|
2015-05-13 09:31:32 +01:00
|
|
|
'';
|
|
|
|
|
2021-07-14 02:26:58 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--without-kernel-modules"
|
|
|
|
"--without-xmlsecurity"
|
|
|
|
"--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d"
|
|
|
|
] ++ lib.optional (!withX) "--without-x";
|
2015-08-21 18:29:09 +01:00
|
|
|
|
2016-12-01 14:59:53 +00:00
|
|
|
enableParallelBuilding = true;
|
2015-05-13 09:31:32 +01:00
|
|
|
|
2019-10-30 11:34:47 +00:00
|
|
|
NIX_CFLAGS_COMPILE = builtins.toString [
|
2019-11-03 12:47:41 +00:00
|
|
|
# fix build with gcc9
|
|
|
|
"-Wno-error=address-of-packed-member"
|
|
|
|
"-Wno-error=format-overflow"
|
|
|
|
];
|
2019-10-24 14:45:45 +01:00
|
|
|
|
2021-07-14 02:26:58 +01:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir -p ${placeholder "out"}/lib/udev/rules.d
|
|
|
|
'';
|
|
|
|
|
2016-04-23 02:08:06 +01:00
|
|
|
postInstall = ''
|
2016-12-01 14:59:53 +00:00
|
|
|
wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \
|
2021-03-14 16:05:16 +00:00
|
|
|
--prefix PATH ':' "${lib.makeBinPath [ iproute2 dbus systemd which ]}"
|
2021-07-14 02:26:58 +01:00
|
|
|
substituteInPlace "$out/lib/udev/rules.d/99-vmware-scsi-udev.rules" --replace "/bin/sh" "${bash}/bin/sh"
|
2016-04-23 02:08:06 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/vmware/open-vm-tools";
|
2015-05-13 09:31:32 +01:00
|
|
|
description = "Set of tools for VMWare guests to improve host-guest interaction";
|
|
|
|
longDescription = ''
|
2017-08-15 10:24:41 +01:00
|
|
|
A set of services and modules that enable several features in VMware products for
|
|
|
|
better management of, and seamless user interactions with, guests.
|
2015-05-13 09:31:32 +01:00
|
|
|
'';
|
|
|
|
license = licenses.gpl2;
|
2021-07-12 02:19:08 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
2015-05-13 09:31:32 +01:00
|
|
|
maintainers = with maintainers; [ joamaki ];
|
|
|
|
};
|
|
|
|
}
|