From daf1f0bc22b55ddc0cacf0a2a3e92fdd8aff7d7c Mon Sep 17 00:00:00 2001 From: Theodore Witkamp Date: Thu, 28 Mar 2019 10:15:38 -0700 Subject: [PATCH] gcc-arm-embedded: add darwin support --- .../compilers/gcc-arm-embedded/6/default.nix | 19 ++++++++++--------- .../compilers/gcc-arm-embedded/7/default.nix | 15 ++++++++++++--- .../compilers/gcc-arm-embedded/8/default.nix | 15 ++++++++++++--- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix index 82edf0e33cfa..9e5a172eed84 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/6/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/6/default.nix @@ -5,16 +5,17 @@ stdenv.mkDerivation rec { version = "6-2017-q2-update"; subdir = "6-2017q2"; - platformString = - if stdenv.isLinux then "linux" - else if stdenv.isDarwin then "mac" - else throw "unsupported platform"; - - urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-${platformString}.tar.bz2"; - src = - if stdenv.isLinux then fetchurl { url=urlString; sha256="1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6"; } - else if stdenv.isDarwin then fetchurl { url=urlString; sha256="0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x"; } + if stdenv.isLinux then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; + sha256="1hvwi02mx34al525sngnl0cm7dkmzxfkb1brq9kvbv28wcplp3p6"; + } + else if stdenv.isDarwin then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2"; + sha256="0019ylpq4inq7p5gydpmc9m8ni72fz2csrjlqmgx1698998q0c3x"; + } else throw "unsupported platform"; phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; diff --git a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix index 39fc3c517f81..80e042b5c2e9 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/7/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/7/default.nix @@ -7,9 +7,18 @@ stdenv.mkDerivation rec { version = "7-2018-q2-update"; subdir = "7-2018q2"; - urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; - - src = fetchurl { url=urlString; sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv"; }; + src = + if stdenv.isLinux then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; + sha256="0sgysp3hfpgrkcbfiwkp0a7ymqs02khfbrjabm52b5z61sgi05xv"; + } + else if stdenv.isDarwin then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2"; + sha256="0nc7m0mpa39qyhfyydxkkyqm7spfc27xf6ygi2vd2aym4r9azi61"; + } + else throw "unsupported platform"; phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; diff --git a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix index a26131cb0536..ee57dcc8c144 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/8/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/8/default.nix @@ -7,9 +7,18 @@ stdenv.mkDerivation rec { version = "8-2018-q4-major"; subdir = "8-2018q4"; - urlString = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; - - src = fetchurl { url=urlString; sha256="fb31fbdfe08406ece43eef5df623c0b2deb8b53e405e2c878300f7a1f303ee52"; }; + src = + if stdenv.isLinux then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-linux.tar.bz2"; + sha256="fb31fbdfe08406ece43eef5df623c0b2deb8b53e405e2c878300f7a1f303ee52"; + } + else if stdenv.isDarwin then + fetchurl { + url = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/${subdir}/gcc-arm-none-eabi-${version}-mac.tar.bz2"; + sha256="0q44r57fizpk1z3ngcjwal3rxgsnzjyfknpgwlwzmw5r9p98wlhb"; + } + else throw "unsupported platform"; phases = [ "unpackPhase" "installPhase" "fixupPhase" ];