tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ycmd: remove ? null, little cleanup, formatting
Sandro Jäckel
4 years ago
2a5a4c89
74ac4706
+14
-15
1 changed file
expand all
collapse all
unified
split
pkgs
development
tools
misc
ycmd
default.nix
+14
-15
pkgs/development/tools/misc/ycmd/default.nix
···
1
1
{ stdenv, lib, fetchgit, cmake, llvmPackages, boost, python
2
2
-
, gocode ? null
3
3
-
, godef ? null
4
4
-
, gotools ? null
5
5
-
, nodePackages ? null
6
6
-
, fixDarwinDylibNames, Cocoa ? null
2
2
+
, withGocode ? true, gocode
3
3
+
, withGodef ? true, godef
4
4
+
, withGotools? true, gotools
5
5
+
, withTypescript ? true, nodePackages
6
6
+
, fixDarwinDylibNames, Cocoa
7
7
}:
8
8
9
9
stdenv.mkDerivation {
10
10
pname = "ycmd";
11
11
-
version = "2020-02-22";
11
11
+
version = "unstable-2020-02-22";
12
12
disabled = !python.isPy3k;
13
13
14
14
+
# required for third_party directory creation
14
15
src = fetchgit {
15
16
url = "https://github.com/Valloric/ycmd.git";
16
17
rev = "9a6b86e3a156066335b678c328f226229746bae5";
···
20
21
nativeBuildInputs = [ cmake ]
21
22
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
22
23
buildInputs = [ boost llvmPackages.libclang ]
23
23
-
++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
24
24
+
++ lib.optional stdenv.isDarwin Cocoa;
24
25
25
26
buildPhase = ''
26
27
export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
···
58
59
mkdir -p $out/lib/ycmd/third_party
59
60
cp -r third_party/* $out/lib/ycmd/third_party/
60
61
61
61
-
'' + lib.optionalString (gocode != null) ''
62
62
+
'' + lib.optionalString withGocode ''
62
63
TARGET=$out/lib/ycmd/third_party/gocode
63
64
mkdir -p $TARGET
64
65
ln -sf ${gocode}/bin/gocode $TARGET
65
65
-
'' + lib.optionalString (godef != null) ''
66
66
+
'' + lib.optionalString withGodef ''
66
67
TARGET=$out/lib/ycmd/third_party/godef
67
68
mkdir -p $TARGET
68
69
ln -sf ${godef}/bin/godef $TARGET
69
69
-
'' + lib.optionalString (gotools != null) ''
70
70
+
'' + lib.optionalString withGotools ''
70
71
TARGET=$out/lib/ycmd/third_party/go/src/golang.org/x/tools/cmd/gopls
71
72
mkdir -p $TARGET
72
73
ln -sf ${gotools}/bin/gopls $TARGET
73
73
-
'' + lib.optionalString (nodePackages != null) ''
74
74
+
'' + lib.optionalString withTypescript ''
74
75
TARGET=$out/lib/ycmd/third_party/tsserver
75
76
ln -sf ${nodePackages.typescript} $TARGET
76
77
'';
···
79
80
# python won't be thrown off by argv[0]
80
81
postFixup = ''
81
82
substituteInPlace $out/lib/ycmd/ycmd/__main__.py \
82
82
-
--replace $out/lib/ycmd/ycmd/__main__.py \
83
83
-
$out/bin/ycmd \
84
84
-
--replace __file__ \
85
85
-
"'$out/lib/ycmd/ycmd/__main__.py'"
83
83
+
--replace $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd \
84
84
+
--replace __file__ "'$out/lib/ycmd/ycmd/__main__.py'"
86
85
'';
87
86
88
87
meta = with lib; {