emacs generic: rename attributes

Namely:

- treeSitter -> withTreeSitter
- nativeComp -> withNativeCompilation
This commit is contained in:
Anderson Torres 2023-06-04 22:06:36 -03:00
parent 196d71b295
commit e5e43e6beb

View file

@ -72,7 +72,11 @@
, WebKit
# Boolean flags
, nativeComp ? true
, nativeComp ? null
, withNativeCompilation ?
if nativeComp != null
then lib.warn "nativeComp option is deprecated and will be removed; use withNativeCompilation instead" nativeComp
else true
, noGui ? false
, srcRepo ? true
, withAcl ? false
@ -132,7 +136,7 @@ let
then llvmPackages_6.stdenv
else stdenv) mkDerivation;
in
mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
mkDerivation (finalAttrs: (lib.optionalAttrs withNativeCompilation {
env = {
NATIVE_FULL_AOT = "1";
LIBRARY_PATH = lib.concatStringsSep ":" libGccJitLibraryPaths;
@ -140,7 +144,7 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
} // {
pname = pname
+ (if noGui then "-nox"
else if (variant == "macport") then "-macport"
else if variant == "macport" then "-macport"
else if withPgtk then "-pgtk"
else if withGTK3 then "-gtk3"
else if withGTK2 then "-gtk2"
@ -149,7 +153,7 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
inherit src;
patches = patches fetchpatch ++ lib.optionals nativeComp [
patches = patches fetchpatch ++ lib.optionals withNativeCompilation [
(substituteAll {
src = if lib.versionOlder finalAttrs.version "29"
then ./native-comp-driver-options-28.patch
@ -241,7 +245,7 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
motif
] ++ lib.optionals (withX && withXwidgets) [
glib-networking
] ++ lib.optionals nativeComp [
] ++ lib.optionals withNativeCompilation [
libgccjit
] ++ lib.optionals withImageMagick [
imagemagick
@ -324,7 +328,7 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
]
++ (lib.optional stdenv.isDarwin (lib.withFeature withNS "ns"))
++ lib.optional (!withToolkitScrollBars) "--without-toolkit-scroll-bars"
++ lib.optional nativeComp "--with-native-compilation"
++ lib.optional withNativeCompilation "--with-native-compilation"
++ lib.optional withImageMagick "--with-imagemagick"
++ lib.optional withTreeSitter "--with-tree-sitter"
++ lib.optional withXinput2 "--with-xinput2"
@ -355,9 +359,9 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
'' + lib.optionalString withNS ''
mkdir -p $out/Applications
mv nextstep/Emacs.app $out/Applications
'' + lib.optionalString (nativeComp && (withNS || variant == "macport")) ''
'' + lib.optionalString (withNativeCompilation && (withNS || variant == "macport")) ''
ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp
'' + lib.optionalString nativeComp ''
'' + lib.optionalString withNativeCompilation ''
echo "Generating native-compiled trampolines..."
# precompile trampolines in parallel, but avoid spawning one process per trampoline.
# 1000 is a rough lower bound on the number of trampolines compiled.
@ -378,8 +382,8 @@ mkDerivation (finalAttrs: (lib.optionalAttrs nativeComp {
'';
passthru = {
inherit nativeComp;
treeSitter = withTreeSitter;
inherit withNativeCompilation;
inherit withTreeSitter;
pkgs = recurseIntoAttrs (emacsPackagesFor finalAttrs.finalPackage);
tests = { inherit (nixosTests) emacs-daemon; };
};