nix-buffer support improvements.

Use inherit-local, add per-package elisp hooks.
This commit is contained in:
Shea Levy
2016-10-07 10:31:37 -04:00
parent daf4e57577
commit eca0f17ad2
4 changed files with 69 additions and 16 deletions
+14 -1
View File
@@ -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 =
''