Skip to content

Commit 00434af

Browse files
committed
fasmg: add updateScript
1 parent 2c910a0 commit 00434af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pkgs/development/compilers/fasmg/default.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{ lib, stdenv
22
, fetchzip
3+
4+
# update script
5+
, writeScript
6+
, coreutils
7+
, curl
8+
, gnugrep
9+
, htmlq
10+
, nix-update
311
}:
412

513
stdenv.mkDerivation rec {
@@ -48,6 +56,18 @@ stdenv.mkDerivation rec {
4856
cp docs/*.txt $doc/share/doc/fasmg
4957
'';
5058

59+
passthru.updateScript = writeScript "update-fasmg.sh" ''
60+
export PATH="${lib.makeBinPath [ coreutils curl gnugrep htmlq nix-update ]}:$PATH"
61+
version=$(
62+
curl 'https://flatassembler.net/download.php' \
63+
| htmlq .links a.boldlink -a href \
64+
| grep -E '^fasmg\..*\.zip$' \
65+
| head -n1 \
66+
| cut -d. -f2
67+
)
68+
nix-update fasmg --version "$version"
69+
'';
70+
5171
meta = with lib; {
5272
description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF";
5373
mainProgram = "fasmg";

0 commit comments

Comments
 (0)