mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-23 21:33:49 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
61 lines
1.2 KiB
Nix
61 lines
1.2 KiB
Nix
{ 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 = "Command line tool that compiles a TensorFlow Lite model into an Edge TPU compatible file";
|
|
mainProgram = "edgetpu_compiler";
|
|
homepage = "https://coral.ai/docs/edgetpu/compiler";
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|