I am trying to get emacsGcc
built on macOS using this Nixpkgs patchset and the nix-community/emacs-overlay. This is what I have in my overlays folder:
# emacs-native.nix
import (builtins.fetchTarball {
url = https://github.com/nix-community/emacs-overlay/archive/aa69bf3bdc4e63c3a1a3d0f1a8273a9755d8ae4c.tar.gz;
})
# emacs.nix
self: super: {
personal = {
emacsPackagesNg =
let
pkgs = import (fetchGit {
url = "https://github.com/NixOS/nixpkgs.git";
# nixpkgs-unstable revision at time of writing
rev = "72b9660dc18ba347f7cd41a9504fc181a6d87dc3";
}) { };
# Testing patchset found at
# https://github.com/twlz0ne/nix-gccemacs-darwin/commit/0ce1bd5d6ee2424a251ded9efb85bd7de4ec4a28
# Without this I get the error mentioned in that patchset
emacsGcc = self.emacsGcc.overrideAttrs (oldAttrs: {
postInstall = (oldAttrs.postInstall or "") + ''
ln -snf $out/lib/emacs/28.0.50/native-lisp $out/native-lisp
ln -snf $out/lib/emacs/28.0.50/native-lisp $out/Applications/Emacs.app/Contents/native-lisp
cat <<EOF> $out/bin/run-emacs.sh
#!/usr/bin/env bash
set -e
exec $out/bin/emacs-28.0.50 "\$@"
EOF
chmod a+x $out/bin/run-emacs.sh
ln -snf ./run-emacs.sh $out/bin/emacs
'';
});
in
pkgs.emacsPackagesNgGen emacsGcc;
...
This builds fine but when I try to run emacs
to open the application I get:
$ emacs
LSOpenURLsWithRole() failed for the application /Users/adelbertc/.nix-profile/Applications/Emacs.app with error -10810.
Any help would be appreciated.