nixpkgs-suyu/pkgs/development/tools/tabnine/default.nix

47 lines
1.4 KiB
Nix
Raw Normal View History

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