Skip to content

Commit 721cc4f

Browse files
authored
fasmg: add updateScript, kd3c -> kl0e (#349661)
2 parents 392a846 + 8639e25 commit 721cc4f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

pkgs/development/compilers/fasmg/default.nix

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
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 {
614
pname = "fasmg";
7-
version = "kd3c";
15+
version = "kl0e";
816

917
src = fetchzip {
1018
url = "https://flatassembler.net/fasmg.${version}.zip";
11-
sha256 = "sha256-duxune/UjXppKf/yWp7y85rpBn4EIC6JcZPNDhScsEA=";
19+
sha256 = "sha256-qUhsUMwxgUduGz+D8+Dm4EXyh7aiE9lJ1mhvTjHP6Tw=";
1220
stripRoot = false;
1321
};
1422

@@ -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)