nixpkgs/pkgs/development/tools/simavr/default.nix
Matthew Bauer aa4707fc34 treewide: use gnu toolchain for avr/arm-embedded
These packages should in theory work with our GCC toolchains, but
there are some definite breakages that need to be tracked down.
Comparing output of these to old gcc-arm-embedded is important.

Affected packages include:

- axolooti
- avrdudess
- opentx
- microscheme
- betaflight
- inav
- blackmagic
- simavr
- gnuk
2018-10-30 13:31:45 -05:00

42 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitHub, libelf, which, git, pkgconfig, freeglut
, avrbinutils, avrgcc, avrlibc
, libGLU_combined }:
stdenv.mkDerivation rec {
name = "simavr-${version}";
version = "1.5";
src = fetchFromGitHub {
owner = "buserror";
repo = "simavr";
rev = "e0d4de41a72520491a4076b3ed87beb997a395c0";
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
};
# ld: cannot find -lsimavr
enableParallelBuilding = false;
buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
installFlags = buildFlags + " DESTDIR=$(out)";
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
postFixup = ''
target="$out/bin/simavr"
patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
'';
nativeBuildInputs = [ which git pkgconfig avrgcc avrbinutils ];
buildInputs = [ libelf freeglut libGLU_combined ];
meta = with stdenv.lib; {
description = "A lean and mean Atmel AVR simulator";
homepage = https://github.com/buserror/simavr;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ goodrone ];
};
}