summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/emacs
diff options
context:
space:
mode:
authorAndreas Fuchs <asf@boinkor.net>2020-08-31 00:47:33 -0400
committerAndreas Fuchs <asf@boinkor.net>2020-08-31 00:47:33 -0400
commit6ad323d0a02cf2afd857a4f30cfce8277a0e11cd (patch)
treed63c3dd4be54e18773a3fb28f93d7d4007125ab6 /pkgs/applications/editors/emacs
parent3384837123766c806c0b925053799e641077f570 (diff)
emacs: use -B flags for native compilation dependencies
The -B flag to gcc (and libgccjit) allows us to specify where it can find things it needs to correctly compile code (both programs and libraries) without adjusting any environmental flags: So, no need to wrap the program for a PATH entry containing binutils, and no need to explicitly pass a linker path anymore.
Diffstat (limited to 'pkgs/applications/editors/emacs')
-rw-r--r--pkgs/applications/editors/emacs/generic.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix
index 46c6a982d404..b2d9b9a1367f 100644
--- a/pkgs/applications/editors/emacs/generic.nix
+++ b/pkgs/applications/editors/emacs/generic.nix
@@ -68,11 +68,15 @@ in stdenv.mkDerivation {
# Make native compilation work both inside and outside of nix build
(lib.optionalString nativeComp (let
libPath = (lib.concatStringsSep " "
- (builtins.map (x: ''\"-L${x}\"'') [
+ (builtins.map (x: ''\"-B${x}\"'') [
"${lib.getLib libgccjit}/lib"
"${lib.getLib libgccjit}/lib/gcc/${targetPlatform.config}/${libgccjit.version}"
"${lib.getLib stdenv.cc.cc}/lib"
"${lib.getLib stdenv.cc.libc}/lib"
+ "${lib.getBin stdenv.cc.cc}"
+ "${lib.getBin stdenv.cc.cc}"
+ "${lib.getBin stdenv.cc.bintools}"
+ "${lib.getBin stdenv.cc.bintools.bintools}"
]));
in ''
substituteInPlace lisp/emacs-lisp/comp.el --replace \
@@ -156,11 +160,6 @@ in stdenv.mkDerivation {
"$out/bin/emacs"
patchelf --add-needed "libXcursor.so.1" "$out/bin/emacs"
'')
-
- (lib.optionalString nativeComp ''
- wrapProgram $out/bin/emacs-* --prefix PATH : "${lib.makeBinPath [ stdenv.cc.bintools stdenv.cc.bintools.bintools ]}"
- '')
-
];
passthru = {