about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2024-02-11 10:23:15 +0000
committerSergei Trofimovich <slyich@gmail.com>2024-02-11 10:23:15 +0000
commitd15e6302d629766edc8f98aa0244f39df45062c9 (patch)
treec55a45fae1aacafff3ccbd3229631f3c7f25370f
parentef6206934d5726ed9315ac78879f5ba2a6b55785 (diff)
downloadnixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar.gz
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar.bz2
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar.lz
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar.xz
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.tar.zst
nixlib-d15e6302d629766edc8f98aa0244f39df45062c9.zip
tensorflow-lite: fix `gcc-13` build failure
Without the change build fails on `master` as
https://hydra.nixos.org/build/249064918:

    tensorflow/lite/kernels/internal/spectrogram.cc:46:22: error: 'uint32_t' was not declared in this scope
       46 | inline int Log2Floor(uint32_t n) {
          |                      ^~~~~~~~
-rw-r--r--pkgs/development/libraries/science/math/tensorflow-lite/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix
index 1ac08ce0cd2f..1bee7f46d37c 100644
--- a/pkgs/development/libraries/science/math/tensorflow-lite/default.nix
+++ b/pkgs/development/libraries/science/math/tensorflow-lite/default.nix
@@ -84,6 +84,10 @@ buildBazelPackage rec {
 
   postPatch = ''
     rm .bazelversion
+
+    # Fix gcc-13 build failure by including missing include headers
+    sed -e '1i #include <cstdint>' -i \
+      tensorflow/lite/kernels/internal/spectrogram.cc
   '';
 
   preConfigure = ''