about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/xa/dxa.nix
blob: 03f2d054cc8071ded147ab80801a052f024a2567 (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
{ 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 Makefile \
      --replace "CC = gcc" "CC = ${stdenv.cc.targetPrefix}cc"
  '';

  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;
  };
}