Subject: bug#52948: 28.0.90; NS variant and X11 client are not separated on macOS Monterey, Version 12.1

From: Peter Dyballa <[email-masked]>
Date: Sun, 2 Jan 2022 16:14:58 +0100

> Am 2.1.2022 um 15:41 schrieb Alan Third <[email-masked]>:
> 
> But the emacs executable is installed in /usr/local/bin or wherever.

And never used by the NS (or Mac) variant. It's just there.

> The app bundle is there purely as a helper for running from the GUI.

Make does:

	cp -f ../src/emacs /Users/pete/Quellen/Emacs_CVS/emacs-28.0.90/nextstep/Emacs.app/Contents/MacOS/Emacs 

So actually a copy of /usr/local/bin/emacs exists inside the application bundle and is loaded, and certainly used to execute emacs. Lsof does not show that it opens from the /usr/local tree more than the PDMP file. And if it would run /usr/local/bin/emacs then it would launch an X client:

Pete 249 /\  otool -L /usr/local/bin/emacs-28.0.90
/usr/local/bin/emacs-28.0.90:
	/opt/local/lib/libtiff.5.dylib (compatibility version 13.0.0, current version 13.0.0)
	/opt/local/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.2.2)
	/opt/local/lib/libpng16.16.dylib (compatibility version 54.0.0, current version 54.0.0)
	/opt/local/lib/libgif.4.dylib (compatibility version 6.0.0, current version 6.7.0)
	/opt/local/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
	/opt/local/lib/libXaw3d.8.dylib (compatibility version 9.0.0, current version 9.0.0)
	/opt/local/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
	/opt/local/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
	/opt/local/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
	/opt/local/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
	/opt/local/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/local/lib/libX11.6.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/local/lib/libX11-xcb.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/opt/local/lib/libxcb.1.dylib (compatibility version 3.0.0, current version 3.0.0)
	/opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/librsvg-2.2.dylib (compatibility version 51.0.0, current version 51.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/opt/local/lib/libgio-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.2.0)
	/opt/local/lib/libgobject-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libglib-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/local/lib/libcairo.2.dylib (compatibility version 11707.0.0, current version 11707.0.0)
	/opt/local/lib/libXrandr.2.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libXinerama.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/opt/local/lib/libXfixes.3.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.12.0)
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libfreetype.6.dylib (compatibility version 25.0.0, current version 25.1.0)
	/opt/local/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
	/opt/local/lib/libharfbuzz.0.dylib (compatibility version 20901.0.0, current version 20901.0.0)
	/opt/local/lib/libotf.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/opt/local/lib/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.2.0)
	/opt/local/lib/liblcms2.2.dylib (compatibility version 3.0.0, current version 3.12.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/opt/local/lib/libjansson.4.dylib (compatibility version 18.0.0, current version 18.0.0)
	/opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)

Emacs inside the app bundle is using:

Pete 250 /\  otool -L /Applications/AquaEmacs-28.0.90.app/Contents/MacOS/Emacs 
/Applications/AquaEmacs-28.0.90.app/Contents/MacOS/Emacs:
	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2113.20.111)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 165.0.0)
	/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/opt/local/lib/libtiff.5.dylib (compatibility version 13.0.0, current version 13.0.0)
	/opt/local/lib/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.2.2)
	/opt/local/lib/libpng16.16.dylib (compatibility version 54.0.0, current version 54.0.0)
	/opt/local/lib/libgif.4.dylib (compatibility version 6.0.0, current version 6.7.0)
	/opt/local/lib/librsvg-2.2.dylib (compatibility version 51.0.0, current version 51.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/opt/local/lib/libgio-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.2.0)
	/opt/local/lib/libgobject-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libglib-2.0.0.dylib (compatibility version 6201.0.0, current version 6201.6.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/local/lib/libcairo.2.dylib (compatibility version 11707.0.0, current version 11707.0.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 12.0.0, current version 12.12.0)
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.2.0)
	/opt/local/lib/liblcms2.2.dylib (compatibility version 3.0.0, current version 3.12.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/opt/local/lib/libjansson.4.dylib (compatibility version 18.0.0, current version 18.0.0)
	/opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1856.105.0)
	/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1557.3.2)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1141.1.0)
	/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText (compatibility version 1.0.0, current version 1.0.0)
	/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1856.105.0)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

After having built and installed the NS variant I can simply 'make distclean', configure for X11, 'make' and 'sudo make install' and have two working variants of GNU Emacs on my Mac. With dumping it has become a bit complicated. One reason is that the NS variant cannot be built when configure'd --with-dumping=none:

	gmake -C ../nextstep all
	gmake[2]: Entering directory '/Users/pete/Quellen/Emacs_CVS/emacs-28.0.90/nextstep'
	gmake -C ../src emacs
	gmake[2]: *** No rule to make target '../src/emacs.pdmp', needed by '/Users/pete/Quellen/Emacs_CVS/emacs-28.0.90/nextstep/Emacs.app/Contents/MacOS/libexec/Emacs.pdmp'.  Stop.

--
Greetings

  Pete

The world would be a better place if Larry Wall had been born in Iceland, or any other country where the native language actually has syntax.
				– Peter da Silva