2021-01-09 10:05:03 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip }:
|
2020-10-07 09:15:18 +00:00
|
|
|
let
|
2021-08-18 13:19:15 +00:00
|
|
|
platform =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then {
|
|
|
|
name = "x86_64-unknown-linux-musl";
|
2021-08-22 07:53:02 +00:00
|
|
|
sha256 = "sha256-uy3+/+XMq56rO75mmSeOmE1HW7hhefaGwfY/QJPk3Ok=";
|
2021-08-18 13:19:15 +00:00
|
|
|
} else if stdenv.hostPlatform.system == "x86_64-darwin" then {
|
|
|
|
name = "x86_64-apple-darwin";
|
2021-08-22 07:53:02 +00:00
|
|
|
sha256 = "sha256-EK7FbRzgaCXviOuBcRf/ElllRdakhDmOLsKkwrIEhBU=";
|
2021-08-18 13:19:15 +00:00
|
|
|
} else throw "Not supported on ${stdenv.hostPlatform.system}";
|
2021-03-20 04:20:00 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-10-07 09:15:18 +00:00
|
|
|
pname = "tabnine";
|
2021-08-18 13:19:15 +00:00
|
|
|
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
|
2021-08-22 07:53:02 +00:00
|
|
|
version = "3.5.49";
|
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";
|
|
|
|
inherit (platform) sha256;
|
|
|
|
};
|
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;
|
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" ];
|
2021-07-14 22:03:04 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
}
|