From 00434af50777422d9225f1eccbb33b1ff3dd82e5 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 19 Oct 2024 01:47:04 +0200 Subject: [PATCH] fasmg: add updateScript --- pkgs/development/compilers/fasmg/default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/development/compilers/fasmg/default.nix b/pkgs/development/compilers/fasmg/default.nix index e98715795458..918c434a3918 100644 --- a/pkgs/development/compilers/fasmg/default.nix +++ b/pkgs/development/compilers/fasmg/default.nix @@ -1,5 +1,13 @@ { lib, stdenv , fetchzip + +# update script +, writeScript +, coreutils +, curl +, gnugrep +, htmlq +, nix-update }: stdenv.mkDerivation rec { @@ -48,6 +56,18 @@ stdenv.mkDerivation rec { cp docs/*.txt $doc/share/doc/fasmg ''; + passthru.updateScript = writeScript "update-fasmg.sh" '' + export PATH="${lib.makeBinPath [ coreutils curl gnugrep htmlq nix-update ]}:$PATH" + version=$( + curl 'https://flatassembler.net/download.php' \ + | htmlq .links a.boldlink -a href \ + | grep -E '^fasmg\..*\.zip$' \ + | head -n1 \ + | cut -d. -f2 + ) + nix-update fasmg --version "$version" + ''; + meta = with lib; { description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF"; mainProgram = "fasmg";