Subject: bug#1335: #1335 - Arch-dependant data should not be installed in the app bundle - Emacs bug report logs

From: Yavor Doganov <[email-masked]>
Date: Fri, 26 Jun 2009 16:41:50 +0300

tags 1335 + patch
thanks

At Mon, 24 Nov 2008 22:29:20 -0500,
Adrian Robert wrote:
> Does this patch not cause an error for you when lines 416-417 in  
> Makefile.in (under install-arch-dep target) are executed?

Eek!  Not merely an error, the entire working copy is being deleted...
I haven't noticed this because I run "make install" when the tree is
configured with --without-x so these commands are not being run at all
as `ns_appdir' is undefined.

Here's an updated patch, hopefully properly tested this time.

2009-06-26  Yavor Doganov  <[email-masked]>

	Do not install arch-dependent files in the app bundle if
	--disable-ns-self-contained is requested.
	* configure.in: Define `exec_prefix' and `libexecdir' relative to
	`ns_appbindir' only if configured for a self-contained app.
	* Makefile.in (install-arch-dep): Test for the existence of
	libexec in the Emacs.app bundle before executing commands.

Index: Makefile.in
===================================================================
RCS file: /sources/emacs/emacs/Makefile.in,v
retrieving revision 1.374
diff -u -r1.374 Makefile.in
--- Makefile.in	4 May 2009 01:13:20 -0000	1.374
+++ Makefile.in	26 Jun 2009 13:34:48 -0000
@@ -429,10 +429,10 @@
 	    if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
 	    if test -d share/info ; then dir=share/info; $(MV_DIRS) ; fi ; \
 	    rm -fr share ) ; \
-	  ( cd ${ns_appbindir}/libexec ; dir=emacs/*/*/* ; $(MV_DIRS); \
-	    rm -fr emacs ) ; \
-	  ( cd ${ns_appbindir}/bin ; rm -f emacs emacs-23* ; \
-	    ln -sf ../libexec/* .) ; \
+	  ( cd ${ns_appbindir} ; \
+	    if test -d libexec; then cd libexec ; dir=emacs/*/*/* ; \
+	    $(MV_DIRS); rm -fr emacs; \
+	    cd ../bin; rm -f emacs emacs-23* ; ln -sf ../libexec/* . ; fi) ; \
 	else true ; fi
 
 ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
--- configure.in	19 Jun 2009 17:10:51 -0000	1.598
+++ configure.in	26 Jun 2009 13:35:00 -0000
@@ -1270,10 +1270,10 @@
   window_system=nextstep
   with_xft=no
   # set up packaging dirs
-  exec_prefix=${ns_appbindir}
-  libexecdir=${ns_appbindir}/libexec
   if test "${EN_NS_SELF_CONTAINED}" = yes; then
      prefix=${ns_appresdir}
+     exec_prefix=${ns_appbindir}
+     libexecdir=${ns_appbindir}/libexec
   fi
 fi
 CFLAGS="$tmp_CFLAGS"