2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, ncurses5
|
|
|
|
, python27
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gcc-arm-embedded";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "6.3.1";
|
|
|
|
release = "6-2017-q2-update";
|
2020-04-24 23:36:52 +00:00
|
|
|
subdir = "6-2017q2";
|
|
|
|
|
|
|
|
suffix = {
|
|
|
|
x86_64-darwin = "mac";
|
|
|
|
x86_64-linux = "linux";
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-14 22:03:04 +00:00
|
|
|
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${release}-${suffix}.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = {
|
|
|
|
x86_64-darwin = "0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x";
|
|
|
|
x86_64-linux = "1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6";
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
};
|
|
|
|
|
2020-12-29 15:07:52 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
|
|
|
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
find $out -type f | while read f; do
|
2020-12-29 15:07:52 +00:00
|
|
|
patchelf "$f" > /dev/null 2>&1 || continue
|
2020-04-24 23:36:52 +00:00
|
|
|
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
2021-02-05 17:12:51 +00:00
|
|
|
patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
|
|
|
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
|
|
|
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
};
|
|
|
|
}
|