Merge pull request #69045 from rycee/emacs-wrapper-using-runcommand

emacs: use runCommand to generate wrapper
This commit is contained in:
adisbladis 2019-09-27 12:58:38 +01:00 committed by GitHub
commit 17a388d9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 92 additions and 89 deletions

View File

@ -32,7 +32,7 @@ in customEmacsPackages.emacsWithPackages (epkgs: [ epkgs.evil epkgs.magit ])
*/
{ lib, lndir, makeWrapper, runCommand, stdenv }: self:
{ lib, lndir, makeWrapper, runCommand }: self:
with lib; let inherit (self) emacs; in
@ -45,11 +45,15 @@ let
else packagesFun;
in
stdenv.mkDerivation {
name = (appendToName "with-packages" emacs).name;
runCommand
(appendToName "with-packages" emacs).name
{
nativeBuildInputs = [ emacs lndir makeWrapper ];
inherit emacs explicitRequires;
preferLocalBuild = true;
allowSubstitutes = false;
# Store all paths we want to add to emacs here, so that we only need to add
# one path to the load lists
deps = runCommand "emacs-packages-deps"
@ -142,8 +146,9 @@ EOF
$emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs"
'';
phases = [ "installPhase" ];
installPhase = ''
inherit (emacs) meta;
}
''
mkdir -p "$out/bin"
# Wrap emacs and friends so they find our site-start.el before the original.
@ -172,6 +177,4 @@ EOF
for dir in applications icons info man; do
ln -s $emacs/share/$dir $out/share/$dir
done
'';
inherit (emacs) meta;
}
''

View File

@ -60,7 +60,7 @@ let
};
emacsWithPackages = import ../build-support/emacs/wrapper.nix {
inherit lib lndir makeWrapper stdenv runCommand;
inherit lib lndir makeWrapper runCommand;
};
mkManualPackages = import ../applications/editors/emacs-modes/manual-packages.nix {