Skip to content

Commit

Permalink
emacs: Add native builds for nativeComp enabled emacsen
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Jul 24, 2020
1 parent bf9e3b8 commit e890823
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkgs/build-support/emacs/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ stdenv.mkDerivation ({
meta = defaultMeta // meta;
}

// lib.optionalAttrs (emacs.nativeComp or false) {

LIBRARY_PATH = "${lib.getLib stdenv.cc.libc}/lib";

postInstall = ''
find $out/share/emacs -type f -name '*.el' -print0 | xargs -0 -n 1 -I {} -P $NIX_BUILD_CORES sh -c "emacs --batch -f batch-native-compile {} || true"
'';

}

// removeAttrs args [ "buildInputs" "packageRequires"
"meta"
])

0 comments on commit e890823

Please sign in to comment.