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
{ stdenv, lib, fetchgit, cmake, llvmPackages, boost, python
2
-
, gocode ? null
3
-
, godef ? null
4
-
, gotools ? null
5
-
, nodePackages ? null
6
-
, fixDarwinDylibNames, Cocoa ? null
7
}:
8
9
stdenv.mkDerivation {
10
pname = "ycmd";
11
-
version = "2020-02-22";
12
disabled = !python.isPy3k;
13
0
14
src = fetchgit {
15
url = "https://github.com/Valloric/ycmd.git";
16
rev = "9a6b86e3a156066335b678c328f226229746bae5";
···
20
nativeBuildInputs = [ cmake ]
21
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
22
buildInputs = [ boost llvmPackages.libclang ]
23
-
++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
24
25
buildPhase = ''
26
export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
···
58
mkdir -p $out/lib/ycmd/third_party
59
cp -r third_party/* $out/lib/ycmd/third_party/
60
61
-
'' + lib.optionalString (gocode != null) ''
62
TARGET=$out/lib/ycmd/third_party/gocode
63
mkdir -p $TARGET
64
ln -sf ${gocode}/bin/gocode $TARGET
65
-
'' + lib.optionalString (godef != null) ''
66
TARGET=$out/lib/ycmd/third_party/godef
67
mkdir -p $TARGET
68
ln -sf ${godef}/bin/godef $TARGET
69
-
'' + lib.optionalString (gotools != null) ''
70
TARGET=$out/lib/ycmd/third_party/go/src/golang.org/x/tools/cmd/gopls
71
mkdir -p $TARGET
72
ln -sf ${gotools}/bin/gopls $TARGET
73
-
'' + lib.optionalString (nodePackages != null) ''
74
TARGET=$out/lib/ycmd/third_party/tsserver
75
ln -sf ${nodePackages.typescript} $TARGET
76
'';
···
79
# python won't be thrown off by argv[0]
80
postFixup = ''
81
substituteInPlace $out/lib/ycmd/ycmd/__main__.py \
82
-
--replace $out/lib/ycmd/ycmd/__main__.py \
83
-
$out/bin/ycmd \
84
-
--replace __file__ \
85
-
"'$out/lib/ycmd/ycmd/__main__.py'"
86
'';
87
88
meta = with lib; {
···
1
{ stdenv, lib, fetchgit, cmake, llvmPackages, boost, python
2
+
, withGocode ? true, gocode
3
+
, withGodef ? true, godef
4
+
, withGotools? true, gotools
5
+
, withTypescript ? true, nodePackages
6
+
, fixDarwinDylibNames, Cocoa
7
}:
8
9
stdenv.mkDerivation {
10
pname = "ycmd";
11
+
version = "unstable-2020-02-22";
12
disabled = !python.isPy3k;
13
14
+
# required for third_party directory creation
15
src = fetchgit {
16
url = "https://github.com/Valloric/ycmd.git";
17
rev = "9a6b86e3a156066335b678c328f226229746bae5";
···
21
nativeBuildInputs = [ cmake ]
22
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
23
buildInputs = [ boost llvmPackages.libclang ]
24
+
++ lib.optional stdenv.isDarwin Cocoa;
25
26
buildPhase = ''
27
export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
···
59
mkdir -p $out/lib/ycmd/third_party
60
cp -r third_party/* $out/lib/ycmd/third_party/
61
62
+
'' + lib.optionalString withGocode ''
63
TARGET=$out/lib/ycmd/third_party/gocode
64
mkdir -p $TARGET
65
ln -sf ${gocode}/bin/gocode $TARGET
66
+
'' + lib.optionalString withGodef ''
67
TARGET=$out/lib/ycmd/third_party/godef
68
mkdir -p $TARGET
69
ln -sf ${godef}/bin/godef $TARGET
70
+
'' + lib.optionalString withGotools ''
71
TARGET=$out/lib/ycmd/third_party/go/src/golang.org/x/tools/cmd/gopls
72
mkdir -p $TARGET
73
ln -sf ${gotools}/bin/gopls $TARGET
74
+
'' + lib.optionalString withTypescript ''
75
TARGET=$out/lib/ycmd/third_party/tsserver
76
ln -sf ${nodePackages.typescript} $TARGET
77
'';
···
80
# python won't be thrown off by argv[0]
81
postFixup = ''
82
substituteInPlace $out/lib/ycmd/ycmd/__main__.py \
83
+
--replace $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd \
84
+
--replace __file__ "'$out/lib/ycmd/ycmd/__main__.py'"
0
0
85
'';
86
87
meta = with lib; {