diff --git a/pkgs/applications/editors/emacs/codesign.patch b/pkgs/applications/editors/emacs/codesign.patch new file mode 100644 index 0000000000000..bf55d39666b35 --- /dev/null +++ b/pkgs/applications/editors/emacs/codesign.patch @@ -0,0 +1,11 @@ +--- src/src/Makefile.in.orig 2021-11-27 15:38:14.424289798 +0100 ++++ src/src/Makefile.in 2021-11-27 15:41:06.516685897 +0100 +@@ -804,6 +804,8 @@ $(lispsource)/loaddefs.el: $(VCSWITNESS) + ## files from loadup.el in source form. + + bootstrap-emacs$(EXEEXT): temacs$(EXEEXT) ++ codesign -s - -f temacs ++ codesign -s - -f temacs$(EXEEXT) + $(MAKE) -C ../lisp update-subdirs + ifeq ($(DUMPING),unexec) + $(RUN_TEMACS) --batch $(BUILD_DETAILS) -l loadup --temacs=bootstrap diff --git a/pkgs/applications/editors/emacs/macport.nix b/pkgs/applications/editors/emacs/macport.nix index 867f7214d318f..832713f233585 100644 --- a/pkgs/applications/editors/emacs/macport.nix +++ b/pkgs/applications/editors/emacs/macport.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchurl, ncurses, pkg-config, texinfo, libxml2, gnutls, gettext, autoconf, automake, jansson -, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit +{ lib, stdenv, fetchurl, ncurses, pkg-config, texinfo, libxml2, gnutls, gettext, autoconf, automake, jansson, sigtool +, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit, UniformTypeIdentifiers , ImageCaptureCore, GSS, ImageIO # These may be optional }: @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses libxml2 gnutls texinfo gettext jansson AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit ImageCaptureCore GSS ImageIO # may be optional - ]; + ] ++ lib.optionals stdenv.isAarch64 [ UniformTypeIdentifiers sigtool ]; postUnpack = '' mv $sourceRoot $name @@ -45,6 +45,8 @@ stdenv.mkDerivation rec { tar xfv $hiresSrc --strip 1 -C $sourceRoot ''; + patches = lib.optional stdenv.isAarch64 ./codesign.patch; + postPatch = '' patch -p1 < patch-mac substituteInPlace lisp/international/mule-cmds.el \ @@ -70,6 +72,7 @@ stdenv.mkDerivation rec { "--with-mac" "--with-modules" "--enable-mac-app=$$out/Applications" + #"--enable-mac-self-contained" ]; CFLAGS = "-O3"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e5ae544ba32c6..07a8350d07cf2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -25051,7 +25051,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit ImageCaptureCore GSS ImageIO; - stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv; + UniformTypeIdentifiers = if stdenv.isAarch64 then darwin.apple_sdk.frameworks.UniformTypeIdentifiers else null; + sigtool = if stdenv.isAarch64 then darwin.sigtool else null; + stdenv = if stdenv.cc.isClang then llvmPackages_12.stdenv else stdenv; }; emacsPackagesFor = emacs: import ./emacs-packages.nix {