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
commit 2d77958271
9 changed files with 132 additions and 85 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, unzip, mono, avrgcclibc, avrdude, gtk2, xdg_utils }:
{ stdenv, fetchurl, unzip, mono, avrbinutils, avrgcc, avrdude, gtk2, xdg_utils }:
stdenv.mkDerivation rec {
name = "avrdudess-2.2.20140102";
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [gtk2 mono]}"
# We need PATH from user env for xdg-open to find its tools, which
# typically depend on the currently running desktop environment.
export PATH="${stdenv.lib.makeBinPath [ avrgcclibc avrdude xdg_utils ]}:\$PATH"
export PATH="${stdenv.lib.makeBinPath [ avrgcc avrbinutils avrdude xdg_utils ]}:\$PATH"
# avrdudess must have its resource files in its current working directory
cd $out/avrdudess && exec ${mono}/bin/mono "$out/avrdudess/avrdudess.exe" "\$@"

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl, python2Packages, picocom
, avrdude, arduino-core, avrgcclibc }:
, avrdude, arduino-core }:
python2Packages.buildPythonApplication rec {
name = "ino-0.3.6";

View file

@ -1,4 +1,4 @@
{ stdenv, fetchzip, vim, avrdude, avrgcclibc, makeWrapper }:
{ stdenv, fetchzip, vim, avrdude, avrbinutils, avrgcc, avrlibc, makeWrapper }:
stdenv.mkDerivation rec {
name = "microscheme-${version}";
@ -10,13 +10,15 @@ stdenv.mkDerivation rec {
sha256 = "1r3ng4pw1s9yy1h5rafra1rq19d3vmb5pzbpcz1913wz22qdd976";
};
# Just a guess
propagatedBuildInputs = [ avrlibc ];
buildInputs = [ makeWrapper vim ];
installPhase = ''
make install PREFIX=$out
wrapProgram $out/bin/microscheme \
--prefix PATH : "${stdenv.lib.makeBinPath [ avrdude avrgcclibc ]}"
--prefix PATH : "${stdenv.lib.makeBinPath [ avrdude avrgcc avrbinutils ]}"
'';
meta = with stdenv.lib; {

View file

@ -1,76 +0,0 @@
{ stdenv, fetchurl, texinfo, gmp, mpfr, libmpc, zlib }:
stdenv.mkDerivation {
name = "avr-gcc-libc";
srcs = [
(fetchurl {
url = "mirror://gnu/binutils/binutils-2.26.tar.bz2";
sha256 = "1ngc2h3knhiw8s22l8y6afycfaxr5grviqy7mwvm4bsl14cf9b62";
})
(fetchurl {
url = "mirror://gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.bz2";
sha256 = "1ny4smkp5bzs3cp8ss7pl6lk8yss0d9m4av1mvdp72r1x695akxq";
})
(fetchurl {
url = http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2;
sha256 = "15svr2fx8j6prql2il2fc0ppwlv50rpmyckaxx38d3gxxv97zpdj";
})
];
sourceRoot = ".";
nativeBuildInputs = [ texinfo ];
buildInputs = [ gmp mpfr libmpc zlib ];
hardeningDisable = [ "format" ];
# Make sure we don't strip the libraries in lib/gcc/avr.
stripDebugList= [ "bin" "avr/bin" "libexec" ];
installPhase = ''
# important, without this gcc won't find the binutils executables
export PATH=$PATH:$out/bin
# Binutils.
pushd binutils-*/
mkdir obj-avr
cd obj-avr
../configure --target=avr --prefix="$out" --disable-nls --disable-debug --disable-dependency-tracking
make $MAKE_FLAGS
make install
popd
# GCC.
pushd gcc-*
mkdir obj-avr
cd obj-avr
../configure --target=avr --prefix="$out" --disable-nls --disable-libssp --with-dwarf2 --disable-install-libiberty --with-system-zlib --enable-languages=c,c++
make $MAKE_FLAGS
make install
popd
# We don't want avr-libc to use the native compiler.
export BUILD_CC=$CC
export BUILD_CXX=$CXX
unset CC
unset CXX
# AVR-libc.
pushd avr-libc-*
./configure --prefix="$out" --build=`./config.guess` --host=avr
make $MAKE_FLAGS
make install
popd
'';
meta = with stdenv.lib; {
description = "AVR development environment including binutils, avr-gcc and avr-libc";
# I've tried compiling the packages separately.. too much hassle. This just works. Fine.
license = ["GPL" "LGPL"]; # see single packages ..
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,22 @@
{ stdenv, fetchurl }:
let
version = "2.26";
in
stdenv.mkDerivation {
name = "avr-binutils-${version}";
src = fetchurl {
url = "mirror://gnu/binutils/binutils-${version}.tar.bz2";
sha256 = "1ngc2h3knhiw8s22l8y6afycfaxr5grviqy7mwvm4bsl14cf9b62";
};
configureFlags = "--target=avr --enable-languages=c,c++";
meta = with stdenv.lib; {
description = "the GNU Binutils for AVR microcontrollers";
homepage = http://www.gnu.org/software/binutils/;
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ mguentner ];
};
}

View file

@ -0,0 +1,50 @@
{ stdenv, fetchurl, gmp, mpfr, libmpc, zlib, avrbinutils, texinfo }:
let
version = "5.4.0";
in
stdenv.mkDerivation {
name = "avr-gcc-${version}";
src = fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.bz2";
sha256 = "0fihlcy5hnksdxk0sn6bvgnyq8gfrgs8m794b1jxwd1dxinzg3b0";
};
buildInputs = [ gmp mpfr libmpc zlib avrbinutils ];
nativeBuildInputs = [ texinfo ];
hardeningDisable = [ "format" ];
stripDebugList= [ "bin" "libexec" ];
enableParallelBuilding = true;
configurePhase = ''
mkdir gcc-build
cd gcc-build
../configure \
--prefix=$out \
--host=$CHOST \
--build=$CHOST \
--target=avr \
--with-as=${avrbinutils}/bin/avr-as \
--with-gnu-as \
--with-gnu-ld \
--with-ld=${avrbinutils}/bin/avr-ld \
--with-system-zlib \
--disable-install-libiberty \
--disable-nls \
--disable-libssp \
--with-dwarf2 \
--enable-languages=c,c++'';
meta = with stdenv.lib; {
description = "GNU Compiler Collection, version ${version} for AVR microcontrollers";
homepage = http://gcc.gnu.org;
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ mguentner ];
};
}

View file

@ -0,0 +1,38 @@
{ stdenv, fetchurl, avrgcc, avrbinutils, automake, autoconf }:
let
version = "2.0.0";
in
stdenv.mkDerivation {
name = "avr-libc-${version}";
src = fetchurl {
url = http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2;
sha256 = "15svr2fx8j6prql2il2fc0ppwlv50rpmyckaxx38d3gxxv97zpdj";
};
buildInputs = [ avrgcc avrbinutils automake autoconf ];
configurePhase = ''
unset LD
unset AS
unset AR
unset CC
unset CXX
unset RANLIB
unset STRIP
./configure --prefix=$out --build=$(./config.guess) --host=avr
'';
# Make sure we don't strip the libraries in lib/gcc/avr.
stripDebugList= "bin";
dontPatchELF = true;
meta = with stdenv.lib; {
description = "a C runtime library for AVR microcontrollers";
homepage = http://savannah.nongnu.org/projects/avr-libc/;
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = with maintainers; [ mguentner ];
};
}

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";

View file

@ -6633,7 +6633,13 @@ with pkgs;
samples = true;
};
avrgcclibc = callPackage ../development/misc/avr-gcc-with-avr-libc {};
avrgcclibc = throw "avrgcclibs are now separate packages, install avrbinutils, avrgcc and avrlibc";
avrbinutils = callPackage ../development/misc/avr/binutils {};
avrgcc = callPackage ../development/misc/avr/gcc {};
avrlibc = callPackage ../development/misc/avr/libc {};
avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };