Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / compilers / fasm / default.nix
blobf17d18bf92a62396c4fc5b4f5ffae766737dd24c
1 { stdenv, lib, fasm-bin, isx86_64 }:
3 stdenv.mkDerivation {
4   inherit (fasm-bin) version src meta;
6   pname = "fasm";
8   nativeBuildInputs = [ fasm-bin ];
10   buildPhase = ''
11     fasm source/Linux${lib.optionalString isx86_64 "/x64"}/fasm.asm fasm
12     for tool in listing prepsrc symbols; do
13       fasm tools/libc/$tool.asm
14       cc -o tools/libc/fasm-$tool tools/libc/$tool.o
15     done
16   '';
18   outputs = [ "out" "doc" ];
20   installPhase = ''
21     install -Dt $out/bin fasm tools/libc/fasm-*
23     docs=$doc/share/doc/fasm
24     mkdir -p $docs
25     cp -r examples/ *.txt tools/fas.txt $docs
26     cp tools/readme.txt $docs/tools.txt
27   '';