ieda: init at 0-unstable-2024-10-11 (#338769)
[NixPkgs.git] / pkgs / by-name / av / avr-sim / package.nix
blob9a4ad182a95fe30c8cad4bfc97b45aceae48579c
2   lib,
3   stdenv,
4   fetchzip,
5   lazarus,
6   fpc,
7   pango,
8   cairo,
9   glib,
10   atk,
11   gtk2,
12   libX11,
13   gdk-pixbuf,
15 stdenv.mkDerivation rec {
16   pname = "avr-sim";
17   version = "2.8";
19   # Unfortunately old releases get removed:
20   # http://www.avr-asm-tutorial.net/avr_sim/avr_sim-download.html
21   # Therefore, fallback to an archive.org snapshot
22   src = fetchzip {
23     urls = [
24       "http://www.avr-asm-tutorial.net/avr_sim/28/avr_sim_28_lin_src.zip"
25       "https://web.archive.org/web/20231129125754/http://www.avr-asm-tutorial.net/avr_sim/28/avr_sim_28_lin_src.zip"
26     ];
27     hash = "sha256-7MgUzMs+l+3RVUbORAWyU1OUpgrKIeWhS+ObgRJtOHc=";
28   };
30   nativeBuildInputs = [
31     lazarus
32     fpc
33   ];
35   buildInputs = [
36     pango
37     cairo
38     glib
39     atk
40     gtk2
41     libX11
42     gdk-pixbuf
43   ];
45   NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
47   buildPhase = ''
48     runHook preBuild
50     lazbuild --lazarusdir=${lazarus}/share/lazarus --build-mode=Release avr_sim.lpi
52     runHook postBuild
53   '';
55   installPhase = ''
56     runHook preInstall
58     mkdir -p $out/bin
60     cp avr_sim $out/bin
62     runHook postInstall
63   '';
65   meta = with lib; {
66     description = "AVR assembler simulator for the stepwise execution of assembler source code - with many extras";
67     homepage = "http://www.avr-asm-tutorial.net/avr_sim/index_en.html";
68     license = licenses.unfree;
69     platforms = platforms.unix;
70     maintainers = with maintainers; [ ameer ];
71   };