nixpkgs-esp-dev
nixpkgs-esp-dev copied to clipboard
Missing rpath on libclang dependency
Hi, I'm trying to compile my rust + esp32 project and used this to install the idf framework, but every time that cargo tried to compile esp-idf-sys show me the message about /nix/store/<hash>-esp-clang-esp-idf-v5.3/lib/libclang.so.16.0.1 could found first the zlib dependency and then the libLLVM one, need to do a workaround on the tools.nix installPhase:
libPath = lib.makeLibraryPath [
stdenv.cc.cc.lib
zlib
libxml2
];
installPhase:
if [[ -f $out/lib/libclang.so.16.0.1 ]]; then
echo "Patching Clang"
patchelf \
--set-rpath "${libPath}:$out/lib/" \
$out/lib/libclang.so.16.0.1
patchelf \
--set-rpath "${libPath}" \
$out/lib/libLLVM-16.so
fi