2021-01-09 10:05:03 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip }:
|
2020-10-07 09:15:18 +00:00
|
|
|
let
|
2022-01-27 00:19:43 +00:00
|
|
|
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
|
2022-08-12 12:06:08 +00:00
|
|
|
# There's a handy prefetch script in ./fetch-latest.sh
|
2022-09-14 18:05:37 +00:00
|
|
|
version = "4.4.139";
|
2021-12-06 16:07:01 +00:00
|
|
|
supportedPlatforms = {
|
|
|
|
"x86_64-linux" = {
|
2021-08-18 13:19:15 +00:00
|
|
|
name = "x86_64-unknown-linux-musl";
|
2022-09-14 18:05:37 +00:00
|
|
|
hash = "sha256-CXm9WR77SMvv+9w+8QUBNHKPhe4otquLyHAwzd+jbNk=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
"x86_64-darwin" = {
|
2021-08-18 13:19:15 +00:00
|
|
|
name = "x86_64-apple-darwin";
|
2022-09-14 18:05:37 +00:00
|
|
|
hash = "sha256-01lotn9DzgwIj1n9GCUuGmwgtS4DtK+XOl/wduI+QyI=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
"aarch64-darwin" = {
|
|
|
|
name = "aarch64-apple-darwin";
|
2022-09-14 18:05:37 +00:00
|
|
|
hash = "sha256-RQBBsp48Xhxi3WQKsYzSiiSEW8W7UikKAyFf4sJ2JqQ=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
platform =
|
|
|
|
if (builtins.hasAttr stdenv.hostPlatform.system supportedPlatforms) then
|
|
|
|
builtins.getAttr (stdenv.hostPlatform.system) supportedPlatforms
|
|
|
|
else
|
|
|
|
throw "Not supported on ${stdenv.hostPlatform.system}";
|
2021-03-20 04:20:00 +00:00
|
|
|
in
|
2022-01-27 00:19:43 +00:00
|
|
|
stdenv.mkDerivation {
|
2020-10-07 09:15:18 +00:00
|
|
|
pname = "tabnine";
|
2022-01-27 00:19:43 +00:00
|
|
|
inherit version;
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://update.tabnine.com/bundles/${version}/${platform.name}/TabNine.zip";
|
2022-08-12 12:06:08 +00:00
|
|
|
inherit (platform) hash;
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
2021-01-09 10:05:03 +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-07 09:15:18 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
runHook preInstall
|
2021-01-09 10:05:03 +00:00
|
|
|
install -Dm755 TabNine $out/bin/TabNine
|
2021-04-25 03:57:28 +00:00
|
|
|
install -Dm755 TabNine-deep-cloud $out/bin/TabNine-deep-cloud
|
|
|
|
install -Dm755 TabNine-deep-local $out/bin/TabNine-deep-local
|
|
|
|
install -Dm755 WD-TabNine $out/bin/WD-TabNine
|
2021-07-14 22:03:04 +00:00
|
|
|
runHook postInstall
|
2020-10-07 09:15:18 +00:00
|
|
|
'';
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
passthru.platform = platform.name;
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://tabnine.com";
|
|
|
|
description = "Smart Compose for code that uses deep learning to help you write code faster";
|
|
|
|
license = licenses.unfree;
|
2022-01-27 00:19:43 +00:00
|
|
|
platforms = attrNames supportedPlatforms;
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
}
|