Unverified Commit 75990ab5 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

fasm: 1.73.74 -> 1.73.75 (#496782)

parents f547a4d9 59cc4d3b
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -2,15 +2,18 @@
  stdenvNoCC,
  lib,
  fetchurl,
  writeShellScript,
  curl,
  nix-update,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "fasm-bin";
  version = "1.73.34";
  version = "1.73.35";

  src = fetchurl {
    url = "https://flatassembler.net/fasm-${finalAttrs.version}.tgz";
    hash = "sha256-CAlGTsfvpDRWsHh9UysgBorjX+mygEWjFeRaznyDszw=";
    hash = "sha256-o03sfQvC3Hn6q7aL2LwvYrbPsx1pwBRJNnzkzYCYk04=";
  };

  installPhase = ''
@@ -21,6 +24,25 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    runHook postInstall
  '';

  passthru.updateScript = writeShellScript "update-fasm" ''
    set -euo pipefail

    version=""
    while IFS= read -r line; do
      if [[ "$line" =~ fasm-([0-9]+\.[0-9]+\.[0-9]+)\.tgz ]]; then
        version="''${BASH_REMATCH[1]}"
        break
      fi
    done < <(${lib.getExe curl} -fsSL https://flatassembler.net/download.php)

    if [[ -z "$version" ]]; then
      echo "Could not determine latest fasm version" >&2
      exit 1
    fi

    ${lib.getExe nix-update} fasm-bin --version "$version"
  '';

  meta = {
    description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF";
    homepage = "https://flatassembler.net/";
+3 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
  nativeBuildInputs = [ fasm-bin ];

  buildPhase = ''
    fasm source/Linux${lib.optionalString isx86_64 "/x64"}/fasm.asm fasm
    fasm source/linux${lib.optionalString isx86_64 "/x64"}/fasm.asm fasm
    for tool in listing prepsrc symbols; do
      fasm tools/libc/$tool.asm
      cc -o tools/libc/fasm-$tool tools/libc/$tool.o
@@ -33,4 +33,6 @@ stdenv.mkDerivation {
    cp -r examples/ *.txt tools/fas.txt $docs
    cp tools/readme.txt $docs/tools.txt
  '';

  passthru.updateScript = fasm-bin.updateScript;
}