GNU bug report logs - #27645
MacOS: run GUI Emacs without 'make install'

Previous Next

Package: emacs;

Reported by: "Charles A. Roelli" <charles <at> aurox.ch>

Date: Mon, 10 Jul 2017 19:07:01 UTC

Severity: wishlist

Tags: patch

Done: "Charles A. Roelli" <charles <at> aurox.ch>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27645 in the body.
You can then email your comments to 27645 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Mon, 10 Jul 2017 19:07:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Charles A. Roelli" <charles <at> aurox.ch>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Jul 2017 19:07:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: bug-gnu-emacs <at> gnu.org
Subject: MacOS: run GUI Emacs without 'make install'
Date: Mon, 10 Jul 2017 21:06:26 +0200
Currently, when building Emacs for MacOS, you have to run 'make
install' before you can run the GUI version, which needs to be running
inside an Apple "bundle" (which includes a configuration file,
"Info.plist").  If you try to run 'src/emacs -q' directly after
'make', you get an Emacs frame with no menu or dock icon, and the
frame does not take any keyboard input.  This is fixed by changing the
"activation policy" of Emacs at runtime.

The following snippet from

/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSRunningApplication.h:

has more details:

/* The following activation policies control whether and how an 
application may be activated.  They are determined by the Info.plist. */
enum {
    /* The application is an ordinary app that appears in the Dock and 
may have a user interface.  This is the default for bundled apps, unless 
overridden in the Info.plist. */
    NSApplicationActivationPolicyRegular,

    /* The application does not appear in the Dock and does not have a 
menu bar, but it may be activated programmatically or by clicking on one 
of its windows.  This corresponds to LSUIElement=1 in the Info.plist. */
    NSApplicationActivationPolicyAccessory,

    /* The application does not appear in the Dock and may not create 
windows or be activated.  This corresponds to LSBackgroundOnly=1 in the 
Info.plist.  This is also the default for unbundled executables that do 
not have Info.plists. */
    NSApplicationActivationPolicyProhibited
};
typedef NSInteger NSApplicationActivationPolicy;

So when we call 'src/emacs -q' directly, Emacs should change
activation policy to NSApplicationActivationPolicyRegular.  The
patch in the next message implements this.

Normally the Info.plist file inside the application's bundle takes
care of setting this policy, but when we run Emacs outside of the
bundle, that won't happen.

This change also makes it easier to run Emacs inside GDB in MacOS,
since there's no need to run 'make install' and give GDB the bundled
executable's name -- it's now done as on GNU/Linux.

Some things still to consider:
- Is this necessary/feasible on GNUstep?
- Does this work on the X11 port in macOS?  (I don't have a build ATM.)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Mon, 10 Jul 2017 19:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: 27645 <at> debbugs.gnu.org
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Mon, 10 Jul 2017 21:12:14 +0200
[Message part 1 (text/plain, inline)]
The patch is attached.

Also, maybe there is a better way to find the file name of the icon to
use (without hardcoding the name).
[0001-Enable-GUI-Emacs-without-make-install-on-macOS-Bug-2.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Wed, 12 Jul 2017 18:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: "Charles A. Roelli" <charles <at> aurox.ch>
Cc: 27645 <at> debbugs.gnu.org
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Wed, 12 Jul 2017 19:52:35 +0100
On Mon, Jul 10, 2017 at 09:12:14PM +0200, Charles A. Roelli wrote:
> The patch is attached.

I haven’t had a chance to test this, but it looks good, thanks for
working on it.

>  In the top-level directory, use:
>  
> -  ./configure --with-ns
> +  make
>  
> -(On macOS, --with-ns is enabled by default.)
> +This will compile all the files.

I understand that running make also runs configure, but I think it’s
worth leaving configure and the stuff about --with-ns in there. If you
try to build the NS port on anything other than macOS then you really
need to know about --with-ns.

> -This will compile all the files, but emacs will not be able to be run except
> -in -nw (terminal) mode.
> +In order to run Emacs, you must run:
>  
> -In order to run Emacs.app, you must run:
> +  src/emacs
> +
> +In order to install Emacs, you must run:
>  
>    make install

I read this as it’s going to install Emacs somewhere on my PC, it
should probably be something like: ‘To build Emacs.app ...’.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Wed, 12 Jul 2017 22:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: Jean-Christophe Helary <jean.christophe.helary <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: 27645 <at> debbugs.gnu.org, "Charles A. Roelli" <charles <at> aurox.ch>
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Thu, 13 Jul 2017 07:24:20 +0900
> On Jul 13, 2017, at 3:52, Alan Third <alan <at> idiocy.org> wrote:
> 
>> +In order to install Emacs, you must run:
>> 
>>   make install
> 
> I read this as it’s going to install Emacs somewhere on my PC, it
> should probably be something like: ‘To build Emacs.app ...’.

Indeed, since it only puts Emacs.app in the default location which is not standard for a macOS installation.

Jean-Christophe 



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Sat, 15 Jul 2017 14:59:02 GMT) Full text and rfc822 format available.

Message #17 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: Alan Third <alan <at> idiocy.org>
Cc: 27645 <at> debbugs.gnu.org, jean.christophe.helary <at> gmail.com
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Sat, 15 Jul 2017 16:58:38 +0200
[Message part 1 (text/plain, inline)]
On 12/07/2017 20:52, Alan Third wrote:

> On Mon, Jul 10, 2017 at 09:12:14PM +0200, Charles A. Roelli wrote:
>> The patch is attached.
> I haven’t had a chance to test this, but it looks good, thanks for
> working on it.
>
>>   In the top-level directory, use:
>>   
>> -  ./configure --with-ns
>> +  make
>>   
>> -(On macOS, --with-ns is enabled by default.)
>> +This will compile all the files.
> I understand that running make also runs configure, but I think it’s
> worth leaving configure and the stuff about --with-ns in there. If you
> try to build the NS port on anything other than macOS then you really
> need to know about --with-ns.

Thanks, I've put it back.

>
>> -This will compile all the files, but emacs will not be able to be run except
>> -in -nw (terminal) mode.
>> +In order to run Emacs, you must run:
>>   
>> -In order to run Emacs.app, you must run:
>> +  src/emacs
>> +
>> +In order to install Emacs, you must run:
>>   
>>     make install
> I read this as it’s going to install Emacs somewhere on my PC, it
> should probably be something like: ‘To build Emacs.app ...’.
>

It may install it (with --disable-ns-self-contained).  I've clarified 
this (hopefully).

I've also placed the nsterm.m change inside #ifdef NS_IMPL_COCOA, since the
activationPolicy doesn't seem to exist on GNUstep.

See the updated patch again.
[0001-Enable-GUI-Emacs-without-make-install-on-macOS-Bug-2.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Thu, 20 Jul 2017 18:59:02 GMT) Full text and rfc822 format available.

Message #20 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: Alan Third <alan <at> idiocy.org>
Cc: 27645 <at> debbugs.gnu.org, jean.christophe.helary <at> gmail.com
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Thu, 20 Jul 2017 20:58:06 +0200
I'll push this in a few days if there's no further changes to make.



On 15/07/2017 16:58, Charles A. Roelli wrote:
> On 12/07/2017 20:52, Alan Third wrote:
>
>> On Mon, Jul 10, 2017 at 09:12:14PM +0200, Charles A. Roelli wrote:
>>> The patch is attached.
>> I haven’t had a chance to test this, but it looks good, thanks for
>> working on it.
>>
>>>   In the top-level directory, use:
>>>   -  ./configure --with-ns
>>> +  make
>>>   -(On macOS, --with-ns is enabled by default.)
>>> +This will compile all the files.
>> I understand that running make also runs configure, but I think it’s
>> worth leaving configure and the stuff about --with-ns in there. If you
>> try to build the NS port on anything other than macOS then you really
>> need to know about --with-ns.
>
> Thanks, I've put it back.
>
>>
>>> -This will compile all the files, but emacs will not be able to be 
>>> run except
>>> -in -nw (terminal) mode.
>>> +In order to run Emacs, you must run:
>>>   -In order to run Emacs.app, you must run:
>>> +  src/emacs
>>> +
>>> +In order to install Emacs, you must run:
>>>       make install
>> I read this as it’s going to install Emacs somewhere on my PC, it
>> should probably be something like: ‘To build Emacs.app ...’.
>>
>
> It may install it (with --disable-ns-self-contained).  I've clarified 
> this (hopefully).
>
> I've also placed the nsterm.m change inside #ifdef NS_IMPL_COCOA, 
> since the
> activationPolicy doesn't seem to exist on GNUstep.
>
> See the updated patch again.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Thu, 20 Jul 2017 20:35:01 GMT) Full text and rfc822 format available.

Message #23 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: "Charles A. Roelli" <charles <at> aurox.ch>
Cc: 27645 <at> debbugs.gnu.org, jean.christophe.helary <at> gmail.com
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Thu, 20 Jul 2017 21:34:17 +0100
On Thu, Jul 20, 2017 at 08:58:06PM +0200, Charles A. Roelli wrote:
> I'll push this in a few days if there's no further changes to make.

Looks good to me. Thanks.
-- 
Alan Third




Reply sent to "Charles A. Roelli" <charles <at> aurox.ch>:
You have taken responsibility. (Sun, 23 Jul 2017 15:04:01 GMT) Full text and rfc822 format available.

Notification sent to "Charles A. Roelli" <charles <at> aurox.ch>:
bug acknowledged by developer. (Sun, 23 Jul 2017 15:04:02 GMT) Full text and rfc822 format available.

Message #28 received at 27645-done <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: Alan Third <alan <at> idiocy.org>
Cc: jean.christophe.helary <at> gmail.com, 27645-done <at> debbugs.gnu.org
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Sun, 23 Jul 2017 17:02:54 +0200
Great!  Pushed as:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2c87aab57946b95d67b664259f30e64468d08544


On 20/07/2017 22:34, Alan Third wrote:
> On Thu, Jul 20, 2017 at 08:58:06PM +0200, Charles A. Roelli wrote:
>> I'll push this in a few days if there's no further changes to make.
> Looks good to me. Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27645; Package emacs. (Mon, 24 Jul 2017 18:25:02 GMT) Full text and rfc822 format available.

Message #31 received at 27645 <at> debbugs.gnu.org (full text, mbox):

From: "Charles A. Roelli" <charles <at> aurox.ch>
To: Alan Third <alan <at> idiocy.org>
Cc: 27645 <at> debbugs.gnu.org, jean.christophe.helary <at> gmail.com
Subject: Re: bug#27645: MacOS: run GUI Emacs without 'make install'
Date: Mon, 24 Jul 2017 20:24:17 +0200
I've just realized that after 'make' on OS X you get this message:

You must run "make install" in order to test the built application.
The installed application will go to nextstep/Emacs.app and can be
run or moved from there.
The application will be fully self-contained.

I suggest to replace it with this:

Run "make" to build Emacs, then run "src/emacs" to test it.
To build a self-contained application bundle, run "make install".
The installed application will go to nextstep/Emacs.app and can be
run or moved from there.

Any thoughts?


On 23/07/2017 17:02, Charles A. Roelli wrote:
> Great!  Pushed as:
>
> http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2c87aab57946b95d67b664259f30e64468d08544 
>
>
>
> On 20/07/2017 22:34, Alan Third wrote:
>> On Thu, Jul 20, 2017 at 08:58:06PM +0200, Charles A. Roelli wrote:
>>> I'll push this in a few days if there's no further changes to make.
>> Looks good to me. Thanks.
>





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Aug 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.