Add gcc-arm-embedded.

These are packages for precompiled ARM microcontroller compilers from
https://launchpad.net/gcc-arm-embedded.

[Bjørn: modify commit message (add paragraph).]
This commit is contained in:
ambrop7@gmail.com 2014-03-29 11:00:26 +01:00 committed by Bjørn Forsman
parent ac68dc6dc6
commit 8b94e22f33
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,40 @@
{ stdenv, bzip2, patchelf, glibc, gcc, fetchurl, version, releaseType, sha256 }:
with stdenv.lib;
let
versionParts = splitString "-" version; # 4.7 2013q3 20130916
majorVersion = elemAt versionParts 0; # 4.7
yearQuarter = elemAt versionParts 1; # 2013q3
underscoreVersion = replaceChars ["."] ["_"] version; # 4_7-2013q3-20130916
yearQuarterParts = splitString "q" yearQuarter; # 2013 3
year = elemAt yearQuarterParts 0; # 2013
quarter = elemAt yearQuarterParts 1; # 3
subdirName = "${majorVersion}-${year}-q${quarter}-${releaseType}"; # 4.7-2013-q3-update
in
stdenv.mkDerivation {
name = "gcc-arm-embedded-${version}";
src = fetchurl {
url = "https://launchpad.net/gcc-arm-embedded/${majorVersion}/${subdirName}/+download/gcc-arm-none-eabi-${underscoreVersion}-linux.tar.bz2";
sha256 = sha256;
};
buildInputs = [ bzip2 patchelf ];
dontPatchELF = true;
phases = "unpackPhase patchPhase installPhase";
installPhase = ''
mkdir -pv $out
cp -r ./* $out
for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter ${glibc}/lib/ld-linux.so.2 \
--set-rpath $out/lib:${gcc}/lib \
"$f" || true
fi
done
'';
}

View File

@ -2722,6 +2722,18 @@ let
regexCompat HsSyck random; regexCompat HsSyck random;
}; };
gcc-arm-embedded-4_7 = callPackage_i686 ../development/compilers/gcc-arm-embedded {
version = "4.7-2013q3-20130916";
releaseType = "update";
sha256 = "1bd9bi9q80xn2rpy0rn1vvj70rh15kb7dmah0qs4q2rv78fqj40d";
};
gcc-arm-embedded-4_8 = callPackage_i686 ../development/compilers/gcc-arm-embedded {
version = "4.8-2014q1-20140314";
releaseType = "update";
sha256 = "ce92859550819d4a3d1a6e2672ea64882b30afa2c08cf67fa8e1d93788c2c577";
};
gcc-arm-embedded = gcc-arm-embedded-4_8;
# Haskell and GHC # Haskell and GHC
# Import Haskell infrastructure. # Import Haskell infrastructure.