Unverified Commit 439e0a24 authored by Pavol Rusnak's avatar Pavol Rusnak Committed by GitHub
Browse files

gcc-arm-embedded: remove dependency on ancient Python (#398190)

parents b7e09449 44986fd9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
    ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man
  '';

  preFixup = ''
  preFixup = lib.optionalString stdenv.isLinux ''
    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
+7 −16
Original line number Diff line number Diff line
@@ -3,9 +3,7 @@
  stdenv,
  fetchurl,
  ncurses5,
  python39,
  libxcrypt-legacy,
  runtimeShell,
}:

stdenv.mkDerivation rec {
@@ -39,9 +37,11 @@ stdenv.mkDerivation rec {
  installPhase = ''
    mkdir -p $out
    cp -r * $out
    # these binaries require ancient Python 3.8 not available in Nixpkgs
    rm $out/bin/{arm-none-eabi-gdb-py,arm-none-eabi-gdb-add-index-py} || :
  '';

  preFixup = ''
  preFixup = lib.optionalString stdenv.isLinux ''
    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
@@ -50,24 +50,12 @@ stdenv.mkDerivation rec {
          "$out"
          stdenv.cc.cc
          ncurses5
          python39
          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=${python39}/lib/python3.9
    export PYTHONHOME=${python39.interpreter}
    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";
@@ -79,7 +67,10 @@ stdenv.mkDerivation rec {
      lgpl3
      mit
    ];
    maintainers = with maintainers; [ prusnak ];
    maintainers = with maintainers; [
      prusnak
      prtzl
    ];
    platforms = [
      "x86_64-linux"
      "aarch64-linux"
+3 −15
Original line number Diff line number Diff line
@@ -3,9 +3,7 @@
  stdenv,
  fetchurl,
  ncurses5,
  python39,
  libxcrypt-legacy,
  runtimeShell,
}:

stdenv.mkDerivation rec {
@@ -41,9 +39,11 @@ stdenv.mkDerivation rec {
  installPhase = ''
    mkdir -p $out
    cp -r * $out
    # these binaries require ancient Python 3.8 not available in Nixpkgs
    rm $out/bin/{arm-none-eabi-gdb-py,arm-none-eabi-gdb-add-index-py} || :
  '';

  preFixup = ''
  preFixup = lib.optionalString stdenv.isLinux ''
    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
@@ -52,24 +52,12 @@ stdenv.mkDerivation rec {
          "$out"
          stdenv.cc.cc
          ncurses5
          python39
          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=${python39}/lib/python3.9
    export PYTHONHOME=${python39.interpreter}
    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";
+3 −15
Original line number Diff line number Diff line
@@ -3,9 +3,7 @@
  stdenv,
  fetchurl,
  ncurses5,
  python39,
  libxcrypt-legacy,
  runtimeShell,
}:

stdenv.mkDerivation rec {
@@ -42,9 +40,11 @@ stdenv.mkDerivation rec {
  installPhase = ''
    mkdir -p $out
    cp -r * $out
    # these binaries require ancient Python 3.8 not available in Nixpkgs
    rm $out/bin/{arm-none-eabi-gdb-py,arm-none-eabi-gdb-add-index-py} || :
  '';

  preFixup = ''
  preFixup = lib.optionalString stdenv.isLinux ''
    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
@@ -53,24 +53,12 @@ stdenv.mkDerivation rec {
          "$out"
          stdenv.cc.cc
          ncurses5
          python39
          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=${python39}/lib/python3.9
    export PYTHONHOME=${python39.interpreter}
    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";
+2 −3
Original line number Diff line number Diff line
@@ -4,9 +4,8 @@
  fetchurl,
  ncurses6,
  libxcrypt-legacy,
  runtimeShell,
  zstd,
  xz,
  zstd,
}:

stdenv.mkDerivation rec {
@@ -57,8 +56,8 @@ stdenv.mkDerivation rec {
          stdenv.cc.cc
          ncurses6
          libxcrypt-legacy
          zstd
          xz
          zstd
        ]
      } "$f" || true
    done
Loading