lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

vmware-workstation: allow overriding, update meta attrs, refactor (#395985)

authored by

Felix Bargfeldt and committed by
GitHub
398c52b9 ea131632

+53 -60
+53 -60
pkgs/by-name/vm/vmware-workstation/package.nix
··· 33 33 unzip, 34 34 }: 35 35 36 - let 37 - # base - versions 36 + stdenv.mkDerivation (finalAttrs: { 37 + pname = "vmware-workstation"; 38 38 version = "17.6.3"; 39 39 build = "24583834"; 40 40 41 - # macOS - versions 42 - unlockerVersion = "3.0.5"; 43 - 44 - # macOS - Unlocker 45 - unlockerSrc = fetchFromGitHub { 46 - owner = "paolo-projects"; 47 - repo = "unlocker"; 48 - rev = "${unlockerVersion}"; 49 - sha256 = "sha256-JSEW1gqQuLGRkathlwZU/TnG6dL/xWKW4//SfE+kO0A="; 41 + src = requireFile { 42 + name = "VMware-Workstation-Full-${finalAttrs.version}-${finalAttrs.build}.x86_64.bundle"; 43 + url = "https://support.broadcom.com/group/ecx/productdownloads?subfamily=VMware%20Workstation%20Pro&freeDownloads=true"; 44 + hash = "sha256-eVdZF3KN7UxtC4n0q2qBvpp3PADuto0dEqwNsSVHjuA="; 50 45 }; 51 46 52 47 vmware-unpack-env = buildFHSEnv { 53 48 pname = "vmware-unpack-env"; 54 - inherit version; 49 + inherit (finalAttrs) version; 55 50 targetPkgs = pkgs: [ zlib ]; 56 51 }; 57 52 53 + unpackPhase = '' 54 + ${finalAttrs.vmware-unpack-env}/bin/vmware-unpack-env -c "sh ${finalAttrs.src} --extract unpacked" 55 + ''; 56 + 57 + macOSUnlockerSrc = fetchFromGitHub { 58 + owner = "paolo-projects"; 59 + repo = "unlocker"; 60 + tag = "3.0.5"; 61 + hash = "sha256-JSEW1gqQuLGRkathlwZU/TnG6dL/xWKW4//SfE+kO0A="; 62 + }; 63 + 64 + postPatch = lib.optionalString enableMacOSGuests '' 65 + cp -R "${finalAttrs.macOSUnlockerSrc}" unlocker/ 66 + 67 + substituteInPlace unlocker/unlocker.py --replace \ 68 + "/usr/lib/vmware/bin/" "$out/lib/vmware/bin" 69 + 70 + substituteInPlace unlocker/unlocker.py --replace \ 71 + "/usr/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so" "$out/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so" 72 + ''; 73 + 58 74 readline70_compat63 = symlinkJoin { 59 75 name = "readline70_compat63"; 60 76 paths = [ readline70 ]; ··· 62 78 ln -s $out/lib/libreadline.so $out/lib/libreadline.so.6 63 79 ''; 64 80 }; 65 - in 66 - stdenv.mkDerivation rec { 67 - pname = "vmware-workstation"; 68 - inherit version build; 81 + 82 + nativeBuildInputs = 83 + [ 84 + python3 85 + finalAttrs.vmware-unpack-env 86 + autoPatchelfHook 87 + makeWrapper 88 + ] 89 + ++ lib.optionals enableInstaller [ 90 + bzip2 91 + sqlite 92 + finalAttrs.readline70_compat63 93 + ] 94 + ++ lib.optionals enableMacOSGuests [ unzip ]; 69 95 70 96 buildInputs = [ 71 97 libxslt ··· 99 125 xorg.libXtst 100 126 ]; 101 127 102 - nativeBuildInputs = 103 - [ 104 - python3 105 - vmware-unpack-env 106 - autoPatchelfHook 107 - makeWrapper 108 - ] 109 - ++ lib.optionals enableInstaller [ 110 - bzip2 111 - sqlite 112 - readline70_compat63 113 - ] 114 - ++ lib.optionals enableMacOSGuests [ unzip ]; 115 - 116 - src = requireFile { 117 - name = "VMware-Workstation-Full-${version}-${build}.x86_64.bundle"; 118 - url = "https://support.broadcom.com/group/ecx/productdownloads?subfamily=VMware%20Workstation%20Pro&freeDownloads=true"; 119 - hash = "sha256-eVdZF3KN7UxtC4n0q2qBvpp3PADuto0dEqwNsSVHjuA="; 120 - }; 121 - 122 - unpackPhase = '' 123 - ${vmware-unpack-env}/bin/vmware-unpack-env -c "sh ${src} --extract unpacked" 124 - ''; 125 - 126 - postPatch = lib.optionalString enableMacOSGuests '' 127 - cp -R "${unlockerSrc}" unlocker/ 128 - 129 - substituteInPlace unlocker/unlocker.py --replace \ 130 - "/usr/lib/vmware/bin/" "$out/lib/vmware/bin" 131 - 132 - substituteInPlace unlocker/unlocker.py --replace \ 133 - "/usr/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so" "$out/lib/vmware/lib/libvmwarebase.so/libvmwarebase.so" 134 - ''; 135 - 136 128 installPhase = '' 137 129 runHook preInstall 138 130 ··· 167 159 cp ${./vmware-installer-bootstrap} $out/etc/vmware-installer/bootstrap 168 160 sed -i -e "s,@@INSTALLERDIR@@,$dest," $out/etc/vmware-installer/bootstrap 169 161 sed -i -e "s,@@IVERSION@@,$vmware_installer_version," $out/etc/vmware-installer/bootstrap 170 - sed -i -e "s,@@BUILD@@,${build}," $out/etc/vmware-installer/bootstrap 162 + sed -i -e "s,@@BUILD@@,${finalAttrs.build}," $out/etc/vmware-installer/bootstrap 171 163 172 164 # create database of vmware guest tools (avoids vmware fetching them later) 173 165 mkdir -p $out/etc/vmware-installer/components ··· 181 173 component_version=$(cat unpacked/$component/manifest.xml | grep -oPm1 "(?<=<version>)[^<]+") 182 174 component_core_id=$([ "$component" == "vmware-installer" ] && echo "-1" || echo "1") 183 175 type=$([ "$component" == "vmware-workstation" ] && echo "0" || echo "1") 184 - sqlite3 "$database_filename" "INSERT INTO components(name,version,buildNumber,component_core_id,longName,description,type) VALUES('$component','$component_version',${build},$component_core_id,'$component','$component',$type);" 176 + sqlite3 "$database_filename" "INSERT INTO components(name,version,buildNumber,component_core_id,longName,description,type) VALUES('$component','$component_version',${finalAttrs.build},$component_core_id,'$component','$component',$type);" 185 177 mkdir -p $out/etc/vmware-installer/components/$component 186 178 cp -r $folder/* $out/etc/vmware-installer/components/$component 187 179 done ··· 195 187 ## VMware Config 196 188 echo "Installing VMware Config" 197 189 cp ${./vmware-config} $out/etc/vmware/config 198 - sed -i -e "s,@@VERSION@@,${version}," $out/etc/vmware/config 199 - sed -i -e "s,@@BUILD@@,${build}," $out/etc/vmware/config 190 + sed -i -e "s,@@VERSION@@,${finalAttrs.version}," $out/etc/vmware/config 191 + sed -i -e "s,@@BUILD@@,${finalAttrs.build}," $out/etc/vmware/config 200 192 sed -i -e "s,@@PREFIXDIR@@,$out," $out/etc/vmware/config 201 193 202 194 ## VMware VMX ··· 378 370 runHook postInstall 379 371 ''; 380 372 381 - meta = with lib; { 373 + meta = { 382 374 description = "Industry standard desktop hypervisor for x86-64 architecture"; 383 - homepage = "https://www.vmware.com/products/workstation-pro.html"; 384 - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 385 - license = licenses.unfree; 375 + homepage = "https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion"; 376 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 377 + license = lib.licenses.unfree; 386 378 platforms = [ "x86_64-linux" ]; 387 - maintainers = with maintainers; [ 379 + mainProgram = "vmware"; 380 + maintainers = with lib.maintainers; [ 388 381 cawilliamson 389 382 deinferno 390 383 vifino 391 384 ]; 392 385 }; 393 - } 386 + })