depot/third_party/nixpkgs/pkgs/by-name/re/renode-unstable/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

35 lines
1,008 B
Nix

{ renode
, fetchurl
, writeScript
}:
renode.overrideAttrs (finalAttrs: _: {
pname = "renode-unstable";
version = "1.15.1+20240615gitdd55f8ea4";
src = fetchurl {
url = "https://builds.renode.io/renode-${finalAttrs.version}.linux-portable.tar.gz";
hash = "sha256-CxV92sGxRlITi0jhi/O0J/FwLGyJVS7niIzlO3s3pis=";
};
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-portable\.tar\.gz' \
| head -n1 \
| sed -e 's,renode-\(.*\)\.linux-portable\.tar\.gz,\1,g'
)
update-source-version ${finalAttrs.pname} "$latestVersion" \
--file=pkgs/by-name/re/${finalAttrs.pname}/package.nix \
--system=x86_64-linux
'';
})