git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit8bc10fbc56db2aaf1f234349e4d0c7607b8ead4f authorMatthew Bauer <mjbauer95@gmail.com> dateSat 12 Jun 2021, 11:21 (5 years ago) parent65db035
6 files changed+16−10
pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix+2−1 pkgs/build-support/emacs/elpa.nix+2−2 pkgs/build-support/emacs/generic.nix+3−1 pkgs/build-support/emacs/melpa.nix+2−2 pkgs/build-support/emacs/wrapper.nix+5−2 pkgs/top-level/emacs-packages.nix+2−2
pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix+2−1
@@ -21,7 +21,7 @@ formats commits for you.
2121
2222*/
2323
24−{ lib, stdenv, texinfo, writeText }:
24+{ lib, stdenv, texinfo, writeText, gcc }:
2525
2626self: let
2727
@@ -34,6 +34,7 @@ self: let
3434 elpaBuild = import ../../../../build-support/emacs/elpa.nix {
3535 inherit lib stdenv texinfo writeText;
3636 inherit (self) emacs;
37+ inherit gcc;
3738 };
3839
3940 generateElpa = lib.makeOverridable ({
pkgs/build-support/emacs/elpa.nix+2−2
@@ -1,6 +1,6 @@
11# builder for Emacs packages built for packages.el
22
3−{ lib, stdenv, emacs, texinfo, writeText }:
3+{ lib, stdenv, emacs, texinfo, writeText, gcc }:
44
55with lib;
66
@@ -19,7 +19,7 @@ let
1919
2020in
2121
22−import ./generic.nix { inherit lib stdenv emacs texinfo writeText; } ({
22+import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
2323
2424 phases = "installPhase fixupPhase distPhase";
2525
pkgs/build-support/emacs/generic.nix+3−1
@@ -1,6 +1,6 @@
11# generic builder for Emacs packages
22
3−{ lib, stdenv, emacs, texinfo, writeText, ... }:
3+{ lib, stdenv, emacs, texinfo, writeText, gcc, ... }:
44
55with lib;
66
@@ -72,6 +72,8 @@ stdenv.mkDerivation ({
7272
7373 LIBRARY_PATH = "${lib.getLib stdenv.cc.libc}/lib";
7474
75+ nativeBuildInputs = [ gcc ];
76+
7577 addEmacsNativeLoadPath = true;
7678
7779 postInstall = ''
pkgs/build-support/emacs/melpa.nix+2−2
@@ -1,7 +1,7 @@
11# builder for Emacs packages built for packages.el
22# using MELPA package-build.el
33
4−{ lib, stdenv, fetchFromGitHub, emacs, texinfo, writeText }:
4+{ lib, stdenv, fetchFromGitHub, emacs, texinfo, writeText, gcc }:
55
66with lib;
77
@@ -28,7 +28,7 @@ let
2828
2929in
3030
31−import ./generic.nix { inherit lib stdenv emacs texinfo writeText; } ({
31+import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
3232
3333 ename =
3434 if ename == null
pkgs/build-support/emacs/wrapper.nix+5−2
@@ -32,7 +32,7 @@ in customEmacsPackages.emacs.pkgs.withPackages (epkgs: [ epkgs.evil epkgs.magit
3232
3333*/
3434
35−{ lib, lndir, makeWrapper, runCommand }: self:
35+{ lib, lndir, makeWrapper, runCommand, gcc }: self:
3636
3737with lib;
3838
@@ -65,7 +65,10 @@ runCommand
6565 # Store all paths we want to add to emacs here, so that we only need to add
6666 # one path to the load lists
6767 deps = runCommand "emacs-packages-deps"
68− { inherit explicitRequires lndir emacs; }
68+ {
69+ inherit explicitRequires lndir emacs;
70+ nativeBuildInputs = lib.optional nativeComp gcc;
71+ }
6972 ''
7073 findInputsOld() {
7174 local pkg="$1"; shift
pkgs/top-level/emacs-packages.nix+2−2
@@ -26,7 +26,7 @@
2626let
2727
2828 mkElpaPackages = { pkgs, lib }: import ../applications/editors/emacs/elisp-packages/elpa-packages.nix {
29− inherit (pkgs) stdenv texinfo writeText;
29+ inherit (pkgs) stdenv texinfo writeText gcc;
3030 inherit lib;
3131 };
3232
@@ -44,7 +44,7 @@ let
4444 };
4545
4646 emacsWithPackages = { pkgs, lib }: import ../build-support/emacs/wrapper.nix {
47− inherit (pkgs) makeWrapper runCommand;
47+ inherit (pkgs) makeWrapper runCommand gcc;
4848 inherit (pkgs.xorg) lndir;
4949 inherit lib;
5050 };