Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/applications/editors/emacs/codesign.patch
Original file line number Diff line number Diff line change
@@ -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
9 changes: 6 additions & 3 deletions pkgs/applications/editors/emacs/macport.nix
Original file line number Diff line number Diff line change
@@ -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
}:

Expand Down Expand Up @@ -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 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigtool is executed on the build machine, right? Then it needs to go to nativeBuildInputs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kloenk please move this into nativeBuildInputs.


postUnpack = ''
mv $sourceRoot $name
Expand All @@ -45,6 +45,8 @@ stdenv.mkDerivation rec {
tar xfv $hiresSrc --strip 1 -C $sourceRoot
'';

patches = lib.optional stdenv.isAarch64 ./codesign.patch;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we could apply this uncondtional.


postPatch = ''
patch -p1 < patch-mac
substituteInPlace lisp/international/mule-cmds.el \
Expand All @@ -70,6 +72,7 @@ stdenv.mkDerivation rec {
"--with-mac"
"--with-modules"
"--enable-mac-app=$$out/Applications"
#"--enable-mac-self-contained"
];

CFLAGS = "-O3";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down