2022-11-21 17:40:18 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, autoreconfHook
|
|
|
|
, bash
|
|
|
|
, fuse3
|
|
|
|
, libmspack
|
|
|
|
, openssl
|
|
|
|
, pam
|
|
|
|
, xercesc
|
|
|
|
, icu
|
|
|
|
, libdnet
|
|
|
|
, procps
|
|
|
|
, libtirpc
|
|
|
|
, rpcsvc-proto
|
|
|
|
, libX11
|
|
|
|
, libXext
|
|
|
|
, libXinerama
|
|
|
|
, libXi
|
|
|
|
, libXrender
|
|
|
|
, libXrandr
|
|
|
|
, libXtst
|
|
|
|
, libxcrypt
|
|
|
|
, libxml2
|
|
|
|
, pkg-config
|
|
|
|
, glib
|
|
|
|
, gdk-pixbuf-xlib
|
|
|
|
, gtk3
|
|
|
|
, gtkmm3
|
|
|
|
, iproute2
|
|
|
|
, dbus
|
|
|
|
, systemd
|
|
|
|
, which
|
|
|
|
, libdrm
|
|
|
|
, udev
|
|
|
|
, util-linux
|
|
|
|
, xmlsec
|
2021-07-14 22:03:04 +00:00
|
|
|
, withX ? true
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "open-vm-tools";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "12.3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-11-21 17:40:18 +00:00
|
|
|
owner = "vmware";
|
|
|
|
repo = "open-vm-tools";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "stable-${finalAttrs.version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-OuESPenXVDKLckIZ3sQCtQXZXCL6xSLZOxZWVEX2XMk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/open-vm-tools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
fuse3
|
|
|
|
glib
|
|
|
|
icu
|
|
|
|
libdnet
|
|
|
|
libdrm
|
|
|
|
libmspack
|
|
|
|
libtirpc
|
|
|
|
libxcrypt
|
|
|
|
libxml2
|
|
|
|
openssl
|
|
|
|
pam
|
|
|
|
procps
|
|
|
|
rpcsvc-proto
|
|
|
|
udev
|
|
|
|
xercesc
|
|
|
|
xmlsec
|
|
|
|
] ++ lib.optionals withX [
|
|
|
|
gdk-pixbuf-xlib
|
|
|
|
gtk3
|
|
|
|
gtkmm3
|
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXinerama
|
|
|
|
libXi
|
|
|
|
libXrender
|
|
|
|
libXrandr
|
|
|
|
libXtst
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i Makefile.am \
|
|
|
|
-e 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,'
|
|
|
|
sed -i scripts/Makefile.am \
|
|
|
|
-e 's,^confdir = ,confdir = ''${prefix},' \
|
|
|
|
-e 's,usr/bin,''${prefix}/usr/bin,'
|
|
|
|
sed -i services/vmtoolsd/Makefile.am \
|
|
|
|
-e 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' \
|
|
|
|
-e 's,$(PAM_PREFIX),''${prefix}/$(PAM_PREFIX),'
|
|
|
|
sed -i vgauth/service/Makefile.am \
|
|
|
|
-e 's,/etc/vmware-tools/vgauth/schemas,''${prefix}/etc/vmware-tools/vgauth/schemas,' \
|
|
|
|
-e 's,$(DESTDIR)/etc/vmware-tools/vgauth.conf,''${prefix}/etc/vmware-tools/vgauth.conf,'
|
|
|
|
|
|
|
|
# don't abort on any warning
|
|
|
|
sed -i 's,CFLAGS="$CFLAGS -Werror",,' configure.ac
|
|
|
|
|
|
|
|
# Make reboot work, shutdown is not in /sbin on NixOS
|
|
|
|
sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c
|
|
|
|
|
|
|
|
# Fix paths to fuse3 (we do not use fuse2 so that is not modified)
|
|
|
|
sed -i 's,/bin/fusermount3,${fuse3}/bin/fusermount3,' vmhgfs-fuse/config.c
|
|
|
|
|
|
|
|
substituteInPlace services/plugins/vix/foundryToolsDaemon.c \
|
|
|
|
--replace "/usr/bin/vmhgfs-fuse" "${placeholder "out"}/bin/vmhgfs-fuse" \
|
|
|
|
--replace "/bin/mount" "${util-linux}/bin/mount"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--without-kernel-modules"
|
|
|
|
"--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d"
|
2022-03-30 09:31:56 +00:00
|
|
|
"--with-fuse=fuse3"
|
2021-07-14 22:03:04 +00:00
|
|
|
] ++ lib.optional (!withX) "--without-x";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
preConfigure = ''
|
|
|
|
mkdir -p ${placeholder "out"}/lib/udev/rules.d
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \
|
2021-04-05 15:23:46 +00:00
|
|
|
--prefix PATH ':' "${lib.makeBinPath [ iproute2 dbus systemd which ]}"
|
2021-07-14 22:03:04 +00:00
|
|
|
substituteInPlace "$out/lib/udev/rules.d/99-vmware-scsi-udev.rules" --replace "/bin/sh" "${bash}/bin/sh"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/vmware/open-vm-tools/releases/tag/stable-${finalAttrs.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
2022-11-21 17:40:18 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ joamaki kjeremy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|