2021-08-10 15:14:58 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-12-01 18:42:16 +01:00
|
|
|
, fetchurl
|
|
|
|
, ncurses5
|
|
|
|
, python27
|
|
|
|
}:
|
2019-01-10 12:30:42 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gcc-arm-embedded";
|
2021-07-12 13:11:14 +02:00
|
|
|
version = "8.3.1";
|
|
|
|
release = "8-2019-q3-update";
|
2019-08-27 20:03:38 +02:00
|
|
|
subdir = "8-2019q3/RC1.1";
|
2019-01-10 12:30:42 +01:00
|
|
|
|
2019-12-01 18:42:16 +01:00
|
|
|
suffix = {
|
2021-12-05 23:35:52 +01:00
|
|
|
aarch64-darwin = "mac"; # use intel binaries via rosetta
|
2019-12-01 18:42:16 +01:00
|
|
|
x86_64-darwin = "mac";
|
|
|
|
x86_64-linux = "linux";
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-12 13:11:14 +02:00
|
|
|
url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${release}-${suffix}.tar.bz2";
|
2019-12-01 18:42:16 +01:00
|
|
|
sha256 = {
|
2021-12-05 23:35:52 +01:00
|
|
|
aarch64-darwin = "fc235ce853bf3bceba46eff4b95764c5935ca07fc4998762ef5e5b7d05f37085";
|
2019-12-01 18:42:16 +01:00
|
|
|
x86_64-darwin = "fc235ce853bf3bceba46eff4b95764c5935ca07fc4998762ef5e5b7d05f37085";
|
|
|
|
x86_64-linux = "b50b02b0a16e5aad8620e9d7c31110ef285c1dde28980b1a9448b764d77d8f92";
|
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
};
|
2019-01-10 12:30:42 +01:00
|
|
|
|
2020-12-29 11:31:47 +01:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
2019-01-10 12:30:42 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r * $out
|
2019-01-19 00:46:16 +01:00
|
|
|
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man
|
2019-01-10 12:30:42 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
find $out -type f | while read f; do
|
2020-12-29 11:31:47 +01:00
|
|
|
patchelf "$f" > /dev/null 2>&1 || continue
|
2019-01-10 12:30:42 +01:00
|
|
|
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
|
2021-01-22 12:25:31 +01:00
|
|
|
patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
|
2019-01-10 12:30:42 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2019-12-01 18:42:16 +01:00
|
|
|
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
|
|
|
|
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
|
2019-01-10 12:30:42 +01:00
|
|
|
license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
2021-12-05 23:35:52 +01:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2019-01-10 12:30:42 +01:00
|
|
|
};
|
|
|
|
}
|