about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/xa/xa.nix
blob: c445940f5cde10952c133dd0ed08ec0f886fcf22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, stdenv
, fetchurl
}:

stdenv.mkDerivation rec {
  pname = "xa";
  version = "2.3.11";

  src = fetchurl {
    url = "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz";
    hash = "sha256-MvIWTJnjBSGOmSlwhW3Y4jCbXLasR1jXsq/jv+vJAS0=";
  };

  dontConfigure = true;

  postPatch = ''
    substituteInPlace Makefile \
      --replace "DESTDIR" "PREFIX" \
      --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc" \
      --replace "LDD = gcc" "LDD = ${stdenv.cc.targetPrefix}cc" \
      --replace "CFLAGS = -O2" "CFLAGS ?=" \
      --replace "LDFLAGS = -lc" "LDFLAGS ?= -lc"
  '';

  makeFlags = [ "PREFIX=${placeholder "out"}" ];

  meta = with lib; {
    homepage = "https://www.floodgap.com/retrotech/xa/";
    description = "Andre Fachat's open-source 6502 cross assembler";
    longDescription = ''
      xa is a high-speed, two-pass portable cross-assembler. It understands
      mnemonics and generates code for NMOS 6502s (such as 6502A, 6504, 6507,
      6510, 7501, 8500, 8501, 8502 ...), CMOS 6502s (65C02 and Rockwell R65C02)
      and the 65816.

      Key amongst its features:

      - C-like preprocessor (and understands cpp for additional feature support)
      - rich expression syntax and pseudo-op vocabulary
      - multiple character sets
      - binary linking
      - supports o65 relocatable objects with a full linker and relocation
        suite, as well as "bare" plain binary object files
      - block structure for label scoping
    '';
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ AndersonTorres ];
    platforms = with platforms; unix;
  };
}