summary refs log tree commit diff
path: root/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorPhillip Cloud <cpcloud@gmail.com>2021-06-23 10:15:02 -0400
committerPhillip Cloud <cpcloud@gmail.com>2021-06-24 11:45:47 -0400
commitc98d1b514e85b31583e42a589e4a00bf812e2c30 (patch)
treee86a12755b736f0cb2fa90a815bfcca6555b21cb /pkgs/development/libraries/science
parent21e25c659f62a010d057c54b3e8b04ee4f7fbfbe (diff)
downloadnixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar.gz
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar.bz2
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar.lz
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar.xz
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.tar.zst
nixpkgs-c98d1b514e85b31583e42a589e4a00bf812e2c30.zip
edgetpu-compiler: init at 15.0
Diffstat (limited to 'pkgs/development/libraries/science')
-rw-r--r--pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix b/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix
new file mode 100644
index 00000000000..adf8bdd54b7
--- /dev/null
+++ b/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix
@@ -0,0 +1,58 @@
+{ autoPatchelfHook
+, dpkg
+, fetchurl
+, lib
+, libcxx
+, stdenv
+}:
+stdenv.mkDerivation rec {
+  pname = "edgetpu-compiler";
+  version = "15.0";
+
+  src = fetchurl rec {
+    url = "https://packages.cloud.google.com/apt/pool/${pname}_${version}_amd64_${sha256}.deb";
+    sha256 = "ce03822053c2bddbb8640eaa988396ae66f9bc6b9d6d671914acd1727c2b445a";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    dpkg
+  ];
+
+  buildInputs = [
+    libcxx
+  ];
+
+  unpackPhase = ''
+    mkdir bin pkg
+
+    dpkg -x $src pkg
+
+    rm -r pkg/usr/share/lintian
+
+    cp pkg/usr/bin/edgetpu_compiler_bin/edgetpu_compiler ./bin
+    cp -r pkg/usr/share .
+
+    rm -r pkg
+  '';
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp -r ./{bin,share} $out
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A command line tool that compiles a TensorFlow Lite model into an Edge TPU compatible file.";
+    homepage = "https://coral.ai/docs/edgetpu/compiler";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cpcloud ];
+    platforms = [ "x86_64-linux" ];
+  };
+}