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!
wip/yesman
Thiago Kenji Okada 4 years ago
parent 9c73e34d18
commit a323331e6a
  1. 4
      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 ];

Loading…
Cancel
Save