ai-edge-litert: unbreak

The library we have in nixpkgs seems compatible enough, and there's no
way I'm being sniped into dealing with bazel, so this hack will have to
do.
This commit is contained in:
Simonas Kazlauskas
2026-07-05 14:45:35 +03:00
parent 8785426d7a
commit 7198eeede3
@@ -3,6 +3,7 @@
buildPythonPackage,
fetchurl,
lib,
patchelf,
python,
pythonAtLeast,
stdenv,
@@ -71,6 +72,13 @@ buildPythonPackage {
# TODO: npu-sdk
};
preFixup = ''
while IFS= read -r -d "" so; do
${patchelf}/bin/patchelf --replace-needed libopenvino.so.2620 libopenvino.so "$so"
${patchelf}/bin/patchelf --replace-needed libopenvino_tensorflow_lite_frontend.so.2620 libopenvino_tensorflow_lite_frontend.so "$so"
done < <(find "$out" -type f \( -name '*.so' -o -name '*.so.*' \) -print0)
'';
pythonRemoveDeps = lib.optionals (pythonAtLeast "3.12") [
# https://github.com/google-ai-edge/LiteRT/pull/5298
"backports.strenum"
@@ -96,8 +104,5 @@ buildPythonPackage {
# elftools.common.exceptions.ELFError: Magic number does not match
lib.systems.inspect.patterns.isDarwin
];
# Incompatible with the openvino currently shipped in nixpkgs:
# auto-patchelf could not satisfy dependency libopenvino.so.2620
broken = true;
};
}