176N/A#
176N/A# CDDL HEADER START
176N/A#
176N/A# The contents of this file are subject to the terms of the
176N/A# Common Development and Distribution License (the "License").
176N/A# You may not use this file except in compliance with the License.
176N/A#
176N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
176N/A# or http://www.opensolaris.org/os/licensing.
176N/A# See the License for the specific language governing permissions
176N/A# and limitations under the License.
176N/A#
176N/A# When distributing Covered Code, include this CDDL HEADER in each
176N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
176N/A# If applicable, add the following below this CDDL HEADER, with the
176N/A# fields enclosed by brackets "[]" replaced with your own identifying
176N/A# information: Portions Copyright [yyyy] [name of copyright owner]
176N/A#
176N/A# CDDL HEADER END
176N/A#
5680N/A
5680N/A#
5674N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
176N/A#
5078N/A# As Solaris always has a 64-bit kernel, and 64-bit emacs can handle larger
5078N/A# files, we only build and deliver 64-bit binaries.
5680N/ABUILD_BITS= 64
176N/Ainclude ../../make-rules/shared-macros.mk
176N/A
176N/ACOMPONENT_NAME= emacs
4789N/ACOMPONENT_VERSION= 24.5
844N/ACOMPONENT_ARCHIVE_HASH= \
4789N/A sha256:2737a6622fb2d9982e9c47fb6f2fb297bda42674e09db40fc9bcc0db4297c3b6
176N/A
4789N/ATPNO= 23457
2899N/A
5680N/AINSTALL_TARGET=
5680N/A# The upstream emacs distribution does not have tests to be run
5680N/A# from this target.
5680N/ATEST_TARGET= $(NO_TESTS)
6686N/A
6686N/A# Depends on newer cairo, which cannot be updated in S11.
6686N/Ainclude $(WS_MAKE_RULES)/no-evaluation.mk
6686N/A
5680N/Ainclude $(WS_MAKE_RULES)/gnu-component.mk
176N/A
4789N/A# We patch the configure.ac file. Get the new configure generated during prep.
4789N/ACOMPONENT_PREP_ACTION = (cd $(@D) ; aclocal -I m4; autoconf )
4789N/A
5078N/A# We build three different variants of emacs for our users.
176N/AVARIANTS = nox x gtk
176N/A
6686N/Aifneq ($(BUILD_TYPE), evaluation)
176N/ABUILD_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
176N/AINSTALL_64 = $(VARIANTS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
6686N/Aendif
176N/A
176N/A# emacs creates a directory in usr/lib/emacs/$(COMPONENT_VERSION) that
176N/A# contains the platform name. Although the name is platform dependent,
176N/A# the files inside it are the same on all platforms. By adding this
176N/A# to the pkgmogrify macros, we can write our manifests in a portable way.
176N/AEMACS_ULEV_PFX = $(MACH:sparc=sparc-sun)
176N/AEMACS_ULEVDIR = $(EMACS_ULEV_PFX:i386=x86_64-pc)-solaris$(SOLARIS_VERSION)
176N/APKG_MACROS += EMACS_ULEVDIR=$(EMACS_ULEVDIR)
176N/A
176N/A# LD_OPTIONS is defined to apply desirable link-editor options to Userland
176N/A# components. Non-executable stack and data break sparc emacs.
176N/A#
176N/ALD_MAP_NOEXDATA.sparc=
176N/A
176N/A# Uncomment this for debugging only. It configures emacs to run from the
4789N/A# local proto instead of from its final installed location. This is useful
4789N/A# for initial bringup of new emacs versions, but can only be used up through
4789N/A# the 'gmake build' stage.
4789N/A#
176N/A#CONFIGURE_PREFIX = $(PROTO_DIR)/usr
176N/A
5078N/A# The configure script runs the pkg-config command. This allows it to
5078N/A# find the non-default GnuTLS v3 library.
5935N/APKG_CONFIG_PATH.64 := $(PKG_CONFIG_PATH.64)/gnutls-3:$(PKG_CONFIG_PATH.64)
5935N/ALDFLAGS += -L$(USRLIBDIR64)/gnutls-3
5078N/A
5078N/A# Never use xmkmf to find X11 libraries from autoconf. They are all available
5078N/A# from standard system locations, and we don't want the ld -L option that
5078N/A# gets injected.
5078N/ACONFIGURE_ENV += XMKMF="false"
703N/A
176N/A# configure options common to all variants of emacs that we want to build.
4789N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
176N/ACONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share
176N/ACONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
5078N/ACONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.32)
176N/ACONFIGURE_OPTIONS += --with-gif=no
176N/ACONFIGURE_OPTIONS += ac_cv_sys_long_file_names=yes
4804N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
4804N/ACONFIGURE_OPTIONS += emacs_cv_prog_cc_o=no
4804N/Aendif
176N/A
4789N/A# Disable gsettings and dbus. gsettings causes numerous startup errors
4789N/A# of the form
4789N/A# (process:25309): GLib-GIO-CRITICAL **: file gsettingsschema.c:
4789N/A# line 416: assertion 'source != NULL' failed
4789N/A# without providing much benefit on Solaris. dbus does not offer sufficient
4789N/A# utility for Solaris to be worth the negative interactions with ssh, where
4789N/A# the session blocks on exit due to dbus holding an open port.
4789N/A#
4789N/ACONFIGURE_OPTIONS += --without-gsettings --without-dbus
4789N/A
4789N/A# ASLR should remain disabled for emacs. ASLR undermines emacs's dumping
4789N/A# code, which requires every execution to have the same mappings. Since
4789N/A# emacs is not network facing, or run with elevated privileges, this is
4789N/A# not a security concern.
5674N/A#
7243N/A# Similarly, emacs cannot cope with a non-executable stack and with a protected
7243N/A# and non-executable heap.
5674N/AASLR_MODE = $(ASLR_DISABLE)
7243N/ANXHEAP_MODE = $(NXHEAP_DISABLE)
7243N/ANXSTACK_MODE = $(NXSTACK_DISABLE)
7243N/AADIHEAP_MODE = $(ADIHEAP_DISABLE)
1392N/A
176N/A# variant specific configure options
2134N/A$(BUILD_DIR)/%-nox/.configured: CONFIGURE_OPTIONS += --without-all --without-x
176N/A$(BUILD_DIR)/%-x/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=lucid
176N/A$(BUILD_DIR)/%-gtk/.configured: CONFIGURE_OPTIONS += --with-x-toolkit=gtk
176N/A
176N/A# we need to build all variants, but only have to install one in order
176N/A# to get the common files shared by all. We use COMPONENT_POST_INSTALL_ACTION
176N/A# to remove unwanted files, copy the emacs binaries from the other tookit
176N/A# builds into place, and install the additional files we provide.
176N/A#
176N/A# Note that this tweaking is not required, as the proto need not match
176N/A# the packaging. However, doing it this way allows us to examine the proto
176N/A# as a finished and complete product, simplifies debugging emacs, and
176N/A# facilitates the use of 'gmake sample-manifest'.
176N/APBIN= $(PROTO_DIR)/usr/bin
176N/APETC= $(PROTO_DIR)/usr/share/emacs/$(COMPONENT_VERSION)/etc
176N/APGBIN= $(PROTO_DIR)/usr/gnu/bin
176N/APGSHAREMAN1= $(PROTO_DIR)/usr/gnu/share/man/man1
176N/APSHAREMAN1= $(PROTO_DIR)/usr/share/man/man1
176N/APVAR= $(PROTO_DIR)/var
176N/A
4789N/A# Remove existing emacs executable from usr/bin. We install the binaries
4789N/A# under their variant names. /usr/bin/emacs ends up as an IPS mediated link.
414N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) $(PBIN)/emacs $(PBIN)/emacs-* ;
176N/A
176N/A# GTK binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-gtk/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-gtk ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-gtk $(PBIN)/emacs-gtk-$(COMPONENT_VERSION) ;
176N/A
176N/A# Non-X11 binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-nox/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-nox ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-nox $(PBIN)/emacs-nox-$(COMPONENT_VERSION) ;
176N/A
176N/A# X11 (Athena) binaries
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(BUILD_DIR)/$(MACH64)-x/src/emacs-$(COMPONENT_VERSION).1 \
414N/A $(PBIN)/emacs-x ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(LN) $(PBIN)/emacs-x $(PBIN)/emacs-x-$(COMPONENT_VERSION) ;
176N/A
2134N/A# ctags and etags go in /usr/gnu/bin instead of /usr/bin. At this time,
2134N/A# etags could arguably go into /usr/bin, but we'd like to preserve the
2134N/A# ability to replace the standard Solaris /usr/bin/ctags, along with
2134N/A# both of the ones we're delivering, with Exuberant Ctags. Putting both
2134N/A# emacs tags programs in /usr/gnu/bin helps that, and is a simpler story.
414N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGBIN) ;
414N/ACOMPONENT_POST_INSTALL_ACTION += $(MV) $(PBIN)/ctags $(PBIN)/etags $(PGBIN) ;
176N/A
176N/A# We do not install the files under /var/games/emacs. The reason for
176N/A# this is that we do not install update-game-score as setuid, and
176N/A# therefore the game files are not usable. This the same decision made
176N/A# by Debian, among others.
414N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) -r $(PVAR) ;
176N/A
4789N/A# Provide manpages for the emacs variants, which are our creation, referring
2134N/A# the reader to the main emacs(1) manpage.
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-gtk.1 $(PSHAREMAN1)/emacs-gtk.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-nox.1 $(PSHAREMAN1)/emacs-nox.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) augment/man/man1/emacs-x.1 $(PSHAREMAN1)/emacs-x.1 ;
176N/A
414N/ACOMPONENT_POST_INSTALL_ACTION += $(MKDIR) $(PGSHAREMAN1) ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(COMPONENT_SRC)/doc/man/ctags.1 $(PGSHAREMAN1)/ctags.1 ;
414N/ACOMPONENT_POST_INSTALL_ACTION += \
414N/A $(CP) $(COMPONENT_SRC)/doc/man/etags.1 $(PGSHAREMAN1)/etags.1 ;
176N/A
4789N/A# Throw away usr/share/info/dir and usr/share/info/info.info. These files
4789N/A# live at the topmost node of the Info hierarchy. Emacs builds them, as
4789N/A# presumably do all GNU packages, but on Solaris, they are delivered by
4789N/A# pkg:/text/texinfo.
4789N/ACOMPONENT_POST_INSTALL_ACTION += $(RM) \
4789N/A $(PROTO_DIR)/usr/share/info/dir \
4789N/A $(PROTO_DIR)/usr/share/info/info.info ;
176N/A
4789N/A# By default, emacs is configured to compress lisp files, manpages, and info
4789N/A# files. The option to disable that (--without-compress-install) has no
4789N/A# granularity --- it's all or nothing. For Solaris, we want to compress lisp
4789N/A# sources, but not the others. It's simplest to let everything be compressed.
4789N/A# and then explicitly decompress the manpages and info files.
4789N/ACOMPONENT_POST_INSTALL_ACTION += $(GUNZIP) \
4789N/A $(PROTO_DIR)/usr/share/info/*.gz \
4789N/A $(PROTO_DIR)/usr/share/man/man1/*.gz ;
176N/A
176N/A# common targets
6686N/Aifneq ($(BUILD_TYPE), evaluation)
176N/Ainstall: $(BUILD_64) $(BUILD_DIR)/$(MACH64)-x/.installed
6686N/Aendif
176N/A
4966N/A# Desktop packages differ slightly between S11 & S12: list union to allow
4966N/A# for BUILD_TYPE=evaluation and normal builds.
3817N/AREQUIRED_PACKAGES += editor/gnu-emacs
3817N/AREQUIRED_PACKAGES += file/gnu-findutils
3817N/AREQUIRED_PACKAGES += gnome/config/gconf
3817N/AREQUIRED_PACKAGES += image/imagemagick
3817N/AREQUIRED_PACKAGES += image/library/libjpeg
3817N/AREQUIRED_PACKAGES += image/library/libpng
3817N/AREQUIRED_PACKAGES += image/library/librsvg
3817N/AREQUIRED_PACKAGES += image/library/libtiff
3817N/AREQUIRED_PACKAGES += library/desktop/cairo
3817N/AREQUIRED_PACKAGES += library/desktop/gdk-pixbuf
4966N/AREQUIRED_PACKAGES += library/desktop/gtk2
3817N/AREQUIRED_PACKAGES += library/desktop/gtk3
3817N/AREQUIRED_PACKAGES += library/desktop/pango
3817N/AREQUIRED_PACKAGES += library/glib2
3817N/AREQUIRED_PACKAGES += library/gnutls
5078N/AREQUIRED_PACKAGES += library/gnutls-3
3817N/AREQUIRED_PACKAGES += library/libxml2
3817N/AREQUIRED_PACKAGES += library/ncurses
4789N/AREQUIRED_PACKAGES += library/zlib
5795N/AREQUIRED_PACKAGES += $(PERL_PKG)
3817N/AREQUIRED_PACKAGES += shell/ksh93
3817N/AREQUIRED_PACKAGES += system/library/fontconfig
3817N/AREQUIRED_PACKAGES += system/library/freetype-2
3817N/AREQUIRED_PACKAGES += system/library/math
3817N/AREQUIRED_PACKAGES += x11/library/libice
3817N/AREQUIRED_PACKAGES += x11/library/libsm
3817N/AREQUIRED_PACKAGES += x11/library/libx11
3817N/AREQUIRED_PACKAGES += x11/library/libxft
4789N/AREQUIRED_PACKAGES += x11/library/libxinerama
3817N/AREQUIRED_PACKAGES += x11/library/libxmu
3817N/AREQUIRED_PACKAGES += x11/library/libxpm
4789N/AREQUIRED_PACKAGES += x11/library/libxrandr
3817N/AREQUIRED_PACKAGES += x11/library/libxrender
3817N/AREQUIRED_PACKAGES += x11/library/toolkit/libxaw7
3817N/AREQUIRED_PACKAGES += x11/library/toolkit/libxt