gcc-arm-embedded-13: init at 13.2.rel1

This commit is contained in:
Pavol Rusnak 2023-11-01 12:34:55 +01:00
parent 5363991a6f
commit 23483be539
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,68 @@
{ lib
, stdenv
, fetchurl
, ncurses5
, python38
, libxcrypt-legacy
, runtimeShell
}:
stdenv.mkDerivation rec {
pname = "gcc-arm-embedded";
version = "13.2.rel1";
platform = {
aarch64-darwin = "darwin-arm64";
aarch64-linux = "aarch64";
x86_64-darwin = "darwin-x86_64";
x86_64-linux = "x86_64";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
src = fetchurl {
url = "https://developer.arm.com/-/media/Files/downloads/gnu/${version}/binrel/arm-gnu-toolchain-${version}-${platform}-arm-none-eabi.tar.xz";
sha256 = {
aarch64-darwin = "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279";
aarch64-linux = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a";
x86_64-darwin = "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc";
x86_64-linux = "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
};
dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontStrip = true;
installPhase = ''
mkdir -p $out
cp -r * $out
'';
preFixup = ''
find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python38 libxcrypt-legacy ]} "$f" || true
done
'';
postFixup = ''
mv $out/bin/arm-none-eabi-gdb $out/bin/arm-none-eabi-gdb-unwrapped
cat <<EOF > $out/bin/arm-none-eabi-gdb
#!${runtimeShell}
export PYTHONPATH=${python38}/lib/python3.8
export PYTHONHOME=${python38}/bin/python3.8
exec $out/bin/arm-none-eabi-gdb-unwrapped "\$@"
EOF
chmod +x $out/bin/arm-none-eabi-gdb
'';
meta = with lib; {
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 prtzl ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
}

View File

@ -16252,6 +16252,7 @@ with pkgs;
gcc-arm-embedded-10 = callPackage ../development/compilers/gcc-arm-embedded/10 { };
gcc-arm-embedded-11 = callPackage ../development/compilers/gcc-arm-embedded/11 { };
gcc-arm-embedded-12 = callPackage ../development/compilers/gcc-arm-embedded/12 { };
gcc-arm-embedded-13 = callPackage ../development/compilers/gcc-arm-embedded/13 { };
gcc-arm-embedded = gcc-arm-embedded-12;
# It would be better to match the default gcc so that there are no linking errors