Merge pull request #29007 from mguentner/avrclean

avr-*: split avr-gcc-libc into separate packages
This commit is contained in:
Jörg Thalheim
2017-09-12 10:28:56 +01:00
committed by GitHub
9 changed files with 132 additions and 85 deletions

View File

@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, avrgcclibc, libelf, which, git, pkgconfig, freeglut
{ stdenv, fetchFromGitHub, avrbinutils, avrgcc, avrlibc, libelf, which, git, pkgconfig, freeglut
, mesa }:
stdenv.mkDerivation rec {
@@ -15,9 +15,14 @@ stdenv.mkDerivation rec {
# ld: cannot find -lsimavr
enableParallelBuilding = false;
buildFlags = "AVR_ROOT=${avrgcclibc}/avr SIMAVR_VERSION=${version}";
preConfigure = ''
substituteInPlace Makefile.common --replace "-I../simavr/sim/avr -I../../simavr/sim/avr" \
"-I${avrlibc}/avr/include -L${avrlibc}/avr/lib/avr5 -B${avrlibc}/avr/lib -I../simavr/sim/avr -I../../simavr/sim/avr"
'';
buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
installFlags = buildFlags + " DESTDIR=$(out)";
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
@@ -26,7 +31,7 @@ stdenv.mkDerivation rec {
patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
'';
buildInputs = [ which git avrgcclibc libelf pkgconfig freeglut mesa ];
buildInputs = [ which git avrbinutils avrgcc avrlibc libelf pkgconfig freeglut mesa ];
meta = with stdenv.lib; {
description = "A lean and mean Atmel AVR simulator";