diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 48474bc4b7cd..583ff9eb5f3b 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -166,37 +166,29 @@ stdenv.mkDerivation (finalAttrs: { patches = patches fetchpatch ++ lib.optionals withNativeCompilation [ - (replaceVars - ( - if lib.versionOlder finalAttrs.version "30" then - ./native-comp-driver-options.patch - else - ./native-comp-driver-options-30.patch - ) - { - backendPath = ( - lib.concatStringsSep " " ( - map (x: ''"-B${x}"'') ( - [ - # Paths necessary so the JIT compiler finds its libraries: - "${lib.getLib libgccjit}/lib" - ] - ++ libGccJitLibraryPaths - ++ [ - # Executable paths necessary for compilation (ld, as): - "${lib.getBin stdenv.cc.cc}/bin" - "${lib.getBin stdenv.cc.bintools}/bin" - "${lib.getBin stdenv.cc.bintools.bintools}/bin" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # The linker needs to know where to find libSystem on Darwin. - "${apple-sdk.sdkroot}/usr/lib" - ] - ) + (replaceVars ./native-comp-driver-options-30.patch { + backendPath = ( + lib.concatStringsSep " " ( + map (x: ''"-B${x}"'') ( + [ + # Paths necessary so the JIT compiler finds its libraries: + "${lib.getLib libgccjit}/lib" + ] + ++ libGccJitLibraryPaths + ++ [ + # Executable paths necessary for compilation (ld, as): + "${lib.getBin stdenv.cc.cc}/bin" + "${lib.getBin stdenv.cc.bintools}/bin" + "${lib.getBin stdenv.cc.bintools.bintools}/bin" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # The linker needs to know where to find libSystem on Darwin. + "${apple-sdk.sdkroot}/usr/lib" + ] ) - ); - } - ) + ) + ); + }) ]; postPatch = lib.concatStringsSep "\n" [ diff --git a/pkgs/applications/editors/emacs/native-comp-driver-options.patch b/pkgs/applications/editors/emacs/native-comp-driver-options.patch deleted file mode 100644 index 58eee35aed0a..000000000000 --- a/pkgs/applications/editors/emacs/native-comp-driver-options.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el -index 2c9b79334b..50c6b5ac85 100644 ---- a/lisp/emacs-lisp/comp.el -+++ b/lisp/emacs-lisp/comp.el -@@ -178,8 +178,9 @@ native-comp-compiler-options - :type '(repeat string) - :version "28.1") - --(defcustom native-comp-driver-options (when (eq system-type 'darwin) -- '("-Wl,-w")) -+(defcustom native-comp-driver-options (append (when (eq system-type 'darwin) -+ '("-Wl,-w")) -+ '(@backendPath@)) - "Options passed verbatim to the native compiler's back-end driver. - Note that not all options are meaningful; typically only the options - affecting the assembler and linker are likely to be useful. --- -2.37.3 -