avr: use new compilation infrastructure
Gets rid of: avrbinutils avrgcc to replace with: pkgsCross.avr.buildPackages.binutils pkgsCross.avr.buildPackages.gcc
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
{ stdenv, fetchurl }:
|
||||
|
||||
let
|
||||
version = "2.31.1";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "avr-binutils-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/binutils/binutils-${version}.tar.bz2";
|
||||
sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
|
||||
};
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
|
||||
index 838ebc2..3ac4ee7 100644
|
||||
--- a/gcc/gcc-ar.c
|
||||
+++ b/gcc/gcc-ar.c
|
||||
@@ -118,8 +118,8 @@ setup_prefixes (const char *exec_path)
|
||||
dir_separator, NULL);
|
||||
prefix_from_string (self_libexec_prefix, &target_path);
|
||||
|
||||
- /* Add path as a last resort. */
|
||||
- prefix_from_env ("PATH", &path);
|
||||
+ /* Add path to avrbinutils. */
|
||||
+ prefix_from_string ("@avrbinutils@/bin", &path);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1,60 +0,0 @@
|
||||
{ stdenv, fetchurl, gmp, mpfr, libmpc, zlib, avrbinutils, texinfo }:
|
||||
|
||||
let
|
||||
version = "8.2.0";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
|
||||
name = "avr-gcc-${version}";
|
||||
src = fetchurl {
|
||||
url = "mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
|
||||
sha256 = "10007smilswiiv2ymazr3b6x2i933c0ycxrr529zh4r6p823qv0r";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./avrbinutils-path.patch
|
||||
];
|
||||
|
||||
# avrbinutils-path.patch introduces a reference to @avrbinutils@, substitute
|
||||
# it now.
|
||||
postPatch = ''
|
||||
substituteInPlace gcc/gcc-ar.c --subst-var-by avrbinutils ${avrbinutils}
|
||||
'';
|
||||
|
||||
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 = with platforms; linux ++ darwin;
|
||||
maintainers = with maintainers; [ mguentner ];
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, avrgcc, avrbinutils, automake, autoconf }:
|
||||
{ stdenv, fetchurl, automake, autoconf }:
|
||||
|
||||
let
|
||||
version = "2.0.0";
|
||||
@@ -11,18 +11,7 @@ stdenv.mkDerivation {
|
||||
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
|
||||
'';
|
||||
nativeBuildInputs = [ automake autoconf ];
|
||||
|
||||
# Make sure we don't strip the libraries in lib/gcc/avr.
|
||||
stripDebugList= "bin";
|
||||
@@ -32,7 +21,7 @@ stdenv.mkDerivation {
|
||||
description = "a C runtime library for AVR microcontrollers";
|
||||
homepage = http://savannah.nongnu.org/projects/avr-libc/;
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.unix;
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ mguentner ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user