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.
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.
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]
21 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
22 # Copyright (c) 2019, Michal Nowak
23 # Copyright (c) 2020, Andreas Wacknitz
24 # Copyright (c) 2023, Klaus Ziegler
27 USE_PARALLEL_BUILD
= yes
28 include ..
/..
/..
/make-rules
/shared-macros.mk
31 COMPONENT_VERSION
= 29.4
33 COMPONENT_PROJECT_URL
= https
://www.gnu.org
/software
/emacs
/
34 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
35 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.xz
36 COMPONENT_ARCHIVE_HASH
= sha256
:ba897946f94c36600a7e7bb3501d27aa4112d791bfe1445c61ed28550daca235
37 COMPONENT_ARCHIVE_URL
= https
://ftp.gnu.org
/gnu
/emacs
/$(COMPONENT_ARCHIVE
)
38 COMPONENT_FMRI
= editor
/gnu-emacs
39 COMPONENT_CLASSIFICATION
= Development
/Editors
40 COMPONENT_LICENSE
= GPLv3
41 COMPONENT_LICENSE_FILE
= COPYING
43 TEST_TARGET
= $(NO_TESTS
)
44 include $(WS_MAKE_RULES
)/common.mk
46 # we build three different variants of emacs for our users. As Solaris
47 # always has a 64-bit kernel, and 64-bit emacs can handle larger files,
48 # we only build and deliver 64-bit binaries.
49 X_VARIANT
= $(BUILD_DIR
)/$(MACH64
)-x
50 NOX_VARIANT
= $(BUILD_DIR
)/$(MACH64
)-nox
51 GTK_VARIANT
= $(BUILD_DIR
)/$(MACH64
)-gtk
52 VARIANTS
= $(NOX_VARIANT
) $(X_VARIANT
) $(GTK_VARIANT
)
54 $(VARIANTS
:%=%/.configured
): BITS
=64
56 BUILD_64
= $(VARIANTS
:%=%/.built
)
57 INSTALL_64
= $(VARIANTS
:%=%/.installed
)
59 # build with the distribution preferred libjpeg implementation
60 CFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CFLAGS
)
61 CXXFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CXXFLAGS
)
62 LDFLAGS
+= $(JPEG_LDFLAGS
)
64 CFLAGS
+= $(shell pkg-config
--cflags lcms2
)
66 # LD_OPTIONS is defined to apply desirable link-editor options to Userland
67 # components. Non-executable stack and data break sparc emacs.
69 LD_MAP_NOEXDATA.sparc
=
71 # LDFLAGS is defined for emacs to detect ncurses
72 LDFLAGS
+= -L
/usr
/gnu
/lib
/$(MACH64
) -R
/usr
/gnu
/lib
/$(MACH64
)
74 # Uncomment this for debugging only. It configures emacs to run from the
75 # local proto instead of from its final installed location.
76 #CONFIGURE_PREFIX = $(PROTO_DIR)/usr
78 # The configure script runs the pkg-config command. Since we're building
79 # 64-bit executables, we need pkg-config to use the 64-bit metadata files
80 CONFIGURE_ENV
+= PKG_CONFIG_PATH
=/usr
/lib
/$(MACH64
)/pkgconfig
82 PKG_HARDLINKS
+= usr
/bin
/emacs-nox
83 PKG_HARDLINKS
+= usr
/bin
/emacs-x
84 PKG_HARDLINKS
+= usr
/bin
/emacs-gtk
86 # configure options common to all variants of emacs that we want to build.
87 CONFIGURE_OPTIONS
+= --infodir=$(CONFIGURE_INFODIR
)
88 CONFIGURE_OPTIONS
+= --datarootdir
=$(CONFIGURE_PREFIX
)/share
89 CONFIGURE_OPTIONS
+= --libexecdir
=$(CONFIGURE_PREFIX
)/lib
90 CONFIGURE_OPTIONS
+= --with-gif
=yes
91 CONFIGURE_OPTIONS
+= --with-xaw3d
=no
92 CONFIGURE_OPTIONS
+= --with-mailutils
93 CONFIGURE_OPTIONS
+= --with-modules
94 CONFIGURE_OPTIONS
+= --with-imagemagick
95 CONFIGURE_OPTIONS
+= --with-threads
96 CONFIGURE_OPTIONS
+= --with-png
97 CONFIGURE_OPTIONS
+= --with-rsvg
98 CONFIGURE_OPTIONS
+= --with-sqlite3
99 CONFIGURE_OPTIONS
+= --with-tiff
100 CONFIGURE_OPTIONS
+= --with-toolkit-scroll-bars
101 CONFIGURE_OPTIONS
+= --with-webp
102 CONFIGURE_OPTIONS
+= --with-treesitter
103 CONFIGURE_OPTIONS
+= --with-sound
=oss
104 CONFIGURE_OPTIONS
+= ac_cv_sys_long_file_names
=yes
106 # SPARC needs this to be set in order to publish correctly.
107 ifeq ($(strip $(MACH
)),sparc
)
108 CONFIGURE_OPTIONS
+= --build
=$(GCC_GNU_TRIPLET
)
111 # ASLR should remain disabled for emacs (the default);
112 # build consistently core dumps with ASLR
113 ASLR_MODE
= $(ASLR_DISABLE
)
114 # LD_EXEC_OPTIONS is not supported on illumos, we need to disable ASLR in LD_OPTIONS
115 LD_OPTIONS
+= $(ASLR_MODE
)
117 # variant specific configure options
118 $(BUILD_DIR
)/%-nox
/.configured
: CONFIGURE_OPTIONS
+= --without-all
--without-x
119 $(BUILD_DIR
)/%-x
/.configured
: CONFIGURE_OPTIONS
+= --with-x-toolkit
=lucid
120 $(BUILD_DIR
)/%-gtk
/.configured
: CONFIGURE_OPTIONS
+= --with-x-toolkit
=gtk3
122 # we need to build all variants, but only have to install one in order
123 # to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
124 # to remove unwanted files, copy the emacs binaries from the other tookit
125 # builds into place, and install the additional files we provide.
127 # Note that this tweaking is not required, as the proto need not match
128 # the packaging. However, doing it this way allows us to examine the proto
129 # as a finished and complete product, simplifies debugging emacs, and
130 # facilitates the use of 'gmake sample-manifest'.
131 PBIN
= $(PROTO_DIR
)/usr
/bin
132 PETC
= $(PROTO_DIR
)/usr
/share
/emacs
/$(COMPONENT_VERSION
)/etc
133 PPDMP
= $(PROTO_DIR
)/usr
/lib
/emacs
/$(COMPONENT_VERSION
)/$(GCC_GNU_TRIPLET
)
134 PGBIN
= $(PROTO_DIR
)/usr
/gnu
/bin
135 PGSHAREMAN1
= $(PROTO_DIR
)/usr
/gnu
/share
/man
/man1
136 PSHAREMAN1
= $(PROTO_DIR
)/usr
/share
/man
/man1
137 PVAR
= $(PROTO_DIR
)/var
139 # Remove emacs existing emacs executables/script from usr/bin
140 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) $(PBIN
)/emacs
$(PBIN
)/emacs-
* ;
143 COMPONENT_POST_INSTALL_ACTION
+= \
144 $(CP
) $(BUILD_DIR
)/$(MACH64
)-gtk
/src
/emacs-
$(COMPONENT_VERSION
).1 \
146 COMPONENT_POST_INSTALL_ACTION
+= \
147 $(LN
) $(PBIN
)/emacs-gtk
$(PBIN
)/emacs-gtk-
$(COMPONENT_VERSION
) ;
148 # Each emacs variant needs its own dump file:
149 COMPONENT_POST_INSTALL_ACTION
+= \
150 $(CP
) $(BUILD_DIR
)/$(MACH64
)-gtk
/src
/emacs.pdmp \
151 $(PPDMP
)/emacs-gtk.pdmp
;
154 COMPONENT_POST_INSTALL_ACTION
+= \
155 $(CP
) $(BUILD_DIR
)/$(MACH64
)-nox
/src
/emacs-
$(COMPONENT_VERSION
).1 \
157 COMPONENT_POST_INSTALL_ACTION
+= \
158 $(LN
) $(PBIN
)/emacs-nox
$(PBIN
)/emacs-nox-
$(COMPONENT_VERSION
) ;
159 # Each emacs variant needs its own dump file:
160 COMPONENT_POST_INSTALL_ACTION
+= \
161 $(CP
) $(BUILD_DIR
)/$(MACH64
)-nox
/src
/emacs.pdmp \
162 $(PPDMP
)/emacs-nox.pdmp
;
164 # X11 (Athena) binaries
165 COMPONENT_POST_INSTALL_ACTION
+= \
166 $(CP
) $(BUILD_DIR
)/$(MACH64
)-x
/src
/emacs-
$(COMPONENT_VERSION
).1 \
168 COMPONENT_POST_INSTALL_ACTION
+= \
169 $(LN
) $(PBIN
)/emacs-x
$(PBIN
)/emacs-x-
$(COMPONENT_VERSION
) ;
170 # Each emacs variant needs its own dump file:
171 COMPONENT_POST_INSTALL_ACTION
+= \
172 $(CP
) $(BUILD_DIR
)/$(MACH64
)-x
/src
/emacs.pdmp \
173 $(PPDMP
)/emacs-x.pdmp
;
175 # Emacs shell script that picks the right variant at runtime
176 COMPONENT_POST_INSTALL_ACTION
+= $(CP
) augment
/emacs
$(PBIN
) ;
177 COMPONENT_POST_INSTALL_ACTION
+= $(CHMOD
) +x
$(PBIN
)/emacs
;
179 # ctags and etags go in /usr/gnu/bin instead of /usr/bin
180 COMPONENT_POST_INSTALL_ACTION
+= $(MKDIR
) $(PGBIN
) ;
181 COMPONENT_POST_INSTALL_ACTION
+= $(MV
) $(PBIN
)/ctags
$(PBIN
)/etags
$(PGBIN
) ;
183 # We do not install the files under /var/games/emacs. The reason for
184 # this is that we do not install update-game-score as setuid, and
185 # therefore the game files are not usable. This the same decision made
186 # by Debian, among others.
187 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) -r
$(PVAR
) ;
189 # The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
190 # DOC-23.1.1. Remove and replace.
191 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) $(PETC
)/DOC-
$(COMPONENT_VERSION
).2 ;
192 COMPONENT_POST_INSTALL_ACTION
+= \
193 $(CP
) $(BUILD_DIR
)/$(MACH64
)-x
/etc
/DOC-
$(COMPONENT_VERSION
).1 \
194 $(PETC
)/DOC-
$(COMPONENT_VERSION
).1 ;
196 COMPONENT_POST_INSTALL_ACTION
+= \
197 $(CP
) augment
/man
/man1
/emacs-gtk
.1 $(PSHAREMAN1
)/emacs-gtk
.1 ;
198 COMPONENT_POST_INSTALL_ACTION
+= \
199 $(CP
) augment
/man
/man1
/emacs-nox
.1 $(PSHAREMAN1
)/emacs-nox
.1 ;
200 COMPONENT_POST_INSTALL_ACTION
+= \
201 $(CP
) augment
/man
/man1
/emacs-x
.1 $(PSHAREMAN1
)/emacs-x
.1 ;
203 COMPONENT_POST_INSTALL_ACTION
+= $(MKDIR
) $(PGSHAREMAN1
) ;
204 COMPONENT_POST_INSTALL_ACTION
+= \
205 $(CP
) $(COMPONENT_SRC
)/doc
/man
/ctags
.1 $(PGSHAREMAN1
)/ctags
.1 ;
206 COMPONENT_POST_INSTALL_ACTION
+= \
207 $(CP
) $(COMPONENT_SRC
)/doc
/man
/etags
.1 $(PGSHAREMAN1
)/etags
.1 ;
209 # By default, emacs is configured to compress lisp files, manpages, and info
210 # files. The option to disable that (--without-compress-install) has no
211 # granularity --- it's all or nothing. For Solaris, we want to compress lisp
212 # sources, but not the others. It's simplest to let everything be compressed.
213 # and then explicitly decompress the manpages and info files.
214 COMPONENT_POST_INSTALL_ACTION
+= $(GUNZIP
) \
215 $(PROTO_DIR
)/usr
/share
/info/*.gz \
216 $(PROTO_DIR
)/usr
/share
/man
/man1
/*.gz
;
218 # Throw away usr/share/info/dir. This file is the topmost node of the Info
219 # hierarchy. Emacs builds it, as presumably do all GNU packages, but on
220 # Solaris, it is delivered by system/prerequisite/gnu.
221 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) $(PROTO_DIR
)/usr
/share
/info/dir ;
223 # Add enough emacs sources such that xref-find-definitions is able to show functions definitions of internal functions.
224 COMPONENT_POST_INSTALL_ACTION
+= \
225 $(MKDIR
) $(PROTO_DIR
)/usr
/share
/emacs
/$(COMPONENT_VERSION
)/src
; \
226 $(CP
) $(SOURCE_DIR
)/src
/*.
[ch
] $(PROTO_DIR
)/usr
/share
/emacs
/$(COMPONENT_VERSION
)/src
/ ;
228 # Create site-start.el for actual version
229 COMPONENT_POST_UNPACK_ACTION
+= \
230 $(GSED
) -e
's/COMPONENT_VERSION/$(COMPONENT_VERSION)/' $(COMPONENT_DIR
)/augment
/source.el
>$(COMPONENT_DIR
)/site-start.el
;
232 install: $(BUILD_64
) $(BUILD_DIR
)/$(MACH64
)-x
/.installed
235 $(RM
) $(COMPONENT_DIR
)/site-start.el
237 # build dependencies.
238 REQUIRED_PACKAGES
+= mail
/mailutils
240 # Auto-generated dependencies
241 REQUIRED_PACKAGES
+= $(JPEG_IMPLEM_PKG
)
242 REQUIRED_PACKAGES
+= database
/sqlite-3
243 REQUIRED_PACKAGES
+= file
/gnu-findutils
244 REQUIRED_PACKAGES
+= image
/imagemagick
245 REQUIRED_PACKAGES
+= image
/library
/libjpeg-turbo
246 REQUIRED_PACKAGES
+= image
/library
/libpng16
247 REQUIRED_PACKAGES
+= image
/library
/librsvg
248 REQUIRED_PACKAGES
+= image
/library
/libtiff
249 REQUIRED_PACKAGES
+= library
/c
++/harfbuzz
250 REQUIRED_PACKAGES
+= library
/desktop
/cairo
251 REQUIRED_PACKAGES
+= library
/desktop
/gdk-pixbuf
252 REQUIRED_PACKAGES
+= library
/desktop
/gtk3
253 REQUIRED_PACKAGES
+= library
/desktop
/pango
254 REQUIRED_PACKAGES
+= library
/giflib
255 REQUIRED_PACKAGES
+= library
/glib2
256 REQUIRED_PACKAGES
+= library
/gmp
257 REQUIRED_PACKAGES
+= library
/gnutls-3
258 REQUIRED_PACKAGES
+= library
/jansson
259 REQUIRED_PACKAGES
+= library
/lcms2
260 REQUIRED_PACKAGES
+= library
/libwebp
261 REQUIRED_PACKAGES
+= library
/libxml2
262 REQUIRED_PACKAGES
+= library
/ncurses
263 REQUIRED_PACKAGES
+= library
/tree-sitter
264 REQUIRED_PACKAGES
+= library
/zlib
265 REQUIRED_PACKAGES
+= shell/ksh93
266 REQUIRED_PACKAGES
+= system
/library
267 REQUIRED_PACKAGES
+= system
/library
/fontconfig
268 REQUIRED_PACKAGES
+= system
/library
/freetype-2
269 REQUIRED_PACKAGES
+= system
/library
/libdbus
270 REQUIRED_PACKAGES
+= system
/library
/math
271 REQUIRED_PACKAGES
+= x11
/library
/libice
272 REQUIRED_PACKAGES
+= x11
/library
/libsm
273 REQUIRED_PACKAGES
+= x11
/library
/libx11
274 REQUIRED_PACKAGES
+= x11
/library
/libxcb
275 REQUIRED_PACKAGES
+= x11
/library
/libxcomposite
276 REQUIRED_PACKAGES
+= x11
/library
/libxext
277 REQUIRED_PACKAGES
+= x11
/library
/libxfixes
278 REQUIRED_PACKAGES
+= x11
/library
/libxi
279 REQUIRED_PACKAGES
+= x11
/library
/libxinerama
280 REQUIRED_PACKAGES
+= x11
/library
/libxmu
281 REQUIRED_PACKAGES
+= x11
/library
/libxpm
282 REQUIRED_PACKAGES
+= x11
/library
/libxrandr
283 REQUIRED_PACKAGES
+= x11
/library
/libxrender
284 REQUIRED_PACKAGES
+= x11
/library
/toolkit
/libxaw7
285 REQUIRED_PACKAGES
+= x11
/library
/toolkit
/libxt
286 REQUIRED_PACKAGES
+= x11
/library
/xcb-util