Merge pull request #133833 from lovesegfault/fix-compe-tabnine

vimPlugins.compe-tabnine: fix binaries symlink
This commit is contained in:
Bernardo Meurer 2021-08-13 23:26:05 +00:00 committed by GitHub
commit 1380d15285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 20 deletions

View file

@ -1,27 +1,23 @@
{ stdenv, lib, fetchurl, unzip }:
let
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
version = "3.5.37";
src =
if stdenv.hostPlatform.system == "x86_64-darwin" then
fetchurl
{
url = "https://update.tabnine.com/bundles/${version}/x86_64-apple-darwin/TabNine.zip";
sha256 = "sha256-Vxmhl4/bhRDeByGgkdSF8yEY5wI23WzT2iH1OFkEpck=";
}
else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl
{
url = "https://update.tabnine.com/bundles/${version}/x86_64-unknown-linux-musl/TabNine.zip";
sha256 = "sha256-pttjlx7WWE3nog9L1APp8HN+a4ShhlBj5irHOaPgqHw=";
}
else throw "Not supported on ${stdenv.hostPlatform.system}";
platform =
if stdenv.hostPlatform.system == "x86_64-linux" then {
name = "x86_64-unknown-linux-musl";
sha256 = "sha256-pttjlx7WWE3nog9L1APp8HN+a4ShhlBj5irHOaPgqHw=";
} else if stdenv.hostPlatform.system == "x86_64-darwin" then {
name = "x86_64-apple-darwin";
sha256 = "sha256-Vxmhl4/bhRDeByGgkdSF8yEY5wI23WzT2iH1OFkEpck=";
} else throw "Not supported on ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation rec {
pname = "tabnine";
# You can check the latest version with `curl -sS https://update.tabnine.com/bundles/version`
version = "3.5.37";
inherit version src;
src = fetchurl {
url = "https://update.tabnine.com/bundles/${version}/${platform.name}/TabNine.zip";
inherit (platform) sha256;
};
dontBuild = true;
@ -40,6 +36,8 @@ stdenv.mkDerivation rec {
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";

View file

@ -126,8 +126,8 @@ self: super: {
buildInputs = [ tabnine ];
postFixup = ''
mkdir $target/binaries
ln -s ${tabnine}/bin/TabNine $target/binaries/TabNine_$(uname -s)
mkdir -p $target/binaries/${tabnine.version}
ln -s ${tabnine}/bin/ $target/binaries/${tabnine.version}/${tabnine.passthru.platform}
'';
});