diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 1ac714c155750..24f722bf37b1b 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -31,6 +31,11 @@ lib.makeScope pkgs.newScope ( withPgtk = true; }; - emacs29-macport = callPackage (self.sources.emacs29-macport) inheritedArgs; + emacs29-macport = callPackage (self.sources.emacs29-macport) ( + inheritedArgs + // { + srcRepo = true; + } + ); } ) diff --git a/pkgs/applications/editors/emacs/macport-noescape-noop/CoreFoundation/CFBase.h b/pkgs/applications/editors/emacs/macport-noescape-noop/CoreFoundation/CFBase.h new file mode 100644 index 0000000000000..2ade833151efc --- /dev/null +++ b/pkgs/applications/editors/emacs/macport-noescape-noop/CoreFoundation/CFBase.h @@ -0,0 +1,8 @@ +#if !defined(__COREFOUNDATION_CFBASE__) + +#include_next + +#undef CF_NOESCAPE +#define CF_NOESCAPE + +#endif diff --git a/pkgs/applications/editors/emacs/macport_noescape_noop.h b/pkgs/applications/editors/emacs/macport_noescape_noop.h deleted file mode 100644 index 64c65bd90f880..0000000000000 --- a/pkgs/applications/editors/emacs/macport_noescape_noop.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef NOESCAPE_NOOP_H_ -#define NOESCAPE_NOOP_H_ - -// First, do some work to get definitions for *_WIDTH. Normally, Emacs would -// have these defined by headers in-tree, but clang's headers clash with those. -// Due to how include paths work, we have to include clang headers if we want to -// mess with CoreFoundation definitions. -#pragma push_macro("__STDC_VERSION__") -// Make the preprocessor think that we're on C2x. The macros we want are gated -// on it. -#undef __STDC_VERSION__ -#define __STDC_VERSION__ 202000L -// Include limits.h first, as stdint.h includes it. -#include - -// XX: clang's stdint.h is shy and won't give us its defs unless it thinks it's -// in freestanding mode. -#undef __STDC_HOSTED__ -#include -#define __STDC_HOSTED__ 1 - -#pragma pop_macro("__STDC_VERSION__") - -// Now, pull in the header that defines CF_NOESCAPE. -#include - -// Redefine CF_NOESCAPE as empty. -#undef CF_NOESCAPE -#define CF_NOESCAPE - -#endif // NOESCAPE_NOOP_H_ diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index b9f75464c7936..cc5df12f973e8 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -45,7 +45,6 @@ libtiff, libwebp, libxml2, - llvmPackages_14, m17n_lib, mailcap, mailutils, @@ -139,12 +138,8 @@ let ++ lib.optionals (stdenv.cc ? cc.lib.libgcc) [ "${lib.getLib stdenv.cc.cc.lib.libgcc}/lib" ]; - - inherit (if variant == "macport" then llvmPackages_14.stdenv else stdenv) - mkDerivation - ; in -mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = pname + ( @@ -430,7 +425,7 @@ mkDerivation (finalAttrs: { // lib.optionalAttrs (variant == "macport") { # Fixes intermittent segfaults when compiled with LLVM >= 7.0. # See https://github.com/NixOS/nixpkgs/issues/127902 - NIX_CFLAGS_COMPILE = "-include ${./macport_noescape_noop.h}"; + NIX_CFLAGS_COMPILE = "-isystem ${./macport-noescape-noop}"; }; enableParallelBuilding = true;