Andreas Wacknitz
2020-08-16 70a91e76c6f19ec75c3596eeb7dcc6afbf4f9ea1
commit | author | age
ad8773 1 #
AB 2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
70a91e 21 # Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
ad8773 22 #
AB 23
24 NAME:             emacs
70a91e 25 VERSION:          26.3
ad8773 26 DESCRIPTION:      GNU Emacs editor
AB 27 LICENSE:          GPLv3
28 BUGTRAQ:          solaris/utility/emacs
29 COMMENTS:         
30
31 This file contains information about the emacs package within the Userland
32 consolidation. Along with the comments in the Makefile, it documents any
33 deviations from standard Userland or emacs practice, as well as miscellaneous
34 information needed to understand how this component is put together.
35
36
70a91e 37 - We patch the following changes into the emacs sources:
ad8773 38
88f2e1 39     find.patch
AB 40         The rgrep function uses the GNU-specific -path option to the
41         find command. Change the default value for the find-program
42         variable in grep.el to use GNU find.
331b22 43
70a91e 44         In recent releases, we find that the find-program variable
AW 45         is repeated in other autogenerated files (ldefs.boot.el,
46         loaddefs.el), and that these copies must also be adjusted.
47         The safest policy is to do a brute force search of the entire
48         source tree for defvar of find-program, and to fix them all.
49
50     gnutls.patch
51         Add the cert bundle path for Solaris and Solaris-derived
52         systems. This allows gnutls to find public keys.
53
54 - If you patch configure.ac, as we did with emacs 24.5 for jpeg6b_config.patch,
55   then you need a COMPONENT_PREP_ACTION definition in the Makefile in order
56   to get the configure script generated during the 'prep' phase. This must
57   issue the same commands that would otherwise be generated by the emacs
58   Makefile. To get those commands, comment out COMPONENT_PREP_ACTION, and do a
59   'gmake clobber; gmake build', capturing the output, and then look for
60   'autoconf' in the output. The COMPONENT_PREP_ACTION for jpeg6b looked like:
61
62   # We patch the configure.ac file. Get the new configure generated during prep.
63   COMPONENT_PREP_ACTION = (cd $(@D) ; aclocal -I m4; autoconf )
64
65   It went just after the include lines, above VARIANTS
66
67
331b22 68 - The emacs distribution used to have a subdirectory, src/s, which
AP 69   contained per-platform header files. We would apply the following
70a91e 70   patches. Please note that the contact information given in the comment
AW 71   in the first patch is no longer valid. Current information is found in
72   the README file in the top level directory of this workspace:
331b22 73
AP 74     sol2-6.h: Enable the use of the native Solaris dldump()
75
76         --- sol2-6.h.~1~        2011-10-17 19:20:46.000000000 -0600
77         +++ sol2-6.h    2013-09-23 13:34:26.683033182 -0600
78         @@ -2,10 +2,17 @@
79          
80          #include "sol2-5.h"
81          
82         -#if 0 /* dldump does not handle all the extensions used by GNU ld.  */
83         +/*
84         + * Use the Solaris dldump() function to dump emacs, instead of
85         + * the generic unexelf code.
86         + *
87         + * If you encounter a problem using dldump(), please consider sending
88         + * a message to the OpenSolaris tools-linking mailing list:
89         + *      http://mail.opensolaris.org/mailman/listinfo/tools-linking
90         + */
91         +
92          #undef UNEXEC
93          #define UNEXEC unexsol.o
94         -#endif
95          
96          /* arch-tag: 71ea3857-89dc-4395-9623-77964e6ed3ca
97             (do not change this comment) */
98
99     sol2-5.h: Use the system malloc instead of the GNU malloc:
100
101         --- sol2-5.h.~1~        2011-10-17 19:20:46.000000000 -0600
102         +++ sol2-5.h    2013-09-23 13:34:26.732656398 -0600
103         @@ -17,6 +17,7 @@
104          /* This is not always necessary.  Turned off at present for testers to
105             identify any problems with gmalloc more accurately.  */
106          /* #define SYSTEM_MALLOC */
107         +#define SYSTEM_MALLOC
108          
109          /* There have problems reported with mmap at least on Solaris 2.6
110             and 2.7.  For simplicity, let's not use mmap for anything >= 2.5.
111
70a91e 112   These are now both handled by default by the configure process, and in fact,
AW 113   comments from the header files appear to have been carried over. With every
331b22 114   update, we must verify that these settings stick and remain enabled.
AP 115
116     System Malloc:
117     The information output at the end of the configure step verifies this:
118
119         Configured for `x86_64-pc-solaris2.12'.
120     ...
121           Should Emacs use the GNU version of malloc?             no
122             (The GNU allocators don't work with this system configuration.)
123
124     dldump:
125     One could examine the configure script looking for the setting
126     "UNEXEC_OBJ=unexsol.o", but it seems easier/better to simply examine
127     the final executable:
128
129         % pvs -nos emacs | grep dldump
130         emacs - libc.so.1 (SUNW_1.22): dldump;
88f2e1 131
ad8773 132 - Emacs can be built as either 32-bit or 64-bit, depending on the target
AB 133   machine. The benefit of a 64-bit emacs is that the size of the files it
134   can handle is not limited to 128MB, as it is with the 32-bit version.
135
136   For Solaris, we used to build both versions, using /usr/lib/isaexec to
137   run the 64-bit version if possible, and the 32-bit version otherwise. Note
138   that this was only done for the emacs binary itself, as there is no
139   technical need for 64-bit versions of the ancillary programs that come
140   with emacs (etags, emacsclient, etc).
141
142   Fortunately, the vast majority of the files in an emacs tree are identical,
143   regardless of the platform and/or word size, which makes this particularly
144   easy to do.
145
146   With Solaris 11, all kernels are 64-bit, and we therefore do not need
147   the 32-bit executables. As such, we only supply 64-bit emacs binaries now,
148   and the use of usr/lib/isaexec has been removed: This cuts the number of
149   builds necessary in half, and also the binary package size. It also
150   simplifies packaging, and the user's view of /usr/bin/emacs*.
151
152 - There are three different toolkit options: None, Athena widgets
153   (aka Xaw, or lucid), and gtk. It would be nice to only support gtk,
154   but for purposes of minimization and user preference, we supply binaries
155   for all three. We follow the Linux model in this regard. The Xaw and no-X
156   versions are quite stable from release to release, so this isn't a large
157   burden.
158
70a91e 159 - By default, emacs will find and use the Image Magick image manipulation
AW 160   library. The problem with this for Solaris is that the IM library APIs
161   are not committed, and change from release to release, as opposed to the
162   command line interfaces which are stable. Any update to IM causes breakage
163   in emacs that takes 2 builds to resolve. At the same time, IM is not central
164   to emacs use, and so, we choose to explicitly disable it with the
165   --without-imagemagick config option. This can be revisited if we find that
166   common emacs use suffers without it, or if IM stabilizes their library APIs.
167
168 - With multiple emacs binaries, there is a need for a generic /usr/bin/emacs
169   to exist, which will by default run the "best" version of emacs installed
170   on the system. Older versions of Emacs for Solaris, dating back to the 
171   original integration into OpenSolaris, used a shell script that contained
172   this logic:
173
174         for EXE in emacs-gtk emacs-x emacs-nox; do
175                 if [ -f /usr/bin/$EXE ]; then
176                         exec /usr/bin/$EXE "$@"
177                 fi
178         done
179
180   With the update to Emacs 24.5, we have dropped that script, and /usr/bin/emacs
181   is now an IPS mediated link. The admin can therefore use 'pkg set-mediator'
182   to establish their preference. The mediator names are the same as those of
183   the emacs binaries (emacs-gtk, emacs-x, emacs-nox). By default, the mediated
184   link will give the same order as before (gtk, x, nox). The means by which
185   this is achieved needs some explanation. The mediated options are by default
186   sorted in the order:
187
188       priority, version, implementation-order, implementation
189
190   Where "implementation" is sorted lexically. Lexical sorting puts emacs-gtk
191   first, which is what we want, but it puts emacs-nox ahead of emacs-x. I
192   played with setting the version or implementation-order values to achieve
193   the desired sorting. This works, but as these are not real Emacs versions, 
194   the output from 'pkg mediator' is confusing. Instead, we set the priority 
195   of emacs-gtk and emacs-x to "vendor", and leave the priority of emacs-nox
196   unspecified. Hence, emacs-gtk trumps emacs-x based on lexical sorting, and
197   both of them trump emacs-nox based on priority.
198
331b22 199 - In the past, we built emacs with gcc. The Makefile contained:
AP 200
201     # This code is built with gcc. The primary reason for this is that the
202     # configure script has problems using a non-GNU cpp. I am not aware of
203     # any reason Sun Studio could not be made to work, but simply made a
204     # cost/benefit decision not to pursue it at this time
205     COMPILER =      gcc
206
70a91e 207   With emacs 24.3, I removed this, and found that studio now builds
AW 208   emacs without issue.
331b22 209
70a91e 210   With emacs 25.2, the studio compilers on sparc produce broken behavior
AW 211   at the -xO4 optimization level.
212
213       26552153 emacs on sparc does not wrap long line
214       26558067 emacs loses mouse cursor on sparc
215
216   This can be mitigated by changing to -xO2. However, we don't know what
217   the real issue is, and therefore, do not fully know if that's sufficient.
218   Therefore, we're back to using gcc.
219
220 - When updating to a new version, remember to ensure that the REQUIRED_PACKAGES
221   lines in the Makefile are updated to match. Instructions can be found in the
222   doc directory at the top of the userland workspace. Basically:
223
224     % gmake REQUIRED_PACKAGES
225
226   and then edit the Makefile to incorporate the added lines into what's
227   there, and remove any no longer needed things.
228
229 - Emacs is configured to use GnuTLS 3 rather than version 2. Version 3 used
230   to require gnutls-3, but has been moved to the default gnutls. The gnutls-3
231   line remains during the transition period, and can be removed soon.
232
233     REQUIRED_PACKAGES += library/gnutls-3
331b22 234
ad8773 235 - We deliver the following packages:
AB 236
237     gnu-emacs - Everything you need to run emacs, except the
238         emacs binaries.
239
331b22 240     gnu-emacs-gtk - Binary for the X11 version using the GTK toolkit.
ad8773 241
331b22 242     gnu-emacs-no-x11 - Pure tty emacs binary, built without
AP 243         any X11 linkage or other extra support (i.e. D-bus). This
244         is the most basic emacs possible, ideal for headless server
245         systems.
ad8773 246
331b22 247     gnu-emacs-x11 - Binary for the X11 version using the Athena
ad8773 248         widget (Xaw) toolkit.
AB 249
250     gnu-emacs-lisp - The compressed LISP files for which compiled
251         versions are delivered by gnu-emacs. These are only needed
252         for emacs developers and those who like to read source code.
253
254   The core gnu-emacs package is required by all of the other packages.
255   In turn, gnu-emacs requires at least one of the packages supplying an
256   emacs binary to be installed.
257
70a91e 258 - Emacs things we don't deliver:
ad8773 259
70a91e 260     x) We do not ship any suid/sgid binaries for obvious security reasons.
AW 261
262     x) We do not install the files under /var/games/emacs. The reason for
263        this is that we do not install update-game-score as setuid, and
264        therefore the game files are not usable. This the same decision made
265        by Debian, among others.
266
267     x) usr/lib/systemd/user/emacs.service: Without systemd, it's not useful.