From dfc7bdb1a350a735a0d57d741ade1196652884e3 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Fri, 20 Sep 2019 15:23:09 +0200 Subject: [PATCH 1/3] ycmd: install phase copies all dirs below 'third_party' Copy _all_ of 'third_party'. Cherry-picking the contents of this dir is a fragile approach as they change in later commits (breaking this build). This approach continues to work on the current build, and will not break with later versions of the project. Signed-off-by: Sirio Balmelli --- pkgs/development/tools/misc/ycmd/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/misc/ycmd/default.nix b/pkgs/development/tools/misc/ycmd/default.nix index 12f0b13a6602..61f529e1108b 100644 --- a/pkgs/development/tools/misc/ycmd/default.nix +++ b/pkgs/development/tools/misc/ycmd/default.nix @@ -51,16 +51,17 @@ stdenv.mkDerivation { mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release} - for p in jedi waitress frozendict bottle parso python-future requests; do - cp -r third_party/$p $out/lib/ycmd/third_party - done + # Copy everything: the structure of third_party has been known to change. + # When linking our own libraries below, do so with '-f' + # to clobber anything we may have copied here. + cp -r third_party/* $out/lib/ycmd/third_party/ '' + lib.optionalString (gocode != null) '' - ln -s ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode + ln -sf ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode '' + lib.optionalString (godef != null) '' - ln -s ${godef}/bin/godef $out/lib/ycmd/third_party/godef + ln -sf ${godef}/bin/godef $out/lib/ycmd/third_party/godef '' + lib.optionalString (rustracerd != null) '' - ln -s ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release + ln -sf ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release ''; # fixup the argv[0] and replace __file__ with the corresponding path so From 7d21d6a680ba42cdba181bd727f1935073e75b83 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Fri, 20 Sep 2019 15:29:38 +0200 Subject: [PATCH 2/3] ycmd: update build to 2019-09-19 Signed-off-by: Sirio Balmelli --- pkgs/development/tools/misc/ycmd/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/ycmd/default.nix b/pkgs/development/tools/misc/ycmd/default.nix index 61f529e1108b..f4cb84beb8d2 100644 --- a/pkgs/development/tools/misc/ycmd/default.nix +++ b/pkgs/development/tools/misc/ycmd/default.nix @@ -7,12 +7,12 @@ stdenv.mkDerivation { pname = "ycmd"; - version = "2018-09-20"; + version = "2019-09-19"; src = fetchgit { url = "https://github.com/Valloric/ycmd.git"; - rev = "bf658fd78722c517674c0aaf2381e199bca8f163"; - sha256 = "1lwa8xr76vapfpncvp81cn3m9219yw14fl7fzk5gnly60zkphbbl"; + rev = "c6d360775b0c5c82e2513dce7b625f8bf3812702"; + sha256 = "19rxlval20gg65xc5p7q9cnzfm9zw2j0m6vxxk0vqlalcyh0rnzd"; }; nativeBuildInputs = [ cmake ]; From dee0cb7be53647613281c9bb95e94c8703af98f3 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Fri, 20 Sep 2019 20:22:09 +0200 Subject: [PATCH 3/3] ycmd: add gopls completer ycmd gives 'no completer support' because of missing 'gopls'. Add this as a conditional dependency. Refactor the 'mkdir -p' step to be conditional per-dependency, and placed just before the link step. This is mostly for legibility but also pedantic correctness: do not create a directory unless it will be used. Signed-off-by: Sirio Balmelli --- pkgs/development/tools/misc/ycmd/default.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/misc/ycmd/default.nix b/pkgs/development/tools/misc/ycmd/default.nix index f4cb84beb8d2..eac81aa7f171 100644 --- a/pkgs/development/tools/misc/ycmd/default.nix +++ b/pkgs/development/tools/misc/ycmd/default.nix @@ -1,6 +1,7 @@ { stdenv, lib, fetchgit, cmake, llvmPackages, boost, python , gocode ? null , godef ? null +, gotools ? null , rustracerd ? null , fixDarwinDylibNames, Cocoa ? null }: @@ -49,19 +50,28 @@ stdenv.mkDerivation { mkdir -p $out/bin ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd - mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release} - # Copy everything: the structure of third_party has been known to change. # When linking our own libraries below, do so with '-f' # to clobber anything we may have copied here. + mkdir -p $out/lib/ycmd/third_party cp -r third_party/* $out/lib/ycmd/third_party/ '' + lib.optionalString (gocode != null) '' - ln -sf ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode + TARGET=$out/lib/ycmd/third_party/gocode + mkdir -p $TARGET + ln -sf ${gocode}/bin/gocode $TARGET '' + lib.optionalString (godef != null) '' - ln -sf ${godef}/bin/godef $out/lib/ycmd/third_party/godef + TARGET=$out/lib/ycmd/third_party/godef + mkdir -p $TARGET + ln -sf ${godef}/bin/godef $TARGET + '' + lib.optionalString (gotools != null) '' + TARGET=$out/lib/ycmd/third_party/go/src/golang.org/x/tools/cmd/gopls + mkdir -p $TARGET + ln -sf ${gotools}/bin/gopls $TARGET '' + lib.optionalString (rustracerd != null) '' - ln -sf ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release + TARGET=$out/lib/ycmd/third_party/racerd/target/release + mkdir -p $TARGET + ln -sf ${rustracerd}/bin/racerd $TARGET ''; # fixup the argv[0] and replace __file__ with the corresponding path so