diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 8640d64786b37..75461dc60c78c 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -6,21 +6,6 @@ lib.makeScope pkgs.newScope ( inherit (self) callPackage; inheritedArgs = { inherit (pkgs.darwin) sigtool; - inherit (pkgs.darwin.apple_sdk.frameworks) - Accelerate - AppKit - Carbon - Cocoa - GSS - ImageCaptureCore - ImageIO - IOKit - OSAKit - Quartz - QuartzCore - WebKit - ; - inherit (pkgs.darwin.apple_sdk_11_0.frameworks) UniformTypeIdentifiers; }; in { @@ -28,6 +13,7 @@ lib.makeScope pkgs.newScope ( inherit lib; inherit (pkgs) fetchFromBitbucket + fetchFromGitHub fetchFromSavannah ; }; @@ -46,8 +32,6 @@ lib.makeScope pkgs.newScope ( withPgtk = true; }; - emacs28-macport = callPackage (self.sources.emacs28-macport) inheritedArgs; - - emacs29-macport = callPackage (self.sources.emacs29-macport) inheritedArgs; + emacs30-macport = callPackage (self.sources.emacs30-macport) inheritedArgs; } ) diff --git a/pkgs/applications/editors/emacs/macport-stdbool.patch b/pkgs/applications/editors/emacs/macport-stdbool.patch new file mode 100644 index 0000000000000..5d3e71ed3942e --- /dev/null +++ b/pkgs/applications/editors/emacs/macport-stdbool.patch @@ -0,0 +1,12 @@ +diff --git a/src/conf_post.h b/src/conf_post.h +index e3272278832..01d3bcf9a81 100644 +--- a/src/conf_post.h ++++ b/src/conf_post.h +@@ -58,6 +58,7 @@ along with GNU Emacs. If not, see . */ + #if NS_IMPL_GNUSTEP || defined __MINGW32__ + typedef unsigned int bool_bf; + #else ++#include /* Clang in C mode does not automatically define bool unless you explicitly include that header */ + typedef bool bool_bf; + #endif + diff --git a/pkgs/applications/editors/emacs/macport_noescape_noop.h b/pkgs/applications/editors/emacs/macport_noescape_noop.h index 64c65bd90f880..66accdd04faf5 100644 --- a/pkgs/applications/editors/emacs/macport_noescape_noop.h +++ b/pkgs/applications/editors/emacs/macport_noescape_noop.h @@ -1,3 +1,7 @@ +#if __has_include("config.h") +#include "config.h" +#endif + #ifndef NOESCAPE_NOOP_H_ #define NOESCAPE_NOOP_H_ diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index ef8a5d923822e..49468aeb80ec8 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -13,7 +13,7 @@ Xaw3d, acl, alsa-lib, - apple-sdk, + apple-sdk_14, autoreconfHook, cairo, dbus, @@ -114,21 +114,6 @@ "lucid" ), - # macOS dependencies for NS and macPort - Accelerate, - AppKit, - Carbon, - Cocoa, - GSS, - IOKit, - ImageCaptureCore, - ImageIO, - OSAKit, - Quartz, - QuartzCore, - UniformTypeIdentifiers, - WebKit, - # test callPackage, }: @@ -205,7 +190,7 @@ mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # The linker needs to know where to find libSystem on Darwin. - "${apple-sdk.sdkroot}/usr/lib" + "${apple-sdk_14.sdkroot}/usr/lib" ] ) ) @@ -372,27 +357,6 @@ mkDerivation (finalAttrs: { ] ++ lib.optionals withNS [ librsvg - AppKit - GSS - ImageIO - ] - ++ lib.optionals (variant == "macport") [ - Accelerate - AppKit - Carbon - Cocoa - IOKit - OSAKit - Quartz - QuartzCore - WebKit - # TODO are these optional? - GSS - ImageCaptureCore - ImageIO - ] - ++ lib.optionals (variant == "macport" && stdenv.hostPlatform.isAarch64) [ - UniformTypeIdentifiers ]; # Emacs needs to find movemail at run time, see info (emacs) Movemail diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 952d8e5aeab7e..ebc99e067f869 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -1,6 +1,7 @@ { lib, fetchFromBitbucket, + fetchFromGitHub, fetchFromSavannah, }: @@ -31,8 +32,8 @@ let } ); "macport" = ( - fetchFromBitbucket { - owner = "mituharu"; + fetchFromGitHub { + owner = "jdtsmith"; repo = "emacs-mac"; inherit rev hash; } @@ -88,7 +89,9 @@ let matthewbauer panchoh ]; - "macport" = with lib.maintainers; [ ]; + "macport" = with lib.maintainers; [ + lactose + ]; } .${variant}; platforms = @@ -121,40 +124,12 @@ in ]; }); - emacs28-macport = import ./make-emacs.nix (mkArgs { - pname = "emacs-mac"; - version = "28.2"; - variant = "macport"; - rev = "emacs-28.2-mac-9.1"; - hash = "sha256-Ne2jQ2nVLNiQmnkkOXVc5AkLVkTpm8pFC7VNY2gQjPE="; - patches = fetchpatch: [ - # CVE-2022-45939 - (fetchpatch { - url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=d48bb4874bc6cd3e69c7a15fc3c91cc141025c51"; - hash = "sha256-TiBQkexn/eb6+IqJNDqR/Rn7S7LVdHmL/21A5tGsyJs="; - }) - - # https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00611.html - (fetchpatch { - url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/10_all_org-macro-eval.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6"; - hash = "sha256-OdGt4e9JGjWJPkfJhbYsmQQc6jart4BH5aIKPIbWKFs="; - }) - (fetchpatch { - url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/11_all_untrusted-content.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6"; - hash = "sha256-wa2bsnCt5yFx0+RAFZGBPI+OoKkbrfkkMer/KBEc/wA="; - }) - (fetchpatch { - url = "https://gitweb.gentoo.org/proj/emacs-patches.git/plain/emacs/28.2/12_all_org-remote-unsafe.patch?id=af40e12cb742510e5d40a06ffc6dfca97e340dd6"; - hash = "sha256-b6WU1o3PfDV/6BTPfPNUFny6oERJCNsDrvflxX3Yvek="; - }) - ]; - }); - - emacs29-macport = import ./make-emacs.nix (mkArgs { + emacs30-macport = import ./make-emacs.nix (mkArgs { pname = "emacs-mac"; - version = "29.1"; + version = "30.1.50"; variant = "macport"; - rev = "emacs-29.1-mac-10.0"; - hash = "sha256-TE829qJdPjeOQ+kD0SfyO8d5YpJjBge/g+nScwj+XVU="; + rev = "a50f20585960d92510fb62c95cb12606218a2081"; + hash = "sha256-Ap4ZBb9NYIbwLroOoqvpQU/hjhaJJDB+3/1V0Q2c6aA="; + patches = _: [ ./macport-stdbool.patch ]; }); } diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 7808fc468fef4..7446f09c4d3bb 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -552,6 +552,8 @@ mapAliases { emacs29-gtk3 = throw "Emacs 29 is removed due to CVEs which are fixed in Emacs 30"; # Added 2025-03-03 emacs29-nox = throw "Emacs 29 is removed due to CVEs which are fixed in Emacs 30"; # Added 2025-03-03 emacs29-pgtk = throw "Emacs 29 is removed due to CVEs which are fixed in Emacs 30"; # Added 2025-03-03 + emacs28-macport = throw "Emacs 28 is removed due to CVEs which are fixed in Emacs 30"; # Added 2025-04-02 + emacs29-macport = throw "Emacs 29 is removed due to CVEs which are fixed in Emacs 30"; # Added 2025-04-02 emacsMacport = emacs-macport; # Added 2023-08-10 emacsNativeComp = emacs; # Added 2022-06-08 emacsWithPackages = throw "'emacsWithPackages' has been renamed to/replaced by 'emacs.pkgs.withPackages'"; # Converted to throw 2024-10-17 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 01cee5c744ab6..21fc7268d6659 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14197,11 +14197,10 @@ with pkgs; emacs30-nox emacs30-pgtk - emacs28-macport - emacs29-macport + emacs30-macport ; - emacs-macport = emacs29-macport; + emacs-macport = emacs30-macport; emacs = emacs30; emacs-gtk = emacs30-gtk3; emacs-nox = emacs30-nox;