summary refs log tree commit diff
path: root/pkgs/misc/vim-plugins
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-06-08 19:00:40 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-06-08 19:50:40 +0100
commite2197465c16a3c04935eb892d6485b7551dd65f5 (patch)
treebcce7ea2f201fb45e9c3f9016e4f00822f5fdb96 /pkgs/misc/vim-plugins
parent3cb5d52dacba10121f7a20dbbd18a856f849a3a7 (diff)
downloadnixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar.gz
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar.bz2
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar.lz
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar.xz
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.tar.zst
nixlib-e2197465c16a3c04935eb892d6485b7551dd65f5.zip
cc-wrapper: externalize default_cxx_stdlib_compile
This value is require to get c++ std include path for libclang based tools (vim plugins in my case).
I currently extract it this with this rather command:

```
eval echo $(nix-instantiate --eval --expr 'with (import <nixpkgs>) {}; clang.default_cxx_stdlib_compile')
```

it did not trigger any recompilation on my system.
Diffstat (limited to 'pkgs/misc/vim-plugins')
-rw-r--r--pkgs/misc/vim-plugins/default.nix7
-rw-r--r--pkgs/misc/vim-plugins/vim2nix/additional-nix-code/clang_complete7
2 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index 09e4d365f171..416262f9e1e9 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -293,6 +293,13 @@ rec {
       sha256 = "19zs03giv8h5xmv18y9zn85sxr8akphvbscclrqhs4cf88285cgl";
     };
     dependencies = [];
+    # In addition to the arguments you pass to your compiler, you also need to
+    # specify the path of the C++ std header (if you are using C++).
+    # These usually implicitly set by cc-wrapper around clang (pkgs/build-support/cc-wrapper).
+    # The linked ruby code shows generates the required '.clang_complete' for cmake based projects
+    # https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144
+    # as an alternative you can execute the following command:
+    # $ eval echo $(nix-instantiate --eval --expr 'with (import <nixpkgs>) {}; clang.default_cxx_stdlib_compile')
     preFixup = ''
       substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/clang_complete.vim \
         --replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.clang.cc}/lib/libclang.so'"
diff --git a/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/clang_complete b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/clang_complete
index 64e064e2a460..ed88e08742ed 100644
--- a/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/clang_complete
+++ b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/clang_complete
@@ -1,3 +1,10 @@
+    # In addition to the arguments you pass to your compiler, you also need to
+    # specify the path of the C++ std header (if you are using C++).
+    # These usually implicitly set by cc-wrapper around clang (pkgs/build-support/cc-wrapper).
+    # The linked ruby code shows generates the required '.clang_complete' for cmake based projects
+    # https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144
+    # as an alternative you can execute the following command:
+    # $ eval echo $(nix-instantiate --eval --expr 'with (import <nixpkgs>) {}; clang.default_cxx_stdlib_compile')
     preFixup = ''
       substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/clang_complete.vim \
         --replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.clang.cc}/lib/libclang.so'"