d12frosted / homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
MIT License
2.34k stars 181 forks source link

[Build Failure]: The include files (AppKit/AppKit.h etc) that are required for a Nextstep build are missing or cannot be compiled. #661

Closed Artawower closed 8 months ago

Artawower commented 8 months ago

Version

emacs-plus@29

Make sure to follow these steps before submitting the issue

What happened?

$ brew install emacs-plus
Command output

brew install emacs-plus
==> Downloading https://formulae.brew.sh/api/formula.jws.json
-=O=-   #       #        #           #
==> Downloading https://formulae.brew.sh/api/cask.jws.json
-#O=-#     #       #
==> Fetching d12frosted/emacs-plus/emacs-plus@29
==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-29.2.tar.xz
Already downloaded: /Users/darkawower/Library/Caches/Homebrew/downloads/ba2a3a250dc781c2b13aa38d3de79d1f72a2e3ed854c0b41384349edd43169df--emacs-29.2.tar.xz
==> Installing emacs-plus@29 from d12frosted/emacs-plus
==> Patching
==> Applying fix-window-role.patch
patching file 'src/nsterm.m'
==> Applying system-appearance.patch
patching file 'src/frame.h'
patching file 'src/nsfns.m'
patching file 'src/nsterm.m'
==> Applying round-undecorated-frame.patch
patching file 'src/frame.c'
patching file 'src/frame.h'
patching file 'src/nsfns.m'
patching file 'src/nsterm.h'
patching file 'src/nsterm.m'
==> ./autogen.sh
==> ./configure --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@29/29.2/share/info/emacs --with-xml2 --with-gnutls --without-compress
Last 15 lines from /Users/darkawower/Library/Logs/Homebrew/emacs-plus@29/02.configure:
checking for net/if.h... yes
checking for ifaddrs.h... yes
checking for net/if_dl.h... yes
checking for struct ifreq.ifr_flags... yes
checking for struct ifreq.ifr_hwaddr... no
checking for struct ifreq.ifr_netmask... no
checking for struct ifreq.ifr_broadaddr... yes
checking for struct ifreq.ifr_addr... yes
checking for struct ifreq.ifr_addr.sa_len... yes
checking whether gcc understands -MMD -MF... yes
checking for X... libraries , headers
checking for AppKit/AppKit.h... no
configure: error: The include files (AppKit/AppKit.h etc) that
are required for a Nextstep build are missing or cannot be compiled.
Either fix this, or re-configure with the option '--without-ns'.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/d12frosted/homebrew-emacs-plus/issues

These open issues may also help:
Could not install emacs-plus@29 https://github.com/d12frosted/homebrew-emacs-plus/issues/544
Could not install emacs-plus@29 with --with-xwidgets --with-imagemagick --with-native-comp https://github.com/d12frosted/homebrew-emacs-plus/issues/556

  

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
  mitmproxy

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  exa
  lua@5.3
  node@14
  node@16
  openssl@1.1
  spotify-tui

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python-certifi
  numpy
  md5sha1sum
  eslint

brew config output

HOMEBREW_VERSION: 4.2.5-34-g0c738ca
ORIGIN: https://github.com/Homebrew/brew
HEAD: 0c738cacd08b328441caf4eccce974c30a215adb
Last commit: 7 hours ago
Core tap HEAD: a944dcb09351228d758853499b96e9f81c25f15e
Core tap last commit: 33 minutes ago
Core tap JSON: 23 Jan 16:05 UTC
Core cask tap HEAD: db77ab0b8f18d6ebed4d67e29626ab9ddea3da7e
Core cask tap last commit: 13 minutes ago
Core cask tap JSON: 23 Jan 16:05 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.3-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: 15.2
Rosetta 2: false

Any extra information

d12frosted commented 8 months ago

I see you mentioned reinstalling command line tools, but it seems like this should be a solution. I've seen something similar in https://github.com/d12frosted/homebrew-emacs-plus/issues/351#issuecomment-838357322.

Artawower commented 8 months ago

I tried this approach before creating this issue, but without success. I don't think this is the cause, because I have the latest version of command line tools and xcode (15.1). In the mentioned issue, the problem was an outdated version of xcode.

Tried it again, same result. Maybe there is a workaround?

d12frosted commented 8 months ago

Shame. Usually that means that there is something wrong with the env (not in a blaming fashion). What you can also try is to use superenv:

  1. brew edit emacs-plus@29;
  2. remove env :std from the formula definition and save it;
  3. install emacs-plus@29 normally

Does it work? :)

Artawower commented 8 months ago

Unfortunately, no. Same error :(

Artawower commented 8 months ago

I think we can close this issue, I didn't find the culprit and just reinstalled macos. Everything works fine now, apparently it was my local problem.

d12frosted commented 8 months ago

That's harsh. But I am happy it works now.