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

This commit is contained in:
Pavol Rusnak 2025-04-12 20:36:50 +02:00 committed by GitHub
commit 439e0a2445
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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
'';
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

View File

@ -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"

View File

@ -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";

View File

@ -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";

View File

@ -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

View File

@ -39,7 +39,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

View File

@ -39,7 +39,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

View File

@ -39,7 +39,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

View File

@ -41,7 +41,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