diff --git a/pkgs/development/compilers/fasmg/default.nix b/pkgs/development/compilers/fasmg/default.nix new file mode 100644 index 000000000000..5233e248c074 --- /dev/null +++ b/pkgs/development/compilers/fasmg/default.nix @@ -0,0 +1,58 @@ +{ stdenv +, fetchzip +}: + +stdenv.mkDerivation rec { + pname = "fasmg"; + version = "j27m"; + + src = fetchzip { + url = "https://flatassembler.net/fasmg.${version}.zip"; + sha256 = "0qmklb24n3r0my2risid8r61pi88gqrvm1c0xvyd0bp1ans6d7zd"; + stripRoot = false; + }; + + buildPhase = let + inherit (stdenv.hostPlatform) system; + + path = { + x86_64-linux = { + bin = "fasmg.x64"; + asm = "source/linux/x64/fasmg.asm"; + }; + x86_64-darwin = { + bin = "source/macos/x64/fasmg"; + asm = "source/macos/x64/fasmg.asm"; + }; + x86-linux = { + bin = "fasmg"; + asm = "source/linux/fasmg.asm"; + }; + x86-darwin = { + bin = "source/macos/fasmg"; + asm = "source/macos/fasmg.asm"; + }; + }.${system} or (throw "Unsopported system: ${system}"); + + in '' + chmod +x ${path.bin} + ./${path.bin} ${path.asm} fasmg + ''; + + outputs = [ "out" "doc" ]; + + installPhase = '' + install -Dm755 fasmg $out/bin/fasmg + + mkdir -p $doc/share/doc/fasmg + cp docs/*.txt $doc/share/doc/fasmg + ''; + + meta = with stdenv.lib; { + description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF"; + homepage = "https://flatassembler.net"; + license = licenses.bsd3; + maintainers = with maintainers; [ orivej luc65r ]; + platforms = with platforms; intersectLists (linux ++ darwin) x86; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 11a8a1ccae33..4b3c546f8116 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8770,6 +8770,8 @@ in }; fasm-bin = callPackage ../development/compilers/fasm/bin.nix { }; + fasmg = callPackage ../development/compilers/fasmg { }; + flyctl = callPackage ../development/web/flyctl { }; flutterPackages =