gcc-arm-embedded: remove dependency on ancient Python

This commit is contained in:
Pavol Rusnak 2025-04-12 20:26:14 +02:00
parent b7e09449e3
commit 44986fd97d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
9 changed files with 20 additions and 54 deletions

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man 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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true

View File

@ -3,9 +3,7 @@
stdenv, stdenv,
fetchurl, fetchurl,
ncurses5, ncurses5,
python39,
libxcrypt-legacy, libxcrypt-legacy,
runtimeShell,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -39,9 +37,11 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r * $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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
@ -50,24 +50,12 @@ stdenv.mkDerivation rec {
"$out" "$out"
stdenv.cc.cc stdenv.cc.cc
ncurses5 ncurses5
python39
libxcrypt-legacy libxcrypt-legacy
] ]
} "$f" || true } "$f" || true
done 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; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
@ -79,7 +67,10 @@ stdenv.mkDerivation rec {
lgpl3 lgpl3
mit mit
]; ];
maintainers = with maintainers; [ prusnak ]; maintainers = with maintainers; [
prusnak
prtzl
];
platforms = [ platforms = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"

View File

@ -3,9 +3,7 @@
stdenv, stdenv,
fetchurl, fetchurl,
ncurses5, ncurses5,
python39,
libxcrypt-legacy, libxcrypt-legacy,
runtimeShell,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -41,9 +39,11 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r * $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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
@ -52,24 +52,12 @@ stdenv.mkDerivation rec {
"$out" "$out"
stdenv.cc.cc stdenv.cc.cc
ncurses5 ncurses5
python39
libxcrypt-legacy libxcrypt-legacy
] ]
} "$f" || true } "$f" || true
done 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; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";

View File

@ -3,9 +3,7 @@
stdenv, stdenv,
fetchurl, fetchurl,
ncurses5, ncurses5,
python39,
libxcrypt-legacy, libxcrypt-legacy,
runtimeShell,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -42,9 +40,11 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r * $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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
@ -53,24 +53,12 @@ stdenv.mkDerivation rec {
"$out" "$out"
stdenv.cc.cc stdenv.cc.cc
ncurses5 ncurses5
python39
libxcrypt-legacy libxcrypt-legacy
] ]
} "$f" || true } "$f" || true
done 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; { meta = with lib; {
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";

View File

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

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man 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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man 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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man 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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true

View File

@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
ln -s $out/share/doc/gcc-arm-none-eabi/man $out/man 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 find $out -type f | while read f; do
patchelf "$f" > /dev/null 2>&1 || continue patchelf "$f" > /dev/null 2>&1 || continue
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true