From 0dc7fa15419feec3c8e9c5ab1e7d6c40548aebd8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 28 Dec 2020 16:09:32 +0100 Subject: [PATCH] gcc-arm-embedded: 9-2020-q2-update -> 10-2020-q4-major --- .../compilers/gcc-arm-embedded/10/default.nix | 53 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/gcc-arm-embedded/10/default.nix diff --git a/pkgs/development/compilers/gcc-arm-embedded/10/default.nix b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix new file mode 100644 index 000000000000..88f8f1f2eae2 --- /dev/null +++ b/pkgs/development/compilers/gcc-arm-embedded/10/default.nix @@ -0,0 +1,53 @@ +{ stdenv +, fetchurl +, ncurses5 +, python27 +}: + +stdenv.mkDerivation rec { + pname = "gcc-arm-embedded"; + version = "10-2020-q4-major"; + subdir = "10-2020q4"; + + suffix = { + aarch64-linux = "aarch64-linux"; + x86_64-darwin = "mac"; + x86_64-linux = "x86_64-linux"; + }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + + src = fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${suffix}.tar.bz2"; + sha256 = { + aarch64-linux = "0spkbh7vnda1w0nvavk342nb24nqxn8kln3k9j85mzil560qqg9l"; + x86_64-darwin = "1h5xn0npwkilqxg7ifrymsl7kjpafr9r9gjqgcpb0kjxavijvldy"; + x86_64-linux = "066nvhg5zdf3jvy9w23y439ghf1hvbicdyrrw9957gwb8ym4q4r1"; + }.${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 + ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man + ''; + + 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 ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true + done + ''; + + meta = with stdenv.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 ]; + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b183ed808f06..8f49e9d0ca71 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9452,7 +9452,8 @@ in gcc-arm-embedded-7 = callPackage ../development/compilers/gcc-arm-embedded/7 {}; gcc-arm-embedded-8 = callPackage ../development/compilers/gcc-arm-embedded/8 {}; gcc-arm-embedded-9 = callPackage ../development/compilers/gcc-arm-embedded/9 {}; - gcc-arm-embedded = gcc-arm-embedded-9; + gcc-arm-embedded-10 = callPackage ../development/compilers/gcc-arm-embedded/10 {}; + gcc-arm-embedded = gcc-arm-embedded-10; gdc = gdc9; gdc9 = wrapCC (gcc9.cc.override {