caldwell / build-emacs

Build scripts for www.emacsformacosx.com
http://www.emacsformacosx.com/about
GNU General Public License v3.0
364 stars 61 forks source link

Linking problem when building dmg without a binary for 10.9 #77

Closed takaxp closed 2 years ago

takaxp commented 5 years ago

Hi!

First of all, many thanks to you for providing the nice scripts to generate DMG file to distribute Emacs binaries for macOS user.

I'm trying to generate a disk image that contains only binaries for 10.13(High Sierra) and 10.14 (Mojave). In this case, symbolic links to customized directories for bin-* and libexec-* are not created. Yes, I know, we can create them if -a option for combine-and-package script is provided like -a x86_64-10.13 for High Sierra but the generated dmg can only include links to bin-x86_64-10_13 and libexec-x86_64-10-13. So the question is:

What is the best practice to generate a disk image that contains only 10.13 and 10.14 binaries (not for 10.9)?

When I generate a disk image without a binary for 10.9 and without providing -a option, then the DMG does not contain any symbolic links of bin and libexec. In this case, exec-directory variable will be an expected value as /Users/build/workspace/Emacs-Multi-Build/label/yosemite/emacs-source/nextstep/Emacs.app/Contents/MacOS/libexec/.

This issue could be reproduced by ./Emacs -Q -batch --eval="(princ exec-directory)" after you remove symbolic links of bin and libexec from Emacs.app/Contents/MacOS directory of the DMG image currently distributed from https://emacsformacosx.com/. Originally, the symbolic links point to bin-x86_64-10_9 and libexec-x86_64-10_9.

Now I decided to create two independent disk images for 10.13 and 10.14 with -a option because the symbolic links point to correct directories.

Best, Takaaki

caldwell commented 5 years ago

Looks like I should be setting the EMACSPATH env var in the Ruby launcher (possibly instead of adding to the PATH). I'll fix that. As far as I remember the symlink (-a) was intended to just give a default exec path just so an absolute path like /Applications/Emacs.app/Contents/MacOS/bin/emacsclient would work (and not go obsolete between releases).

Why do you want to not include 10.9?

takaxp commented 5 years ago

Looks like I should be setting the EMACSPATH env var in the Ruby launcher (possibly instead of adding to the PATH)

I support this idea. I just quickly tested the replacing the current setting for links to ENV['PATH'] with ENV['EMACSPATH'] = File.join(base_dir, "bin-#{arch_version}"). It works well if bin-#{arch_version} directory actually exists in Emacs.app/Contents/MacOS.

Why do you want to not include 10.9?

Simply because I don't have such environment for debugging. I'd like to distribute an extended Emacs binary that integrates a capability of switching input method for CJK (mostly Japanese) users. I have personally maintained the patch and distributed it via gist.