emacs: Add native builds for nativeComp enabled emacsen

gstqt5
adisbladis 2020-07-23 21:34:55 +02:00
parent bf9e3b8dbf
commit e890823467
No known key found for this signature in database
GPG Key ID: 110BFAD44C6249B7
1 changed files with 10 additions and 0 deletions

View File

@ -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"
])