summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2021-03-15 18:50:42 -0300
committerGitHub <noreply@github.com>2021-03-15 18:50:42 -0300
commit8989d8f457875bbf62c12cdbde8a8658c1e26a4b (patch)
treed5e3bea1cbfca0670bbf8179bb0d81ecbd51a610 /pkgs
parentf93ec2e50801b1b17f99a3aa7b41cf8bedee9dc9 (diff)
parent9ecaf3fd2ed75eca7ff1198afe2511b83d9c3305 (diff)
downloadnixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar.gz
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar.bz2
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar.lz
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar.xz
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.tar.zst
nixpkgs-8989d8f457875bbf62c12cdbde8a8658c1e26a4b.zip
Merge pull request #116137 from AndersonTorres/new-xa
XA assembler
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/xa/dxa.nix41
-rw-r--r--pkgs/development/compilers/xa/xa.nix52
-rw-r--r--pkgs/top-level/all-packages.nix3
3 files changed, 96 insertions, 0 deletions
diff --git a/pkgs/development/compilers/xa/dxa.nix b/pkgs/development/compilers/xa/dxa.nix
new file mode 100644
index 00000000000..e0ff060de8d
--- /dev/null
+++ b/pkgs/development/compilers/xa/dxa.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchurl
+, installShellFiles
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dxa";
+  version = "0.1.4";
+
+  src = fetchurl {
+    url = "https://www.floodgap.com/retrotech/xa/dists/${pname}-${version}.tar.gz";
+    hash = "sha256-C0rgwK51Ij9EZCm9GeiVnWIkEkse0d60ok8G9hm2a5U=";
+  };
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  dontConfigure = true;
+
+  postPatch = ''
+    substituteInPlace \
+      --replace "CC = gcc" "CC = cc' \
+        Makefile
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -d $out/bin/
+    install dxa $out/bin/
+    installManPage dxa.1
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.floodgap.com/retrotech/xa/";
+    description = "Andre Fachat's open-source 6502 disassembler";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/pkgs/development/compilers/xa/xa.nix b/pkgs/development/compilers/xa/xa.nix
new file mode 100644
index 00000000000..163b0bba513
--- /dev/null
+++ b/pkgs/development/compilers/xa/xa.nix
@@ -0,0 +1,52 @@
+{ 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 = ''
+    substitueInPlace \
+      --replace "DESTDIR" "PREFIX" \
+      --replace "CC = gcc" "CC = cc" \
+      --replace "LDD = gcc" "LDD = ld" \
+      --replace "CFLAGS = -O2" "CFLAGS ?=" \
+      --replace "LDFLAGS = -lc" "LDFLAGS ?= -lc" \
+      Makefile
+  '';
+
+  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;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3ed3f9ca33a..f74a8e392dd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26210,6 +26210,9 @@ in
     gtk = gtk2;
   };
 
+  xa = callPackage ../development/compilers/xa/xa.nix { };
+  dxa = callPackage ../development/compilers/xa/dxa.nix { };
+
   x11basic = callPackage ../development/compilers/x11basic {
     autoconf = buildPackages.autoconf269;
   };