open-vm-tools: 10.0.7 -> 10.1.0
Also add an option to disable all the X11 stuff.
This commit is contained in:
parent
182a369ab9
commit
a14ef4ad52
@ -4,12 +4,19 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.vmwareGuest;
|
cfg = config.services.vmwareGuest;
|
||||||
open-vm-tools = pkgs.open-vm-tools;
|
open-vm-tools = if cfg.headless then pkgs.open-vm-tools-headless else pkgs.open-vm-tools;
|
||||||
xf86inputvmmouse = pkgs.xorg.xf86inputvmmouse;
|
xf86inputvmmouse = pkgs.xorg.xf86inputvmmouse;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.vmwareGuest.enable = mkEnableOption "VMWare Guest Support";
|
services.vmwareGuest = {
|
||||||
|
enable = mkEnableOption "VMWare Guest Support";
|
||||||
|
headless = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to disable X11-related features.";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
@ -28,7 +35,7 @@ in
|
|||||||
|
|
||||||
environment.etc."vmware-tools".source = "${pkgs.open-vm-tools}/etc/vmware-tools/*";
|
environment.etc."vmware-tools".source = "${pkgs.open-vm-tools}/etc/vmware-tools/*";
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = mkIf (!cfg.headless) {
|
||||||
videoDrivers = mkOverride 50 [ "vmware" ];
|
videoDrivers = mkOverride 50 [ "vmware" ];
|
||||||
modules = [ xf86inputvmmouse ];
|
modules = [ xf86inputvmmouse ];
|
||||||
|
|
||||||
|
@ -1,42 +1,48 @@
|
|||||||
{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook,
|
{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook,
|
||||||
libmspack, openssl, pam, xercesc, icu, libdnet, procps,
|
fuse, libmspack, openssl, pam, xercesc, icu, libdnet, procps,
|
||||||
xlibsWrapper, libXinerama, libXi, libXrender, libXrandr, libXtst,
|
libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst,
|
||||||
pkgconfig, glib, gtk, gtkmm, iproute, dbus, systemd }:
|
pkgconfig, glib, gtk, gtkmm, iproute, dbus, systemd, which,
|
||||||
|
withX ? true }:
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
majorVersion = "10.0";
|
|
||||||
minorVersion = "7";
|
|
||||||
version = "${majorVersion}.${minorVersion}";
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
name = "open-vm-tools-${version}";
|
name = "open-vm-tools-${version}";
|
||||||
|
version = "10.1.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "vmware";
|
owner = "vmware";
|
||||||
repo = "open-vm-tools";
|
repo = "open-vm-tools";
|
||||||
rev = "stable-${version}";
|
rev = "stable-${version}";
|
||||||
sha256 = "0xxgppxjisg3jly21r7mjk06rc4n7ssyvapasxhbi2d1bw0xkvrj";
|
sha256 = "1qzk4mvw618ca4j9agsfpqch9jgwghvdc4rpkvlyz8kirvh9iniz";
|
||||||
};
|
};
|
||||||
|
|
||||||
sourceRoot = "${src.name}/open-vm-tools";
|
sourceRoot = "${src.name}/open-vm-tools";
|
||||||
|
|
||||||
buildInputs =
|
outputs = [ "out" "dev" ];
|
||||||
[ autoreconfHook makeWrapper libmspack openssl pam xercesc icu libdnet procps
|
|
||||||
pkgconfig glib gtk gtkmm xlibsWrapper libXinerama libXi libXrender libXrandr libXtst ];
|
|
||||||
|
|
||||||
postPatch = ''
|
nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig ];
|
||||||
sed -i s,-Werror,,g configure.ac
|
buildInputs = [ fuse glib icu libdnet libmspack openssl pam procps xercesc ]
|
||||||
sed -i 's,^confdir = ,confdir = ''${prefix},' scripts/Makefile.am
|
++ lib.optionals withX [ gtk gtkmm libX11 libXext libXinerama libXi libXrender libXrandr libXtst ];
|
||||||
sed -i 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' services/vmtoolsd/Makefile.am
|
|
||||||
'';
|
|
||||||
|
|
||||||
patches = [ ./recognize_nixos.patch ];
|
patches = [ ./recognize_nixos.patch ];
|
||||||
|
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
|
||||||
|
|
||||||
configureFlags = "--without-kernel-modules --without-xmlsecurity";
|
sed -i 's,^confdir = ,confdir = ''${prefix},' 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
|
||||||
|
'';
|
||||||
|
|
||||||
|
configureFlags = [ "--without-kernel-modules" "--without-xmlsecurity" ]
|
||||||
|
++ lib.optional (!withX) "--without-x";
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
sed -i 's,which ,command -v ,' "$out/etc/vmware-tools/scripts/vmware/network"
|
wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \
|
||||||
wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \
|
--prefix PATH ':' "${lib.makeBinPath [ iproute dbus systemd which ]}"
|
||||||
--prefix PATH ':' "${lib.makeBinPath [ iproute dbus systemd ]}"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -1,30 +1,20 @@
|
|||||||
diff -ruN open-vm-tools.orig/lib/include/guest_os.h open-vm-tools/lib/include/guest_os.h
|
diff --git a/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h
|
||||||
--- open-vm-tools.orig/lib/include/guest_os.h 2016-02-12 00:50:33.000000000 +0000
|
index ef202e3..c7a105d 100644
|
||||||
+++ open-vm-tools/lib/include/guest_os.h 2016-04-18 20:07:41.677251511 +0000
|
--- a/lib/include/guest_os.h
|
||||||
@@ -222,6 +222,7 @@
|
+++ b/lib/include/guest_os.h
|
||||||
|
@@ -238,6 +238,7 @@ Bool Gos_InSetArray(uint32 gos, const uint32 *set);
|
||||||
#define STR_OS_MANDRAKE_FULL "Mandrake Linux"
|
#define STR_OS_MANDRAKE_FULL "Mandrake Linux"
|
||||||
#define STR_OS_MANDRIVA "mandriva"
|
#define STR_OS_MANDRIVA "mandriva"
|
||||||
#define STR_OS_MKLINUX "MkLinux"
|
#define STR_OS_MKLINUX "MkLinux"
|
||||||
+#define STR_OS_NIXOS "NixOS"
|
+#define STR_OS_NIXOS "NixOS"
|
||||||
#define STR_OS_NOVELL "nld9"
|
#define STR_OS_NOVELL "nld9"
|
||||||
#define STR_OS_NOVELL_FULL "Novell Linux Desktop 9"
|
#define STR_OS_NOVELL_FULL "Novell Linux Desktop 9"
|
||||||
#define STR_OS_ORACLE "oraclelinux"
|
#define STR_OS_ORACLE6 "oraclelinux6"
|
||||||
diff -ruN open-vm-tools.orig/lib/include/vmblock.h open-vm-tools/lib/include/vmblock.h
|
diff --git a/lib/misc/hostinfoPosix.c b/open-vm-tools/lib/misc/hostinfoPosix.c
|
||||||
--- open-vm-tools.orig/lib/include/vmblock.h 2016-02-12 00:50:33.000000000 +0000
|
index 0f55070..2d8467c 100644
|
||||||
+++ open-vm-tools/lib/include/vmblock.h 2016-04-18 21:51:15.651235848 +0000
|
--- a/lib/misc/hostinfoPosix.c
|
||||||
@@ -145,7 +145,7 @@
|
+++ b/lib/misc/hostinfoPosix.c
|
||||||
# define VMBLOCK_DEVICE_MODE VMBLOCK_FUSE_DEVICE_MODE
|
@@ -195,6 +195,7 @@ static const DistroInfo distroArray[] = {
|
||||||
# define VMBLOCK_MOUNT_POINT VMBLOCK_FUSE_MOUNT_POINT
|
|
||||||
|
|
||||||
-#elif defined(linux)
|
|
||||||
+#elif defined(__linux__)
|
|
||||||
# define VMBLOCK_ADD_FILEBLOCK 98
|
|
||||||
# define VMBLOCK_DEL_FILEBLOCK 99
|
|
||||||
# ifdef VMX86_DEVEL
|
|
||||||
diff -ruN open-vm-tools.orig/lib/misc/hostinfoPosix.c open-vm-tools/lib/misc/hostinfoPosix.c
|
|
||||||
--- open-vm-tools.orig/lib/misc/hostinfoPosix.c 2016-02-12 00:50:33.000000000 +0000
|
|
||||||
+++ open-vm-tools/lib/misc/hostinfoPosix.c 2016-04-18 20:09:45.841668252 +0000
|
|
||||||
@@ -195,6 +195,7 @@
|
|
||||||
{"Mandrake", "/etc/mandrake-release"},
|
{"Mandrake", "/etc/mandrake-release"},
|
||||||
{"Mandriva", "/etc/mandriva-release"},
|
{"Mandriva", "/etc/mandriva-release"},
|
||||||
{"MkLinux", "/etc/mklinux-release"},
|
{"MkLinux", "/etc/mklinux-release"},
|
||||||
@ -32,12 +22,12 @@ diff -ruN open-vm-tools.orig/lib/misc/hostinfoPosix.c open-vm-tools/lib/misc/hos
|
|||||||
{"Novell", "/etc/nld-release"},
|
{"Novell", "/etc/nld-release"},
|
||||||
{"OracleLinux", "/etc/oracle-release"},
|
{"OracleLinux", "/etc/oracle-release"},
|
||||||
{"Photon", "/etc/lsb-release"},
|
{"Photon", "/etc/lsb-release"},
|
||||||
@@ -619,6 +620,8 @@
|
@@ -554,6 +555,8 @@ HostinfoGetOSShortName(char *distro, // IN: full distro name
|
||||||
Str_Strcpy(distroShort, STR_OS_MANDRIVA, distroShortSize);
|
}
|
||||||
} else if (strstr(distroLower, "mklinux")) {
|
} else if (strstr(distroLower, "mandrake")) {
|
||||||
Str_Strcpy(distroShort, STR_OS_MKLINUX, distroShortSize);
|
Str_Strcpy(distroShort, STR_OS_MANDRAKE, distroShortSize);
|
||||||
+ } else if (strstr(distroLower, "nixos")) {
|
+ } else if (strstr(distroLower, "nixos")) {
|
||||||
+ Str_Strcpy(distroShort, STR_OS_NIXOS, distroShortSize);
|
+ Str_Strcpy(distroShort, STR_OS_NIXOS, distroShortSize);
|
||||||
} else if (strstr(distroLower, "pld")) {
|
} else if (strstr(distroLower, "turbolinux")) {
|
||||||
Str_Strcpy(distroShort, STR_OS_PLD, distroShortSize);
|
Str_Strcpy(distroShort, STR_OS_TURBO, distroShortSize);
|
||||||
} else if (strstr(distroLower, "slackware")) {
|
} else if (strstr(distroLower, "sun")) {
|
||||||
|
@ -11606,6 +11606,7 @@ with pkgs;
|
|||||||
open-vm-tools = callPackage ../applications/virtualization/open-vm-tools {
|
open-vm-tools = callPackage ../applications/virtualization/open-vm-tools {
|
||||||
inherit (gnome2) gtk gtkmm;
|
inherit (gnome2) gtk gtkmm;
|
||||||
};
|
};
|
||||||
|
open-vm-tools-headless = open-vm-tools.override { withX = false; };
|
||||||
|
|
||||||
delve = callPackage ../development/tools/delve { };
|
delve = callPackage ../development/tools/delve { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user