From c98d1b514e85b31583e42a589e4a00bf812e2c30 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Wed, 23 Jun 2021 10:15:02 -0400 Subject: [PATCH] edgetpu-compiler: init at 15.0 --- .../robotics/edgetpu-compiler/default.nix | 58 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix 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 000000000000..adf8bdd54b72 --- /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" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 236b55ba0a1e..1de47fb6059e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4297,6 +4297,8 @@ in ecryptfs-helper = callPackage ../tools/security/ecryptfs/helper.nix { }; + edgetpu-compiler = callPackage ../development/libraries/science/robotics/edgetpu-compiler { }; + edid-decode = callPackage ../tools/misc/edid-decode { }; edid-generator = callPackage ../tools/misc/edid-generator { };