2021-01-06 23:45:24 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip }:
|
2020-10-01 12:58:15 +00:00
|
|
|
|
|
|
|
let
|
2021-01-06 23:45:24 +00:00
|
|
|
version = "3.2.63";
|
2020-10-01 17:45:58 +00:00
|
|
|
src =
|
2020-10-01 12:58:15 +00:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-darwin" then
|
2020-10-01 17:45:58 +00:00
|
|
|
fetchurl {
|
2021-01-06 23:45:24 +00:00
|
|
|
url = "https://update.tabnine.com/bundles/${version}/x86_64-apple-darwin/TabNine.zip";
|
|
|
|
sha256 = "0y0wb3jdr2qk4k21c11w8c9a5fl0h2rm1wm7m8hqdywy4lz9ppgy";
|
2020-10-01 17:45:58 +00:00
|
|
|
}
|
2020-10-01 12:58:15 +00:00
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
2020-10-01 17:45:58 +00:00
|
|
|
fetchurl {
|
2021-01-06 23:45:24 +00:00
|
|
|
url = "https://update.tabnine.com/bundles/${version}/x86_64-unknown-linux-musl/TabNine.zip";
|
|
|
|
sha256 = "0zzk2w5azk5f0svjxlj2774x01xdflb767xxvbglj4223dgyx2x5";
|
2020-10-01 17:45:58 +00:00
|
|
|
}
|
2020-10-01 12:58:15 +00:00
|
|
|
else throw "Not supported on ${stdenv.hostPlatform.system}";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "tabnine";
|
|
|
|
|
2020-10-01 17:45:58 +00:00
|
|
|
inherit version src;
|
2020-10-01 12:58:15 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
2021-01-06 23:45:24 +00:00
|
|
|
|
|
|
|
# Work around the "unpacker appears to have produced no directories"
|
|
|
|
# case that happens when the archive doesn't have a subdirectory.
|
|
|
|
setSourceRoot = "sourceRoot=`pwd`";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
2020-10-01 12:58:15 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-01-06 23:45:24 +00:00
|
|
|
install -Dm755 TabNine $out/bin/TabNine
|
2020-10-01 12:58:15 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-01 17:45:58 +00:00
|
|
|
meta = with lib; {
|
2020-10-01 12:58:15 +00:00
|
|
|
homepage = "https://tabnine.com";
|
|
|
|
description = "Smart Compose for code that uses deep learning to help you write code faster";
|
2020-10-01 17:45:58 +00:00
|
|
|
license = licenses.unfree;
|
2020-10-01 12:58:15 +00:00
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|