summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper/default.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2016-10-07 10:31:37 -0400
committerShea Levy <shea@shealevy.com>2016-10-07 10:31:37 -0400
commiteca0f17ad20e9604a60efa57c7fa717ee2c8f1b7 (patch)
tree870caa66f96c5b8da71e271b4e6a1bfa893fa38b /pkgs/build-support/cc-wrapper/default.nix
parentdaf4e57577d0e67c9f4e92d172d3cc83b8c6b82d (diff)
downloadnixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar.gz
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar.bz2
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar.lz
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar.xz
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.tar.zst
nixpkgs-eca0f17ad20e9604a60efa57c7fa717ee2c8f1b7.zip
nix-buffer support improvements.
Use inherit-local, add per-package elisp hooks.
Diffstat (limited to 'pkgs/build-support/cc-wrapper/default.nix')
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index 8a746ea016e..8a9bd3ecb4d 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -46,7 +46,20 @@ stdenv.mkDerivation {
   inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
   gnugrep_bin = if nativeTools then "" else gnugrep;
 
-  passthru = { inherit libc nativeTools nativeLibc nativePrefix isGNU isClang; };
+  passthru = {
+    inherit libc nativeTools nativeLibc nativePrefix isGNU isClang;
+
+    emacsBufferSetup = pkgs: ''
+      ; We should handle propagation here too
+      (mapc (lambda (arg)
+        (when (file-directory-p (concat arg "/include"))
+          (setenv "NIX_CFLAGS_COMPILE" (concat (getenv "NIX_CFLAGS_COMPILE") " -isystem " arg "/include")))
+        (when (file-directory-p (concat arg "/lib"))
+          (setenv "NIX_LDFLAGS" (concat (getenv "NIX_LDFLAGS") " -L" arg "/lib")))
+        (when (file-directory-p (concat arg "/lib64"))
+          (setenv "NIX_LDFLAGS" (concat (getenv "NIX_LDFLAGS") " -L" arg "/lib64")))) '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
+    '';
+  };
 
   buildCommand =
     ''