nixpkgs/pkgs/build-support/emacs/elpa.nix
Matthew Bauer 8bc10fbc56 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.
2021-06-23 23:02:11 -05:00

42 lines
746 B
Nix

# builder for Emacs packages built for packages.el
{ lib, stdenv, emacs, texinfo, writeText, gcc }:
with lib;
{ pname
, version
, src
, meta ? {}
, ...
}@args:
let
defaultMeta = {
homepage = args.src.meta.homepage or "https://elpa.gnu.org/packages/${pname}.html";
};
in
import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; } ({
phases = "installPhase fixupPhase distPhase";
installPhase = ''
runHook preInstall
emacs --batch -Q -l ${./elpa2nix.el} \
-f elpa2nix-install-package \
"${src}" "$out/share/emacs/site-lisp/elpa"
runHook postInstall
'';
meta = defaultMeta // meta;
}
// removeAttrs args [ "files" "fileSpecs"
"meta"
])