3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/fasm/default.nix

29 lines
633 B
Nix
Raw Normal View History

2018-11-15 13:20:00 +00:00
{ stdenv, lib, fasm-bin, isx86_64 }:
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
2018-11-15 13:20:00 +00:00
inherit (fasm-bin) version src meta;
pname = "fasm";
2018-11-15 13:20:00 +00:00
nativeBuildInputs = [ fasm-bin ];
buildPhase = ''
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
done
'';
outputs = [ "out" "doc" ];
installPhase = ''
install -Dt $out/bin fasm tools/libc/fasm-*
docs=$doc/share/doc/fasm
mkdir -p $docs
cp -r examples/ *.txt tools/fas.txt $docs
cp tools/readme.txt $docs/tools.txt
'';
}