From e5e43e6beb418dbd2900fb692b1e8e6585f2cbcb Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 4 Jun 2023 22:06:36 -0300 Subject: [PATCH] emacs generic: rename attributes Namely: - treeSitter -> withTreeSitter - nativeComp -> withNativeCompilation --- pkgs/applications/editors/emacs/generic.nix | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index b73079fbd282..4a981930e549 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -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; }; };