Add gcc for emacs wrapper so native-comp works

On macos, we don’t have a gcc executable by default, which is required
for some reason when compiling site-start.
This commit is contained in:
Matthew Bauer 2021-06-12 11:21:35 -05:00
parent 65db0350fe
commit 8bc10fbc56
6 changed files with 16 additions and 10 deletions

View file

@ -21,7 +21,7 @@ formats commits for you.
*/ */
{ lib, stdenv, texinfo, writeText }: { lib, stdenv, texinfo, writeText, gcc }:
self: let self: let
@ -34,6 +34,7 @@ self: let
elpaBuild = import ../../../../build-support/emacs/elpa.nix { elpaBuild = import ../../../../build-support/emacs/elpa.nix {
inherit lib stdenv texinfo writeText; inherit lib stdenv texinfo writeText;
inherit (self) emacs; inherit (self) emacs;
inherit gcc;
}; };
generateElpa = lib.makeOverridable ({ generateElpa = lib.makeOverridable ({

View file

@ -1,6 +1,6 @@
# builder for Emacs packages built for packages.el # builder for Emacs packages built for packages.el
{ lib, stdenv, emacs, texinfo, writeText }: { lib, stdenv, emacs, texinfo, writeText, gcc }:
with lib; with lib;
@ -19,7 +19,7 @@ let
in in
import ./generic.nix { inherit lib stdenv emacs texinfo writeText; } ({ import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
phases = "installPhase fixupPhase distPhase"; phases = "installPhase fixupPhase distPhase";

View file

@ -1,6 +1,6 @@
# generic builder for Emacs packages # generic builder for Emacs packages
{ lib, stdenv, emacs, texinfo, writeText, ... }: { lib, stdenv, emacs, texinfo, writeText, gcc, ... }:
with lib; with lib;
@ -72,6 +72,8 @@ stdenv.mkDerivation ({
LIBRARY_PATH = "${lib.getLib stdenv.cc.libc}/lib"; LIBRARY_PATH = "${lib.getLib stdenv.cc.libc}/lib";
nativeBuildInputs = [ gcc ];
addEmacsNativeLoadPath = true; addEmacsNativeLoadPath = true;
postInstall = '' postInstall = ''

View file

@ -1,7 +1,7 @@
# builder for Emacs packages built for packages.el # builder for Emacs packages built for packages.el
# using MELPA package-build.el # using MELPA package-build.el
{ lib, stdenv, fetchFromGitHub, emacs, texinfo, writeText }: { lib, stdenv, fetchFromGitHub, emacs, texinfo, writeText, gcc }:
with lib; with lib;
@ -28,7 +28,7 @@ let
in in
import ./generic.nix { inherit lib stdenv emacs texinfo writeText; } ({ import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
ename = ename =
if ename == null if ename == null

View file

@ -32,7 +32,7 @@ in customEmacsPackages.emacs.pkgs.withPackages (epkgs: [ epkgs.evil epkgs.magit
*/ */
{ lib, lndir, makeWrapper, runCommand }: self: { lib, lndir, makeWrapper, runCommand, gcc }: self:
with lib; with lib;
@ -65,7 +65,10 @@ runCommand
# Store all paths we want to add to emacs here, so that we only need to add # Store all paths we want to add to emacs here, so that we only need to add
# one path to the load lists # one path to the load lists
deps = runCommand "emacs-packages-deps" deps = runCommand "emacs-packages-deps"
{ inherit explicitRequires lndir emacs; } {
inherit explicitRequires lndir emacs;
nativeBuildInputs = lib.optional nativeComp gcc;
}
'' ''
findInputsOld() { findInputsOld() {
local pkg="$1"; shift local pkg="$1"; shift

View file

@ -26,7 +26,7 @@
let let
mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix { mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
inherit (pkgs) stdenv texinfo writeText; inherit (pkgs) stdenv texinfo writeText gcc;
inherit lib; inherit lib;
}; };
@ -44,7 +44,7 @@ let
}; };
emacsWithPackages = { pkgs, lib }: import ../build-support/emacs/wrapper.nix { emacsWithPackages = { pkgs, lib }: import ../build-support/emacs/wrapper.nix {
inherit (pkgs) makeWrapper runCommand; inherit (pkgs) makeWrapper runCommand gcc;
inherit (pkgs.xorg) lndir; inherit (pkgs.xorg) lndir;
inherit lib; inherit lib;
}; };