[Backport release-25.05] arc-browser: use xmlstartlet for passthru.updateScript, 1.101.0-64746 -> 1.106.0-66192 (#430910)

This commit is contained in:
Peder Bergebakken Sundt
2025-08-04 15:03:18 +02:00
committed by GitHub

View File

@@ -6,15 +6,16 @@
writeShellApplication,
curl,
common-updater-scripts,
xmlstarlet,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "arc-browser";
version = "1.101.0-64746";
version = "1.106.0-66192";
src = fetchurl {
url = "https://releases.arc.net/release/Arc-${finalAttrs.version}.dmg";
hash = "sha256-u391hQB+Fqw21cu9GQglOkPHie+8uK8FTxSLWLAH0eA=";
hash = "sha256-AlM0wJ/2okrxw2ZpMPodlSVQaMMkBPf5iIN4bnMTaME=";
};
nativeBuildInputs = [ undmg ];
@@ -37,14 +38,16 @@ stdenvNoCC.mkDerivation (finalAttrs: {
runtimeInputs = [
curl
common-updater-scripts
xmlstarlet
];
text = ''
redirect_url="$(curl -s -L -f "https://releases.arc.net/release/Arc-latest.dmg" -o /dev/null -w '%{url_effective}')"
# The url scheme is: https://releases.arc.net/release/Arc-1.23.4-56789.dmg
# We strip everything before 'Arc-' and after '.dmg'
version="''${redirect_url##*/Arc-}"
version="''${version%.dmg}"
update-source-version arc-browser "$version" --file=./pkgs/by-name/ar/arc-browser/package.nix
latest_version_string="$(curl -s "https://releases.arc.net/updates.xml" | xmlstarlet sel -N sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" -t -v "//item[1]/sparkle:shortVersionString" -n)"
version_part="''${latest_version_string%% (*}"
build_part="''${latest_version_string##*\(}"
build_part="''${build_part%\)*}"
version="''${version_part}-''${build_part}"
update-source-version arc-browser "$version"
'';
});