blob: 8e1a1aaea010764aa26f7d8079e6c7f421dff94b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{ stdenv, lib, fetchurl, unzip }:
let
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
# There's a handy prefetch script in ./fetch-latest.sh
version = "4.4.139";
supportedPlatforms = {
"x86_64-linux" = {
name = "x86_64-unknown-linux-musl";
hash = "sha256-CXm9WR77SMvv+9w+8QUBNHKPhe4otquLyHAwzd+jbNk=";
};
"x86_64-darwin" = {
name = "x86_64-apple-darwin";
hash = "sha256-01lotn9DzgwIj1n9GCUuGmwgtS4DtK+XOl/wduI+QyI=";
};
"aarch64-darwin" = {
name = "aarch64-apple-darwin";
hash = "sha256-RQBBsp48Xhxi3WQKsYzSiiSEW8W7UikKAyFf4sJ2JqQ=";
};
};
platform =
if (builtins.hasAttr stdenv.hostPlatform.system supportedPlatforms) then
builtins.getAttr (stdenv.hostPlatform.system) supportedPlatforms
else
throw "Not supported on ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation {
pname = "tabnine";
inherit version;
src = fetchurl {
url = "https://update.tabnine.com/bundles/${version}/${platform.name}/TabNine.zip";
inherit (platform) hash;
};
dontBuild = true;
# 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 ];
installPhase = ''
runHook preInstall
install -Dm755 TabNine $out/bin/TabNine
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
runHook postInstall
'';
passthru.platform = platform.name;
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 = attrNames supportedPlatforms;
maintainers = with maintainers; [ lovesegfault ];
};
}
|