diff options
-rw-r--r-- | pkgs/by-name/re/renode-unstable/package.nix | 27 | ||||
-rw-r--r-- | pkgs/by-name/re/renode/package.nix | 27 |
2 files changed, 25 insertions, 29 deletions
diff --git a/pkgs/by-name/re/renode-unstable/package.nix b/pkgs/by-name/re/renode-unstable/package.nix index 72fc558396ed2..309188adfe49e 100644 --- a/pkgs/by-name/re/renode-unstable/package.nix +++ b/pkgs/by-name/re/renode-unstable/package.nix @@ -1,11 +1,9 @@ { renode , fetchurl -, buildUnstable ? true +, writeScript }: -(renode.override { - inherit buildUnstable; -}).overrideAttrs (finalAttrs: _: { +renode.overrideAttrs (finalAttrs: _: { pname = "renode-unstable"; version = "1.15.0+20240323git3bd8e280d"; @@ -13,4 +11,25 @@ url = "https://builds.renode.io/renode-${finalAttrs.version}.linux-portable.tar.gz"; hash = "sha256-hIPBM9PE6vtqo8XJvOWS3mIa9Vr7v9bcMdXmeQzBYsk="; }; + + 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 + ''; }) diff --git a/pkgs/by-name/re/renode/package.nix b/pkgs/by-name/re/renode/package.nix index 7ea55e0fff987..ab0df9f5c3e10 100644 --- a/pkgs/by-name/re/renode/package.nix +++ b/pkgs/by-name/re/renode/package.nix @@ -3,13 +3,12 @@ , fetchurl , autoPatchelfHook , makeWrapper -, writeScript +, nix-update-script , glibcLocales , python3Packages , gtk-sharp-2_0 , gtk2-x11 , screen -, buildUnstable ? false }: let @@ -69,29 +68,7 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.updateScript = - let - versionRegex = - if buildUnstable - then "[0-9\.\+]+[^\+]*." - else "[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 - ''; + passthru.updateScript = nix-update-script { }; meta = { description = "Virtual development framework for complex embedded systems"; |