nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchurl
4, perl
5}:
6
7stdenv.mkDerivation (finalAttrs: {
8 pname = "xa";
9 version = "2.3.14";
10
11 src = fetchurl {
12 urls = [
13 "https://www.floodgap.com/retrotech/xa/dists/xa-${finalAttrs.version}.tar.gz"
14 "https://www.floodgap.com/retrotech/xa/dists/unsupported/xa-${finalAttrs.version}.tar.gz"
15 ];
16 hash = "sha256-G5u6vdvY07lBC4UuUKEo7qQeaBM55vdsPoB2+lQg8C4=";
17 };
18
19 nativeCheckInputs = [ perl ];
20
21 dontConfigure = true;
22
23 postPatch = ''
24 substituteInPlace Makefile \
25 --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc" \
26 --replace "LD = gcc" "LD = ${stdenv.cc.targetPrefix}cc" \
27 --replace "CFLAGS = -O2" "CFLAGS ?=" \
28 --replace "LDFLAGS = -lc" "LDFLAGS ?= -lc"
29 '';
30
31 makeFlags = [
32 "DESTDIR:=${placeholder "out"}"
33 ];
34
35 enableParallelBuilding = true;
36
37 doCheck = true;
38
39 # Running tests in parallel does not work
40 enableParallelChecking = false;
41
42 preCheck = ''
43 patchShebangs tests
44 '';
45
46 meta = {
47 homepage = "https://www.floodgap.com/retrotech/xa/";
48 description = "Andre Fachat's open-source 6502 cross assembler";
49 longDescription = ''
50 xa is a high-speed, two-pass portable cross-assembler. It understands
51 mnemonics and generates code for NMOS 6502s (such as 6502A, 6504, 6507,
52 6510, 7501, 8500, 8501, 8502 ...), CMOS 6502s (65C02 and Rockwell R65C02)
53 and the 65816.
54
55 Key amongst its features:
56
57 - C-like preprocessor (and understands cpp for additional feature support)
58 - rich expression syntax and pseudo-op vocabulary
59 - multiple character sets
60 - binary linking
61 - supports o65 relocatable objects with a full linker and relocation
62 suite, as well as "bare" plain binary object files
63 - block structure for label scoping
64 '';
65 license = lib.licenses.gpl2Plus;
66 maintainers = with lib.maintainers; [ AndersonTorres ];
67 platforms = with lib.platforms; unix;
68 };
69})