From a323331e6ad6a82a276966330057a294cb6b0ab3 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Thu, 17 Sep 2020 15:33:17 -0300 Subject: [PATCH] dart: Fix dart2native by patching all ELFs Before: $ /nix/store/ihlzjcxahcack6chfzphb74bkccmq6br-dart-2.7.2/bin/dart2native hello.dart Failed to generate native files: ProcessException: No such file or directory Command: /nix/store/ihlzjcxahcack6chfzphb74bkccmq6br-dart-2.7.2/bin/utils/gen_snapshot --snapshot-kind=app-aot-elf --elf=/tmp/HSHJQU/snapshot.aot /tmp/HSHJQU/kernel.dill After: $ /nix/store/czw7kpdmcqa76a9j00v2pjygrq7gy4c7-dart-2.7.2/bin/dart2native hello.dart Generated: /home/thiagoko/hello.exe $ ./hello.exe Hello, World! --- pkgs/development/interpreters/dart/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix index 050e7f14979c..6ce43d55173b 100644 --- a/pkgs/development/interpreters/dart/default.nix +++ b/pkgs/development/interpreters/dart/default.nix @@ -69,9 +69,7 @@ stdenv.mkDerivation { mkdir -p $out cp -R * $out/ echo $libPath - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath $libPath \ - $out/bin/dart + find $out/bin -executable -type f -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \; ''; libPath = makeLibraryPath [ stdenv.cc.cc ];