2021-03-13 01:58:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2021-03-19 13:02:04 +00:00
|
|
|
, perl
|
2021-03-13 01:58:22 +00:00
|
|
|
}:
|
|
|
|
|
2023-04-21 14:34:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-03-13 01:58:22 +00:00
|
|
|
pname = "xa";
|
2023-02-21 12:15:55 +00:00
|
|
|
version = "2.3.14";
|
2021-03-13 01:58:22 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-19 13:02:04 +00:00
|
|
|
urls = [
|
2023-04-21 14:34:22 +00:00
|
|
|
"https://www.floodgap.com/retrotech/xa/dists/xa-${finalAttrs.version}.tar.gz"
|
|
|
|
"https://www.floodgap.com/retrotech/xa/dists/unsupported/xa-${finalAttrs.version}.tar.gz"
|
2021-03-19 13:02:04 +00:00
|
|
|
];
|
2023-02-21 12:15:55 +00:00
|
|
|
hash = "sha256-G5u6vdvY07lBC4UuUKEo7qQeaBM55vdsPoB2+lQg8C4=";
|
2021-03-13 01:58:22 +00:00
|
|
|
};
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ perl ];
|
2021-03-19 13:02:04 +00:00
|
|
|
|
2021-03-13 01:58:22 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-03-17 19:46:15 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc" \
|
2021-03-19 13:02:04 +00:00
|
|
|
--replace "LD = gcc" "LD = ${stdenv.cc.targetPrefix}cc" \
|
2021-03-13 01:58:22 +00:00
|
|
|
--replace "CFLAGS = -O2" "CFLAGS ?=" \
|
2021-03-17 19:46:15 +00:00
|
|
|
--replace "LDFLAGS = -lc" "LDFLAGS ?= -lc"
|
2021-03-13 01:58:22 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-19 13:02:04 +00:00
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR:=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
# Running tests in parallel does not work
|
|
|
|
enableParallelChecking = false;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
2021-03-13 01:58:22 +00:00
|
|
|
|
2023-02-21 12:15:55 +00:00
|
|
|
meta = {
|
2021-03-13 01:58:22 +00:00
|
|
|
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
|
|
|
|
'';
|
2023-02-21 12:15:55 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = with lib.platforms; unix;
|
2021-03-13 01:58:22 +00:00
|
|
|
};
|
2023-02-21 12:15:55 +00:00
|
|
|
})
|