mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
arduino-core: fixup ELF interperter paths in prebuilt binaries
Fixes #4688
This commit is contained in:
parent
b6f505c60a
commit
84d844e03d
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, jdk, jre, ant, coreutils, gnugrep }:
|
||||
{ stdenv, fetchFromGitHub, jdk, jre, ant, coreutils, gnugrep, file }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0nr5b719qi03rcmx6swbhccv6kihxz3b8b6y46bc2j348rja5332";
|
||||
};
|
||||
|
||||
buildInputs = [ jdk ant ];
|
||||
buildInputs = [ jdk ant file ];
|
||||
|
||||
buildPhase = ''
|
||||
cd ./core && ant
|
||||
@ -27,6 +27,20 @@ stdenv.mkDerivation rec {
|
||||
cp -r ./build/linux/work/tools/ $out/share/arduino
|
||||
cp -r ./build/linux/work/lib/ $out/share/arduino
|
||||
echo ${version} > $out/share/arduino/lib/version.txt
|
||||
|
||||
# Fixup "/lib64/ld-linux-x86-64.so.2" like references in ELF executables.
|
||||
echo "running patchelf on prebuilt binaries:"
|
||||
find "$out" | while read filepath; do
|
||||
if file "$filepath" | grep -q "ELF.*executable"; then
|
||||
# skip target firmware files
|
||||
if echo "$filepath" | grep -q "\.elf$"; then
|
||||
continue
|
||||
fi
|
||||
echo "setting interpreter $(cat "$NIX_GCC"/nix-support/dynamic-linker) in $filepath"
|
||||
patchelf --set-interpreter "$(cat "$NIX_GCC"/nix-support/dynamic-linker)" "$filepath"
|
||||
test $? -eq 0 || { echo "patchelf failed to process $filepath"; exit 1; }
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
Loading…
Reference in New Issue
Block a user