12 # Tensorflow 2.16.1 requires Flatbuffers 23.5.26
13 # Compile as a shared library
14 flatbuffers_23_5_26 = flatbuffers.overrideAttrs (oldAttrs: rec {
16 cmakeFlags = (oldAttrs.cmakeFlags or [ ]) ++ [ "-DFLATBUFFERS_BUILD_SHAREDLIB=ON" ];
17 NIX_CXXSTDLIB_COMPILE = "-std=c++17";
18 configureFlags = (oldAttrs.configureFlags or [ ]) ++ [ "--enable-shared" ];
19 src = fetchFromGitHub {
23 hash = "sha256-e+dNPNbCHYDXUS/W+hMqf/37fhVgEGzId6rhP3cToTE=";
29 version = "0-unstable-2024-03-14";
31 src = fetchFromGitHub {
32 owner = "google-coral";
34 rev = "e35aed18fea2e2d25d98352e5a5bd357c170bd4d";
35 hash = "sha256-SabiFG/EgspiCFpg8XQs6RjFhrPPUfhILPmYQQA1E2w=";
40 name = "fix-makefile-to-compile-with-latest-tensorflow.patch";
41 url = "https://patch-diff.githubusercontent.com/raw/google-coral/libedgetpu/pull/66.patch";
42 hash = "sha256-mMODpQmikfXtsQvtgh26cy97EiykYNLngSjidOBt/3I=";
48 "makefile_build/Makefile"
58 nativeBuildInputs = [ xxd ];
60 NIX_CXXSTDLIB_COMPILE = "-std=c++17";
62 TFROOT = fetchFromGitHub {
66 hash = "sha256-UPvK5Kc/FNVJq3FchN5IIBBObvcHtAPVv0ARzWzA35M=";
69 enableParallelBuilding = true;
73 install -Dm555 out/direct/k8/libedgetpu.so.1.0 -t $out/lib
74 ln -s $out/lib/libedgetpu.so.1.0 $out/lib/libedgetpu.so.1
75 install -Dm444 debian/edgetpu-accelerator.rules $out/lib/udev/rules.d/99-edgetpu-accelerator.rules
76 install -Dm444 tflite/public/*.h -t $out/include
81 homepage = "https://github.com/google-coral/libedgetpu";
82 description = "Userspace level runtime driver for Coral devices";
83 license = lib.licenses.asl20;
84 maintainers = with lib.maintainers; [ frenetic00 ];
85 platforms = lib.platforms.linux;