linuxPackages_latest.prl-tools: 20.4.1-55996 -> 26.0.0-57238 (#438511)

authored by

Weijia Wang and committed by
GitHub
86120183 56e0275a

+30 -41
+1 -15
nixos/modules/virtualisation/parallels-guest.nix
··· 1 1 { 2 2 config, 3 3 lib, 4 - pkgs, 5 4 ... 6 5 }: 7 6 ··· 55 54 boot.extraModulePackages = [ prl-tools ]; 56 55 57 56 boot.kernelModules = [ 58 - "prl_fs" 59 - "prl_fs_freeze" 60 57 "prl_tg" 61 - ] 62 - ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "prl_notifier"; 58 + ]; 63 59 64 60 services.timesyncd.enable = false; 65 61 ··· 114 110 WorkingDirectory = "${prl-tools}/bin"; 115 111 }; 116 112 }; 117 - prlsga = { 118 - description = "Parallels Shared Guest Applications Tool"; 119 - wantedBy = [ "graphical-session.target" ]; 120 - path = [ prl-tools ]; 121 - serviceConfig = { 122 - ExecStart = "${prl-tools}/bin/prlsga"; 123 - WorkingDirectory = "${prl-tools}/bin"; 124 - }; 125 - }; 126 113 prlshprof = { 127 114 description = "Parallels Shared Profile Tool"; 128 115 wantedBy = [ "graphical-session.target" ]; ··· 133 120 }; 134 121 }; 135 122 }; 136 - 137 123 }; 138 124 }
-8
pkgs/os-specific/linux/prl-tools/autostart.desktop
··· 1 - [Desktop Entry] 2 - Version=@version@ 3 - Encoding=UTF-8 4 - Name=@description@ 5 - Type=Application 6 - Exec=@exec@ 7 - X-KDE-autostart-phase=1 8 - GenericName[en_US]=
+2 -4
pkgs/os-specific/linux/prl-tools/default.nix
··· 43 43 in 44 44 stdenv.mkDerivation (finalAttrs: { 45 45 pname = "prl-tools"; 46 - version = "20.4.1-55996"; 46 + version = "26.0.0-57238"; 47 47 48 48 # We download the full distribution to extract prl-tools-lin.iso from 49 49 # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso 50 50 src = fetchurl { 51 51 url = "https://download.parallels.com/desktop/v${lib.versions.major finalAttrs.version}/${finalAttrs.version}/ParallelsDesktop-${finalAttrs.version}.dmg"; 52 - hash = "sha256-CEyP8YZPLzjVAAjOaUqwQ4Ilzk9ybAtTTZUGZbSRrKQ="; 52 + hash = "sha256-UuQGW1qYLGVLqAzApPKBqfOZdS23mCPsID4D0HATHNw="; 53 53 }; 54 54 55 55 hardeningDisable = [ ··· 118 118 ( # kernel modules 119 119 cd kmods 120 120 mkdir -p $out/lib/modules/${kernelVersion}/extra 121 - cp prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.ko $out/lib/modules/${kernelVersion}/extra 122 121 cp prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko $out/lib/modules/${kernelVersion}/extra 123 - ${lib.optionalString stdenv.hostPlatform.isAarch64 "cp prl_notifier/Installation/lnx/prl_notifier/prl_notifier.ko $out/lib/modules/${kernelVersion}/extra"} 124 122 ) 125 123 126 124 ( # tools
+27 -14
pkgs/os-specific/linux/prl-tools/update.sh
··· 6 6 nixpkgs="$(git rev-parse --show-toplevel)" 7 7 path="$nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix" 8 8 9 - # Currently this script only supports Parallels 20 9 + # Currently this script only supports Parallels 26 10 10 # Please change the knowledge base url after each major release 11 - kb_url="https://kb.parallels.com/en/130212" 11 + kb_url="https://kb.parallels.com/en/131014" 12 12 content="$(curl -s "$kb_url")" 13 13 14 - # Parse HTML content and retrieve og:description for header metadata 15 - description=$(echo "$content" | xmllint --recover --html --xpath 'string(//meta[@property="og:description"]/@content)' - 2>/dev/null) 16 - regex='[^0-9]+([0-9]+\.[0-9]+\.[0-9]+)[^\(]+\(([0-9]+)\)' 17 - if [[ $description =~ $regex ]]; then 18 - version="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}" 19 - echo "Found latest version: $version" 20 - else 21 - echo "Failed to extract version from $kb_url" >&2 22 - echo "Retrived description: $description" >&2 23 - exit 1 14 + # Extract all version/build pairs and select the latest (by semver, then build) 15 + # Prefer the article content; fallback to whole body text 16 + article_text="$(echo "$content" | xmllint --recover --html --xpath 'string(//div[@id="article-content"])' - 2>/dev/null || true)" 17 + if [[ -z "${article_text:-}" ]]; then 18 + article_text="$(echo "$content" | xmllint --recover --html --xpath 'string(//body)' - 2>/dev/null || echo "$content")" 19 + fi 20 + 21 + # Find all "X.Y.Z (BUILD)" occurrences like "20.4.1 (55996)" 22 + mapfile -t candidates < <(echo "$article_text" \ 23 + | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\(([0-9]+)\)' \ 24 + | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)[[:space:]]*\(([0-9]+)\)/\1 \2/' \ 25 + | sort -u) 26 + 27 + if [[ ${#candidates[@]} -eq 0 ]]; then 28 + echo "Failed to extract any version from $kb_url" >&2 29 + exit 1 24 30 fi 25 31 32 + # Sort by version then build and pick the highest 33 + latest_pair="$(printf '%s\n' "${candidates[@]}" | sort -V -k1,1 -k2,2n | tail -n1)" 34 + latest_ver="$(awk '{print $1}' <<< "$latest_pair")" 35 + latest_build="$(awk '{print $2}' <<< "$latest_pair")" 36 + version="${latest_ver}-${latest_build}" 37 + echo "Found latest version: $version" 38 + 26 39 # Extract and compare current version 27 40 old_version="$(grep -o 'version = ".*"' "$path" | awk -F'"' '{print $2}')" 28 41 if [[ "$old_version" > "$version" || "$old_version" == "$version" ]]; then ··· 31 44 fi 32 45 33 46 # Update version and hash 34 - major_version=$(echo $version | cut -d. -f1) 47 + major_version="$(echo "$version" | cut -d. -f1)" 35 48 dmg_url="https://download.parallels.com/desktop/v${major_version}/${version}/ParallelsDesktop-${version}.dmg" 36 - sha256="$(nix store prefetch-file $dmg_url --json | jq -r '.hash')" 49 + sha256="$(nix store prefetch-file "$dmg_url" --json | jq -r '.hash')" 37 50 sed -i -e "s,version = \"$old_version\",version = \"$version\"," \ 38 51 -e "s,hash = \"sha256-.*\",hash = \"$sha256\"," "$path" 39 52