mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
Merge #328573: emacs: add two parameters to genericBuild to control errors
...into staging-next
This commit is contained in:
commit
94db461e53
@ -27,6 +27,8 @@ in
|
||||
, buildInputs ? []
|
||||
, packageRequires ? []
|
||||
, meta ? {}
|
||||
, turnCompilationWarningToError ? false
|
||||
, ignoreCompilationError ? true
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
@ -73,6 +75,8 @@ stdenv.mkDerivation (finalAttrs: ({
|
||||
|
||||
addEmacsNativeLoadPath = true;
|
||||
|
||||
inherit turnCompilationWarningToError ignoreCompilationError;
|
||||
|
||||
postInstall = ''
|
||||
# Besides adding the output directory to the native load path, make sure
|
||||
# the current package's elisp files are in the load path, otherwise
|
||||
@ -82,8 +86,13 @@ stdenv.mkDerivation (finalAttrs: ({
|
||||
addEmacsVars "$out"
|
||||
|
||||
find $out/share/emacs -type f -name '*.el' -print0 \
|
||||
| xargs -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \
|
||||
"emacs --batch --eval '(setq large-file-warning-threshold nil)' -f batch-native-compile {} || true"
|
||||
| xargs --verbose -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \
|
||||
"emacs \
|
||||
--batch \
|
||||
--eval '(setq large-file-warning-threshold nil)' \
|
||||
--eval '(setq byte-compile-error-on-warn ${if finalAttrs.turnCompilationWarningToError then "t" else "nil"})' \
|
||||
-f batch-native-compile {} \
|
||||
|| exit ${if finalAttrs.ignoreCompilationError then "0" else "\\$?"}"
|
||||
'';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user