about summary refs log tree commit diff
path: root/pkgs/development/compilers/gavrasm/default.nix
blob: d77ff0b8e6aa8fb874b19ef79222f8fbcccb9e14 (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
{ lib, stdenv, fetchzip, fpc , lang ? "en" } :

assert lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"];

stdenv.mkDerivation rec {
  pname = "gavrasm";
  version = "5.4";
  flatVersion = lib.strings.replaceStrings ["."] [""] version;

  src = fetchzip {
    url = "http://www.avr-asm-tutorial.net/gavrasm/v${flatVersion}/gavrasm_sources_lin_${flatVersion}.zip";
    sha256 = "sha256-uTalb8Wzn2RAoUKZx9RZFCX+V9HUEtUnJ4eSltFumh0=";
    stripRoot=false;
  };

  nativeBuildInputs = [ fpc ];

  configurePhase = ''
    runHook preConfigure
    cp gavrlang_${lang}.pas gavrlang.pas
    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild
    fpc gavrasm.pas
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp gavrasm $out/bin
    mkdir -p $out/doc
    cp instr.asm $out/doc
    cp ReadMe.Txt $out/doc
    cp LiesMich.Txt $out/doc
    runHook postInstall
  '';

  meta = with lib; {
    homepage = "http://www.avr-asm-tutorial.net/gavrasm/";
    description = "AVR Assembler for ATMEL AVR-Processors";
    license = licenses.unfree;
    maintainers = with maintainers; [ mafo ];
    platforms = platforms.linux;
  };
}