open-vm-tools: fix dlopen path to libguestStoreClient.so.0, fix vm-support script (#429110)

authored by Sandro and committed by GitHub a3a81228 d8f5a498

+40 -15
+40 -15
pkgs/by-name/op/open-vm-tools/package.nix
··· 12 12 xercesc, 13 13 icu, 14 14 libdnet, 15 + pciutils, 15 16 procps, 16 17 libtirpc, 17 18 rpcsvc-proto, ··· 107 108 ]; 108 109 109 110 postPatch = '' 110 - sed -i Makefile.am \ 111 - -e 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' 112 - sed -i scripts/Makefile.am \ 113 - -e 's,^confdir = ,confdir = ''${prefix},' \ 114 - -e 's,usr/bin,''${prefix}/usr/bin,' 115 - sed -i services/vmtoolsd/Makefile.am \ 116 - -e 's,etc/vmware-tools,''${prefix}/etc/vmware-tools,' \ 117 - -e 's,$(PAM_PREFIX),''${prefix}/$(PAM_PREFIX),' 118 - sed -i vgauth/service/Makefile.am \ 119 - -e 's,/etc/vmware-tools/vgauth/schemas,''${prefix}/etc/vmware-tools/vgauth/schemas,' \ 120 - -e 's,$(DESTDIR)/etc/vmware-tools/vgauth.conf,''${prefix}/etc/vmware-tools/vgauth.conf,' 111 + substituteInPlace Makefile.am \ 112 + --replace-fail "etc/vmware-tools" "''${prefix}/etc/vmware-tools" 113 + substituteInPlace scripts/Makefile.am \ 114 + --replace-fail "confdir = /etc/vmware-tools" "confdir = ''${prefix}/etc/vmware-tools" \ 115 + --replace-fail "/usr/bin" "''${prefix}/bin" 116 + substituteInPlace services/vmtoolsd/Makefile.am \ 117 + --replace-fail "etc/vmware-tools" "''${prefix}/etc/vmware-tools" \ 118 + --replace-fail "\$(PAM_PREFIX)" "''${prefix}/\$(PAM_PREFIX)" 119 + substituteInPlace vgauth/service/Makefile.am \ 120 + --replace-fail "/etc/vmware-tools/vgauth/schemas" "''${prefix}/etc/vmware-tools/vgauth/schemas" \ 121 + --replace-fail "\$(DESTDIR)/etc/vmware-tools/vgauth.conf" "''${prefix}/etc/vmware-tools/vgauth.conf" 121 122 122 123 # don't abort on any warning 123 - sed -i 's,CFLAGS="$CFLAGS -Werror",,' configure.ac 124 + substituteInPlace configure.ac \ 125 + --replace-fail 'CFLAGS="$CFLAGS -Werror"' "" 124 126 125 127 # Make reboot work, shutdown is not in /sbin on NixOS 126 - sed -i 's,/sbin/shutdown,shutdown,' lib/system/systemLinux.c 128 + substituteInPlace lib/system/systemLinux.c \ 129 + --replace-fail "/sbin/shutdown" "shutdown" 127 130 128 131 # Fix paths to fuse3 (we do not use fuse2 so that is not modified) 129 - sed -i 's,/bin/fusermount3,${fuse3}/bin/fusermount3,' vmhgfs-fuse/config.c 132 + substituteInPlace vmhgfs-fuse/config.c \ 133 + --replace-fail "/bin/fusermount3" "${fuse3}/bin/fusermount3" 134 + 135 + # do not break the PATHs set by makeWrapper, sudo resets PATH anyway. 136 + substituteInPlace scripts/common/vm-support \ 137 + --replace-fail "export PATH=/bin:/sbin:/usr/bin:/usr/sbin" "" \ 138 + --replace-fail ". /etc/profile" ":" \ 139 + --replace-fail "/sbin/lsmod" "lsmod" 130 140 131 141 substituteInPlace services/plugins/vix/foundryToolsDaemon.c \ 132 142 --replace-fail "/usr/bin/vmhgfs-fuse" "${placeholder "out"}/bin/vmhgfs-fuse" \ 133 143 --replace-fail "/bin/mount" "${util-linux}/bin/mount" 144 + 145 + substituteInPlace lib/guestStoreClientHelper/guestStoreClient.c \ 146 + --replace-fail "libguestStoreClient.so.0" "$out/lib/libguestStoreClient.so.0" 147 + 148 + substituteInPlace udev/99-vmware-scsi-udev.rules \ 149 + --replace-fail "/bin/sh" "${bash}/bin/sh" 134 150 ''; 135 151 136 152 configureFlags = [ ··· 149 165 ''; 150 166 151 167 postInstall = '' 168 + wrapProgram "$out/bin/vm-support" \ 169 + --prefix PATH ':' "${ 170 + makeBinPath [ 171 + iproute2 172 + pciutils # for lspci 173 + systemd 174 + which 175 + ] 176 + }" 177 + 152 178 wrapProgram "$out/etc/vmware-tools/scripts/vmware/network" \ 153 179 --prefix PATH ':' "${ 154 180 makeBinPath [ ··· 158 184 which 159 185 ] 160 186 }" 161 - substituteInPlace "$out/lib/udev/rules.d/99-vmware-scsi-udev.rules" --replace-fail "/bin/sh" "${bash}/bin/sh" 162 187 ''; 163 188 164 189 meta = {