depot/third_party/nixpkgs/pkgs/by-name/re/renode-unstable/package.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

35 lines
1,002 B
Nix

{ renode
, fetchurl
, writeScript
}:
renode.overrideAttrs (finalAttrs: _: {
pname = "renode-unstable";
version = "1.15.3+20241004git4b8a8f170";
src = fetchurl {
url = "https://builds.renode.io/renode-${finalAttrs.version}.linux-dotnet.tar.gz";
hash = "sha256-/+fH5DHL/kg4IlJyOlCuOMsUocaBsA8GYvq5iP7Ip+4=";
};
passthru.updateScript =
let
versionRegex = "[0-9\.\+]+[^\+]*.";
in
writeScript "${finalAttrs.pname}-updater" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl gnugrep gnused pup
latestVersion=$(
curl -sS https://builds.renode.io \
| pup 'a text{}' \
| egrep 'renode-${versionRegex}\.linux-dotnet\.tar\.gz' \
| head -n1 \
| sed -e 's,renode-\(.*\)\.linux-dotnet\.tar\.gz,\1,g'
)
update-source-version ${finalAttrs.pname} "$latestVersion" \
--file=pkgs/by-name/re/${finalAttrs.pname}/package.nix \
--system=x86_64-linux
'';
})