linuxPackages_latest.prl-tools: 20.0.1-55659 -> 20.1.0-55732 (#347841)

This commit is contained in:
Weijia Wang 2024-10-11 09:26:36 +02:00 committed by GitHub
commit 0801558a65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View File

@ -37,13 +37,13 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "prl-tools";
version = "20.0.1-55659";
version = "20.1.0-55732";
# We download the full distribution to extract prl-tools-lin.iso from
# => ${dmg}/Parallels\ Desktop.app/Contents/Resources/Tools/prl-tools-lin.iso
src = fetchurl {
url = "https://download.parallels.com/desktop/v${lib.versions.major finalAttrs.version}/${finalAttrs.version}/ParallelsDesktop-${finalAttrs.version}.dmg";
hash = "sha256-5h8WZB7L6D9KOgIPSstN1sNcf3FZQiOQFB5MUC4YzvA=";
hash = "sha256-WKYsLcr7m6VAjYZu4BNxaarI7x/a7onlalQpV/Qws0w=";
};
hardeningDisable = [ "pic" "format" ];

14
pkgs/os-specific/linux/prl-tools/update.sh Normal file → Executable file
View File

@ -12,13 +12,12 @@ kb_url="https://kb.parallels.com/en/130212"
content="$(curl -s "$kb_url")"
# Match latest version from Parallels knowledge base
regex='<meta property="og:description" content="[^"]*Parallels Desktop ([0-9]+) for Mac ([0-9]+\.[0-9]+\.[0-9+]) \(([0-9]+)\)[^"]*" />'
regex='<meta property="og:description" content="[^"]*Parallels Desktop[\ 0-9]*for Mac ([0-9]+\.[0-9]+\.[0-9+]) \(([0-9]+)\)[^"]*" />'
if [[ $content =~ $regex ]]; then
major_version="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}-${BASH_REMATCH[3]}"
echo "Found latest version: $version, major version: $major_version"
version="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}"
echo "Found latest version: $version"
else
echo "Failed to extract version from $kb_url"
echo "Failed to extract version from $kb_url" >&2
exit 1
fi
@ -30,10 +29,11 @@ if [[ "$old_version" > "$version" || "$old_version" == "$version" ]]; then
fi
# Update version and hash
major_version=$(echo $version | cut -d. -f1)
dmg_url="https://download.parallels.com/desktop/v${major_version}/${version}/ParallelsDesktop-${version}.dmg"
sha256="$(nix store prefetch-file $dmg_url --json | jq -r '.hash')"
sed -i -e "s/version = \"$old_version\"/version = \"$version\"/" \
-e "s/hash = \"sha256-.*\"/hash = \"$sha256\"/" "$path"
sed -i -e "s,version = \"$old_version\",version = \"$version\"," \
-e "s,hash = \"sha256-.*\",hash = \"$sha256\"," "$path"
git commit -qm "linuxPackages_latest.prl-tools: $old_version -> $version" "$path"
echo "Updated linuxPackages_latest.prl-tools $old_version -> $version"