nixpkgs/pkgs/by-name/av/avr-sim/package.nix
nicoo 2641d97cbf pkgs/by-name: Convert hashes to SRI format
Reproduction script:
	# Bulk rewrite
	./maintainers/scripts/sha-to-sri.py pkgs/by-name
	# Revert some packages which will need manual intervention
	for n in amdvlk azure-cli cargo-profiler corefonts flatito fluxcd gist perf_data_converter protoc-gen-js solana-cli swt verible; do
		git checkout -- "pkgs/by-name/${n:0:2}/${n}"
	done
2024-09-15 11:24:31 +02:00

62 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchzip,
lazarus,
fpc,
pango,
cairo,
glib,
atk,
gtk2,
libX11,
gdk-pixbuf,
}:
stdenv.mkDerivation rec {
pname = "avr-sim";
version = "2.8";
# Unfortunately old releases get removed:
# http://www.avr-asm-tutorial.net/avr_sim/avr_sim-download.html
# Therefore, fallback to an archive.org snapshot
src = fetchzip {
urls = [
"http://www.avr-asm-tutorial.net/avr_sim/28/avr_sim_28_lin_src.zip"
"https://web.archive.org/web/20231129125754/http://www.avr-asm-tutorial.net/avr_sim/28/avr_sim_28_lin_src.zip"
];
hash = "sha256-7MgUzMs+l+3RVUbORAWyU1OUpgrKIeWhS+ObgRJtOHc=";
};
nativeBuildInputs = [lazarus fpc];
buildInputs = [pango cairo glib atk gtk2 libX11 gdk-pixbuf];
NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
buildPhase = ''
runHook preBuild
lazbuild --lazarusdir=${lazarus}/share/lazarus --build-mode=Release avr_sim.lpi
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp avr_sim $out/bin
runHook postInstall
'';
meta = with lib; {
description = "AVR assembler simulator for the stepwise execution of assembler source code - with many extras";
homepage = "http://www.avr-asm-tutorial.net/avr_sim/index_en.html";
license = licenses.unfree;
platforms = platforms.unix;
maintainers = with maintainers; [ameer];
};
}