2021-01-06 23:45:24 +00:00
|
|
|
{ stdenv, lib, fetchurl, unzip }:
|
2020-10-01 13:58:15 +01:00
|
|
|
|
|
|
|
let
|
2021-03-27 19:35:04 +00:00
|
|
|
version = "3.3.101";
|
2020-10-01 18:45:58 +01:00
|
|
|
src =
|
2020-10-01 13:58:15 +01:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-darwin" then
|
2021-03-27 19:35:04 +00:00
|
|
|
fetchurl
|
|
|
|
{
|
|
|
|
url = "https://update.tabnine.com/bundles/${version}/x86_64-apple-darwin/TabNine.zip";
|
|
|
|
sha256 = "KrFDQSs7hMCioeqPKTNODe3RKnwNV8XafdYDUaxou/Y=";
|
|
|
|
}
|
2020-10-01 13:58:15 +01:00
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
2021-03-27 19:35:04 +00:00
|
|
|
fetchurl
|
|
|
|
{
|
|
|
|
url = "https://update.tabnine.com/bundles/${version}/x86_64-unknown-linux-musl/TabNine.zip";
|
|
|
|
sha256 = "vbeuZf/phOj83xTha+AzpKIvvrjwMar7q2teAmr5ESQ=";
|
|
|
|
}
|
2020-10-01 13:58:15 +01:00
|
|
|
else throw "Not supported on ${stdenv.hostPlatform.system}";
|
2021-03-27 19:35:04 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-10-01 13:58:15 +01:00
|
|
|
pname = "tabnine";
|
|
|
|
|
2020-10-01 18:45:58 +01:00
|
|
|
inherit version src;
|
2020-10-01 13:58:15 +01: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 13:58:15 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-01-06 23:45:24 +00:00
|
|
|
install -Dm755 TabNine $out/bin/TabNine
|
2020-10-01 13:58:15 +01:00
|
|
|
'';
|
|
|
|
|
2020-10-01 18:45:58 +01:00
|
|
|
meta = with lib; {
|
2020-10-01 13:58:15 +01:00
|
|
|
homepage = "https://tabnine.com";
|
|
|
|
description = "Smart Compose for code that uses deep learning to help you write code faster";
|
2020-10-01 18:45:58 +01:00
|
|
|
license = licenses.unfree;
|
2020-10-01 13:58:15 +01:00
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|