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 #
0f1b63 21 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
22d1d4 22 # Copyright (c) 2019, Michal Nowak
70a91e 23 # Copyright (c) 2020, Andreas Wacknitz
ad8773 24 #
22d1d4 25
70a91e 26 BUILD_BITS=            32
3683ee 27
9bb041 28 include ../../../make-rules/shared-macros.mk
ad8773 29
AB 30 COMPONENT_NAME=        emacs
70a91e 31 COMPONENT_VERSION=    27.1
1024a8 32 COMPONENT_PROJECT_URL=    https://www.gnu.org/software/emacs/
ad8773 33 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
9bb041 34 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.xz
35e110 35 COMPONENT_ARCHIVE_HASH=    \
70a91e 36     sha256:4a4c128f915fc937d61edfc273c98106711b540c9be3cd5d2e2b9b5b2f172e41
ad8773 37 COMPONENT_ARCHIVE_URL=    http://ftp.gnu.org/gnu/emacs/$(COMPONENT_ARCHIVE)
AB 38
3683ee 39 TEST_TARGET=        $(NO_TESTS)
MN 40
41 include $(WS_MAKE_RULES)/common.mk
ad8773 42
AB 43 # we build three different variants of emacs for our users. As Solaris
44 # always has a 64-bit kernel, and 64-bit emacs can handle larger files,
45 # we only build and deliver 64-bit binaries.
46 VARIANTS =    nox x gtk
47
879599 48 BUILD_32 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
AP 49 INSTALL_32 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
d4e3a1 50
AL 51 # build with the distribution preferred libjpeg implementation
52 CFLAGS   += $(JPEG_CPPFLAGS) $(JPEG_CFLAGS)
53 CXXFLAGS += $(JPEG_CPPFLAGS) $(JPEG_CXXFLAGS)
54 LDFLAGS  += $(JPEG_LDFLAGS)
1024a8 55
MN 56 CFLAGS    += $(shell pkg-config --cflags lcms2)
ad8773 57
AB 58 # LD_OPTIONS is defined to apply desirable link-editor options to Userland
59 # components. Non-executable stack and data break sparc emacs.
60 LD_MAP_NOEXSTK.sparc=
61 LD_MAP_NOEXDATA.sparc=
62
331b22 63 # LDFLAGS is defined for emacs to detect ncurses
AP 64 LDFLAGS += -L/usr/gnu/lib -R/usr/gnu/lib
65
ad8773 66 # This code is built with gcc. The primary reason for this is that the
AB 67 # configure script has problems using a non-GNU cpp. I am not aware of
68 # any reason Sun Studio could not be made to work, but simply made a
69 # cost/benefit decision not to pursue it at this time
70 COMPILER =    gcc
71
72 # Uncomment this for debugging only. It configures emacs to run from the
73 # local proto instead of from its final installed location.
74 #CONFIGURE_PREFIX =    $(PROTO_DIR)/usr
75
5b3b5f 76 # The configure script runs the pkg-config command. Since we're building
AB 77 # 64-bit executables, we need pkg-config to use the 64-bit metadata files
879599 78 # CONFIGURE_ENV += PKG_CONFIG_PATH=/usr/lib/$(MACH64)/pkgconfig
5b3b5f 79
ad8773 80 # configure options common to all variants of emacs that we want to build.
1024a8 81 CONFIGURE_OPTIONS +=    --infodir=$(CONFIGURE_INFODIR)
ad8773 82 CONFIGURE_OPTIONS +=    --datarootdir=$(CONFIGURE_PREFIX)/share
AB 83 CONFIGURE_OPTIONS +=    --libexecdir=$(CONFIGURE_PREFIX)/lib
84 CONFIGURE_OPTIONS +=    --with-gif=no
c31602 85 # Disable imagemagick (fixes https://www.illumos.org/issues/10354)
AW 86 CONFIGURE_OPTIONS +=    --without-imagemagick
ad8773 87 CONFIGURE_OPTIONS +=    ac_cv_sys_long_file_names=yes
AB 88
9bb041 89 # ASLR should remain disabled for emacs (the default);
0f1b63 90 # build consistently core dumps with ASLR
1d52aa 91 ASLR_MODE = $(ASLR_DISABLE)
f778b1 92 # LD_EXEC_OPTIONS is not supported on illumos, we need to disable ASLR in LD_OPTIONS
AL 93 LD_OPTIONS+= $(ASLR_MODE)
0f1b63 94
ad8773 95 # variant specific configure options
331b22 96 $(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS +=    --without-all --without-x
ad8773 97 $(BUILD_DIR)/%-x/.configured:    CONFIGURE_OPTIONS +=    --with-x-toolkit=lucid
22d1d4 98 $(BUILD_DIR)/%-gtk/.configured:  CONFIGURE_OPTIONS +=    --with-x-toolkit=gtk3
ad8773 99
AB 100 # we need to build all variants, but only have to install one in order
101 # to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
102 # to remove unwanted files, copy the emacs binaries from the other tookit
103 # builds into place, and install the additional files we provide.
104 #
105 # Note that this tweaking is not required, as the proto need not match
106 # the packaging. However, doing it this way allows us to examine the proto
107 # as a finished and complete product, simplifies debugging emacs, and
108 # facilitates the use of 'gmake sample-manifest'.
109 PBIN=        $(PROTO_DIR)/usr/bin
110 PETC=        $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
70a91e 111 PPDMP=        $(PROTO_DIR)/usr/lib/emacs/$(COMPONENT_VERSION)/$(GNU_TRIPLET)
ad8773 112 PGBIN=        $(PROTO_DIR)/usr/gnu/bin
AB 113 PGSHAREMAN1=    $(PROTO_DIR)/usr/gnu/share/man/man1
114 PSHAREMAN1=    $(PROTO_DIR)/usr/share/man/man1
115 PVAR=        $(PROTO_DIR)/var
116
117 # Remove emacs existing emacs executables/script from usr/bin
220bb0 118 COMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
ad8773 119
AB 120 # GTK binaries
220bb0 121 COMPONENT_POST_INSTALL_ACTION += \
879599 122     $(CP) $(BUILD_DIR)/$(MACH32)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
220bb0 123         $(PBIN)/emacs-gtk ;
AB 124 COMPONENT_POST_INSTALL_ACTION += \
125     $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
70a91e 126 # Each emacs variant needs its own dump file:
AW 127 COMPONENT_POST_INSTALL_ACTION += \
128     $(CP) $(BUILD_DIR)/$(MACH32)-gtk/src/emacs.pdmp \
129         $(PPDMP)/emacs-gtk.pdmp ;
ad8773 130
AB 131 # Non-X11 binaries
220bb0 132 COMPONENT_POST_INSTALL_ACTION += \
879599 133     $(CP) $(BUILD_DIR)/$(MACH32)-nox/src/emacs-$(COMPONENT_VERSION).1 \
220bb0 134         $(PBIN)/emacs-nox ;
AB 135 COMPONENT_POST_INSTALL_ACTION += \
136     $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
70a91e 137 # Each emacs variant needs its own dump file:
AW 138 COMPONENT_POST_INSTALL_ACTION += \
139     $(CP) $(BUILD_DIR)/$(MACH32)-nox/src/emacs.pdmp \
140         $(PPDMP)/emacs-nox.pdmp ;
ad8773 141
AB 142 # X11 (Athena) binaries
220bb0 143 COMPONENT_POST_INSTALL_ACTION += \
879599 144     $(CP) $(BUILD_DIR)/$(MACH32)-x/src/emacs-$(COMPONENT_VERSION).1 \
220bb0 145         $(PBIN)/emacs-x ;
AB 146 COMPONENT_POST_INSTALL_ACTION += \
147     $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
70a91e 148 # Each emacs variant needs its own dump file:
AW 149 COMPONENT_POST_INSTALL_ACTION += \
150     $(CP) $(BUILD_DIR)/$(MACH32)-x/src/emacs.pdmp \
151         $(PPDMP)/emacs-x.pdmp ;
ad8773 152
AB 153 # Emacs shell script that picks the right variant at runtime
220bb0 154 COMPONENT_POST_INSTALL_ACTION += $(CP) augment/emacs $(PBIN) ;
AB 155 COMPONENT_POST_INSTALL_ACTION += $(CHMOD) +x $(PBIN)/emacs ;
ad8773 156
AB 157 # ctags and etags go in /usr/gnu/bin instead of /usr/bin
220bb0 158 COMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
AB 159 COMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
ad8773 160
AB 161 # We do not install the files under /var/games/emacs. The reason for
162 # this is that we do not install update-game-score as setuid, and
163 # therefore the game files are not usable. This the same decision made
164 # by Debian, among others.
220bb0 165 COMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
ad8773 166
220bb0 167 # The file usr/share/emacs/23.1/etc/DOC-23.1.2 gets installed instead of
AB 168 # DOC-23.1.1. Remove and replace.
169 COMPONENT_POST_INSTALL_ACTION += $(RM) $(PETC)/DOC-$(COMPONENT_VERSION).2 ;
170 COMPONENT_POST_INSTALL_ACTION += \
879599 171     $(CP) $(BUILD_DIR)/$(MACH32)-x/etc/DOC-$(COMPONENT_VERSION).1 \
220bb0 172         $(PETC)/DOC-$(COMPONENT_VERSION).1 ;
ad8773 173
220bb0 174 COMPONENT_POST_INSTALL_ACTION += \
AB 175     $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
176 COMPONENT_POST_INSTALL_ACTION += \
177     $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
178 COMPONENT_POST_INSTALL_ACTION += \
179     $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
ad8773 180
220bb0 181 COMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
AB 182 COMPONENT_POST_INSTALL_ACTION += \
183     $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
184 COMPONENT_POST_INSTALL_ACTION += \
185     $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
ad8773 186
fbf173 187 # By default, emacs is configured to compress lisp files, manpages, and info
AP 188 # files. The option to disable that (--without-compress-install) has no
189 # granularity --- it's all or nothing. For Solaris, we want to compress lisp
190 # sources, but not the others. It's simplest to let everything be compressed.
191 # and then explicitly decompress the manpages and info files.
192 COMPONENT_POST_INSTALL_ACTION += $(GUNZIP) \
193         $(PROTO_DIR)/usr/share/info/*.gz \
194         $(PROTO_DIR)/usr/share/man/man1/*.gz ;
195
ad8773 196 # Throw away usr/share/info/dir. This file is the topmost node of the Info
AB 197 # hierarchy. Emacs builds it, as presumably do all GNU packages, but on
198 # Solaris, it is delivered by system/prerequisite/gnu.
220bb0 199 COMPONENT_POST_INSTALL_ACTION += $(RM) $(PROTO_DIR)/usr/share/info/dir ;
ad8773 200
9bb041 201 install:    $(BUILD_32) $(BUILD_DIR)/$(MACH32)-x/.installed
ad8773 202
d4e3a1 203 # Auto-generated dependencies
c31602 204 REQUIRED_PACKAGES += SUNWcs
70a91e 205 #REQUIRED_PACKAGES += editor/gnu-emacs
b5e837 206 REQUIRED_PACKAGES += file/gnu-findutils
d4e3a1 207 REQUIRED_PACKAGES += image/library/libjpeg8-turbo
b5e837 208 REQUIRED_PACKAGES += image/library/libpng16
AP 209 REQUIRED_PACKAGES += image/library/librsvg
210 REQUIRED_PACKAGES += image/library/libtiff
70a91e 211 REQUIRED_PACKAGES += library/c++/harfbuzz
22d1d4 212 REQUIRED_PACKAGES += library/desktop/cairo
b5e837 213 REQUIRED_PACKAGES += library/desktop/gdk-pixbuf
22d1d4 214 REQUIRED_PACKAGES += library/desktop/gtk3
MN 215 REQUIRED_PACKAGES += library/desktop/pango
b5e837 216 REQUIRED_PACKAGES += library/glib2
AP 217 REQUIRED_PACKAGES += library/gnutls-3
70a91e 218 REQUIRED_PACKAGES += library/jansson
1024a8 219 REQUIRED_PACKAGES += library/lcms2
b5e837 220 REQUIRED_PACKAGES += library/libxml2
AP 221 REQUIRED_PACKAGES += library/ncurses
222 REQUIRED_PACKAGES += library/zlib
223 REQUIRED_PACKAGES += system/library
224 REQUIRED_PACKAGES += system/library/fontconfig
225 REQUIRED_PACKAGES += system/library/freetype-2
226 REQUIRED_PACKAGES += system/library/libdbus
227 REQUIRED_PACKAGES += system/library/math
228 REQUIRED_PACKAGES += x11/library/libice
229 REQUIRED_PACKAGES += x11/library/libsm
230 REQUIRED_PACKAGES += x11/library/libx11
231 REQUIRED_PACKAGES += x11/library/libxcb
1024a8 232 REQUIRED_PACKAGES += x11/library/libxext
b5e837 233 REQUIRED_PACKAGES += x11/library/libxfixes
AP 234 REQUIRED_PACKAGES += x11/library/libxft
235 REQUIRED_PACKAGES += x11/library/libxinerama
236 REQUIRED_PACKAGES += x11/library/libxmu
237 REQUIRED_PACKAGES += x11/library/libxpm
238 REQUIRED_PACKAGES += x11/library/libxrandr
239 REQUIRED_PACKAGES += x11/library/libxrender
240 REQUIRED_PACKAGES += x11/library/toolkit/libxaw7
241 REQUIRED_PACKAGES += x11/library/toolkit/libxt