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 { 2 config, 3 lib, 4 - pkgs, 5 ... 6 }: 7 ··· 55 boot.extraModulePackages = [ prl-tools ]; 56 57 boot.kernelModules = [ 58 - "prl_fs" 59 - "prl_fs_freeze" 60 "prl_tg" 61 - ] 62 - ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "prl_notifier"; 63 64 services.timesyncd.enable = false; 65 ··· 114 WorkingDirectory = "${prl-tools}/bin"; 115 }; 116 }; 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 prlshprof = { 127 description = "Parallels Shared Profile Tool"; 128 wantedBy = [ "graphical-session.target" ]; ··· 133 }; 134 }; 135 }; 136 - 137 }; 138 }
··· 1 { 2 config, 3 lib, 4 ... 5 }: 6 ··· 54 boot.extraModulePackages = [ prl-tools ]; 55 56 boot.kernelModules = [ 57 "prl_tg" 58 + ]; 59 60 services.timesyncd.enable = false; 61 ··· 110 WorkingDirectory = "${prl-tools}/bin"; 111 }; 112 }; 113 prlshprof = { 114 description = "Parallels Shared Profile Tool"; 115 wantedBy = [ "graphical-session.target" ]; ··· 120 }; 121 }; 122 }; 123 }; 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 in 44 stdenv.mkDerivation (finalAttrs: { 45 pname = "prl-tools"; 46 - version = "20.4.1-55996"; 47 48 # We download the full distribution to extract prl-tools-lin.iso from 49 # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso 50 src = fetchurl { 51 url = "https://download.parallels.com/desktop/v${lib.versions.major finalAttrs.version}/${finalAttrs.version}/ParallelsDesktop-${finalAttrs.version}.dmg"; 52 - hash = "sha256-CEyP8YZPLzjVAAjOaUqwQ4Ilzk9ybAtTTZUGZbSRrKQ="; 53 }; 54 55 hardeningDisable = [ ··· 118 ( # kernel modules 119 cd kmods 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 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 ) 125 126 ( # tools
··· 43 in 44 stdenv.mkDerivation (finalAttrs: { 45 pname = "prl-tools"; 46 + version = "26.0.0-57238"; 47 48 # We download the full distribution to extract prl-tools-lin.iso from 49 # => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso 50 src = fetchurl { 51 url = "https://download.parallels.com/desktop/v${lib.versions.major finalAttrs.version}/${finalAttrs.version}/ParallelsDesktop-${finalAttrs.version}.dmg"; 52 + hash = "sha256-UuQGW1qYLGVLqAzApPKBqfOZdS23mCPsID4D0HATHNw="; 53 }; 54 55 hardeningDisable = [ ··· 118 ( # kernel modules 119 cd kmods 120 mkdir -p $out/lib/modules/${kernelVersion}/extra 121 cp prl_tg/Toolgate/Guest/Linux/prl_tg/prl_tg.ko $out/lib/modules/${kernelVersion}/extra 122 ) 123 124 ( # tools
+27 -14
pkgs/os-specific/linux/prl-tools/update.sh
··· 6 nixpkgs="$(git rev-parse --show-toplevel)" 7 path="$nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix" 8 9 - # Currently this script only supports Parallels 20 10 # Please change the knowledge base url after each major release 11 - kb_url="https://kb.parallels.com/en/130212" 12 content="$(curl -s "$kb_url")" 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 24 fi 25 26 # Extract and compare current version 27 old_version="$(grep -o 'version = ".*"' "$path" | awk -F'"' '{print $2}')" 28 if [[ "$old_version" > "$version" || "$old_version" == "$version" ]]; then ··· 31 fi 32 33 # Update version and hash 34 - major_version=$(echo $version | cut -d. -f1) 35 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')" 37 sed -i -e "s,version = \"$old_version\",version = \"$version\"," \ 38 -e "s,hash = \"sha256-.*\",hash = \"$sha256\"," "$path" 39
··· 6 nixpkgs="$(git rev-parse --show-toplevel)" 7 path="$nixpkgs/pkgs/os-specific/linux/prl-tools/default.nix" 8 9 + # Currently this script only supports Parallels 26 10 # Please change the knowledge base url after each major release 11 + kb_url="https://kb.parallels.com/en/131014" 12 content="$(curl -s "$kb_url")" 13 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 30 fi 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 + 39 # Extract and compare current version 40 old_version="$(grep -o 'version = ".*"' "$path" | awk -F'"' '{print $2}')" 41 if [[ "$old_version" > "$version" || "$old_version" == "$version" ]]; then ··· 44 fi 45 46 # Update version and hash 47 + major_version="$(echo "$version" | cut -d. -f1)" 48 dmg_url="https://download.parallels.com/desktop/v${major_version}/${version}/ParallelsDesktop-${version}.dmg" 49 + sha256="$(nix store prefetch-file "$dmg_url" --json | jq -r '.hash')" 50 sed -i -e "s,version = \"$old_version\",version = \"$version\"," \ 51 -e "s,hash = \"sha256-.*\",hash = \"$sha256\"," "$path" 52