Diff emacs-23.4-r18 with a emacs-24.5-r7

/usr/portage/app-editors/emacs/emacs-24.5-r7.ebuild 2020-05-02 12:39:00.000000000 +0300
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=7
5
WANT_AUTOMAKE="none"
6 5

  
7
inherit autotools elisp-common flag-o-matic readme.gentoo-r1 toolchain-funcs
6
inherit autotools elisp-common flag-o-matic readme.gentoo-r1
8 7

  
9 8
DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
10 9
HOMEPAGE="https://www.gnu.org/software/emacs/"
11
SRC_URI="mirror://gnu/emacs/${P}.tar.bz2
12
	https://dev.gentoo.org/~ulm/emacs/${P}-patches-23.tar.xz"
10
SRC_URI="mirror://gnu/emacs/${P}.tar.xz
11
	https://dev.gentoo.org/~ulm/emacs/${P}-patches-5.tar.xz"
13 12

  
14 13
LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
15
SLOT="23"
16
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
17
IUSE="alsa aqua athena dbus games gconf gif gpm gtk gzip-el jpeg kerberos livecd m17n-lib motif png sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm"
14
SLOT="24"
15
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
16
IUSE="acl alsa aqua athena dbus games gconf gfile gif gpm gsettings gtk gtk2 gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
18 17
REQUIRED_USE="?? ( aqua X )"
19 18

  
20 19
RDEPEND=">=app-emacs/emacs-common-gentoo-1.5[games?,X?]
21 20
	net-libs/liblockfile
22 21
	sys-libs/ncurses:0=
23
	kerberos? ( virtual/krb5 )
22
	acl? ( virtual/acl )
24 23
	alsa? ( media-libs/alsa-lib )
24
	dbus? ( sys-apps/dbus )
25 25
	games? ( acct-group/gamestat )
26 26
	gpm? ( sys-libs/gpm )
27
	dbus? ( sys-apps/dbus )
27
	!inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
28
	kerberos? ( virtual/krb5 )
29
	libxml2? ( >=dev-libs/libxml2-2.2.0 )
30
	selinux? ( sys-libs/libselinux )
31
	ssl? ( net-libs/gnutls:0= )
32
	zlib? ( sys-libs/zlib )
28 33
	X? (
29 34
		x11-libs/libICE
30 35
		x11-libs/libSM
31 36
		x11-libs/libX11
37
		x11-libs/libXext
38
		x11-libs/libXinerama
39
		x11-libs/libXrandr
32 40
		x11-misc/xbitmaps
33 41
		gconf? ( >=gnome-base/gconf-2.26.2 )
42
		gsettings? ( >=dev-libs/glib-2.28.6 )
34 43
		gif? ( media-libs/giflib:0= )
35 44
		jpeg? ( virtual/jpeg:0= )
36 45
		png? ( >=media-libs/libpng-1.4:0= )
37 46
		svg? ( >=gnome-base/librsvg-2.0 )
38 47
		tiff? ( media-libs/tiff:0 )
39 48
		xpm? ( x11-libs/libXpm )
49
		imagemagick? ( >=media-gfx/imagemagick-6.6.2:0= )
40 50
		xft? (
41 51
			media-libs/fontconfig
42 52
			media-libs/freetype
......
47 57
				>=dev-libs/m17n-lib-1.5.1
48 58
			)
49 59
		)
50
		gtk? ( x11-libs/gtk+:2 )
60
		gtk? (
61
			gtk2? ( x11-libs/gtk+:2 )
62
			!gtk2? ( x11-libs/gtk+:3 )
63
		)
51 64
		!gtk? (
52 65
			motif? (
53 66
				>=x11-libs/motif-2.3:0
54 67
				x11-libs/libXpm
55
				x11-libs/libXext
56 68
				x11-libs/libXmu
57 69
				x11-libs/libXt
58 70
			)
59 71
			!motif? (
60 72
				Xaw3d? (
61 73
					x11-libs/libXaw3d
62
					x11-libs/libXext
63 74
					x11-libs/libXmu
64 75
					x11-libs/libXt
65 76
				)
66 77
				!Xaw3d? ( athena? (
67 78
					x11-libs/libXaw
68
					x11-libs/libXext
69 79
					x11-libs/libXmu
70 80
					x11-libs/libXt
71 81
				) )
......
77 87
	X? ( x11-base/xorg-proto )"
78 88

  
79 89
BDEPEND="app-eselect/eselect-emacs
80
	alsa? ( virtual/pkgconfig )
81
	dbus? ( virtual/pkgconfig )
82
	X? ( virtual/pkgconfig )
90
	virtual/pkgconfig
83 91
	gzip-el? ( app-arch/gzip )"
84 92

  
85 93
RDEPEND="${RDEPEND}
......
97 105
	eapply ../patch
98 106
	eapply_user
99 107

  
108
	# Fix filename reference in redirected man page
100 109
	sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
101 110
		|| die "unable to sed ctags.1"
102 111

  
103
	if ! use alsa; then
104
		# ALSA is detected even if not requested by its USE flag.
105
		# Suppress it by supplying pkg-config with a wrong library name.
106
		sed -i -e "/ALSA_MODULES=/s/alsa/DiSaBlEaLsA/" configure.in \
107
			|| die "unable to sed configure.in"
108
	fi
109
	if ! use gzip-el; then
110
		# Emacs' build system automatically detects the gzip binary and
111
		# compresses el files. We don't want that so confuse it with a
112
		# wrong binary name
113
		sed -i -e "s/ gzip/ PrEvEnTcOmPrEsSiOn/" configure.in \
114
			|| die "unable to sed configure.in"
115
	fi
116

  
117
	mv configure.in configure.ac || die
118
	eautoreconf
112
	AT_M4DIR=m4 eautoreconf
119 113
	touch src/stamp-h.in || die
120 114
}
121 115

  
122 116
src_configure() {
123 117
	strip-flags
124
	filter-flags -fstrict-aliasing -pie
125
	append-flags $(test-flags -fno-strict-aliasing)
126
	append-ldflags $(test-flags -no-pie)	#639568
118
	filter-flags -pie					#526948
119
	append-ldflags $(test-flags -no-pie)	#639570
127 120

  
128 121
	if use ia64; then
129 122
		replace-flags "-O[2-9]" -O1		#325373
......
136 129

  
137 130
	local myconf
138 131

  
139
	if use alsa && ! use sound; then
140
		einfo "Although sound USE flag is disabled you chose to have alsa,"
141
		einfo "so sound is switched on anyway."
142
		myconf+=" --with-sound"
132
	if use alsa; then
133
		use sound || ewarn \
134
			"USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
135
		myconf+=" --with-sound=alsa"
143 136
	else
144
		myconf+=" $(use_with sound)"
137
		myconf+=" --with-sound=$(usex sound oss)"
145 138
	fi
146 139

  
147 140
	if use X; then
148 141
		myconf+=" --with-x --without-ns"
149 142
		myconf+=" $(use_with gconf)"
143
		myconf+=" $(use_with gsettings)"
150 144
		myconf+=" $(use_with toolkit-scroll-bars)"
151 145
		myconf+=" $(use_with gif)"
152 146
		myconf+=" $(use_with jpeg)"
......
154 148
		myconf+=" $(use_with svg rsvg)"
155 149
		myconf+=" $(use_with tiff)"
156 150
		myconf+=" $(use_with xpm)"
151
		myconf+=" $(use_with imagemagick)"
157 152

  
158 153
		if use xft; then
159 154
			myconf+=" --with-xft"
......
166 161
				"USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
167 162
		fi
168 163

  
169
		# GTK+ is the default toolkit if USE=gtk is chosen with other
170
		# possibilities. Emacs upstream thinks this should be standard
171
		# policy on all distributions
172
		local f
164
		local f line
173 165
		if use gtk; then
174 166
			einfo "Configuring to build with GIMP Toolkit (GTK+)"
175
			myconf+=" --with-x-toolkit=gtk"
167
			while read line; do ewarn "${line}"; done <<-EOF
168
				Your version of GTK+ will have problems with closing open
169
				displays. This is no problem if you just use one display, but
170
				if you use more than one and close one of them Emacs may crash.
171
				See <https://bugzilla.gnome.org/show_bug.cgi?id=85715>.
172
				If you intend to use more than one display, then it is strongly
173
				recommended that you compile Emacs with the Athena/Lucid or the
174
				Motif toolkit instead.
175
			EOF
176
			myconf+=" --with-x-toolkit=$(usex gtk2 gtk2 gtk3)"
176 177
			for f in motif Xaw3d athena; do
177 178
				use ${f} && ewarn \
178 179
					"USE flag \"${f}\" has no effect if \"gtk\" is set."
......
191 192
			einfo "Configuring to build with no toolkit"
192 193
			myconf+=" --with-x-toolkit=no"
193 194
		fi
195
		! use gtk && use gtk2 && ewarn \
196
			"USE flag \"gtk2\" has no effect if \"gtk\" is not set."
194 197
	elif use aqua; then
195 198
		einfo "Configuring to build with Nextstep (Cocoa) support"
196 199
		myconf+=" --with-ns --disable-ns-self-contained"
......
199 202
		myconf+=" --without-x --without-ns"
200 203
	fi
201 204

  
202
	# According to configure, this option is only used for GNU/Linux
203
	# (x86_64 and s390). For Gentoo Prefix we have to explicitly spell
204
	# out the location because $(get_libdir) does not necessarily return
205
	# something that matches the host OS's libdir naming (e.g. RHEL).
206
	local crtdir=$($(tc-getCC) -print-file-name=crt1.o)
207
	crtdir=${crtdir%/*}
208

  
209 205
	econf \
210 206
		--program-suffix="-${EMACS_SUFFIX}" \
211 207
		--infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
212 208
		--localstatedir="${EPREFIX}"/var \
213 209
		--enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
214
		--with-crt-dir="${crtdir}" \
215 210
		--with-gameuser=":gamestat" \
211
		--without-compress-install \
216 212
		--without-hesiod \
217
		$(use_with kerberos) $(use_with kerberos kerberos5) \
218
		$(use_with gpm) \
213
		--with-file-notification=$(usev inotify || usev gfile || echo no) \
214
		$(use_enable acl) \
219 215
		$(use_with dbus) \
216
		$(use_with gpm) \
217
		$(use_with kerberos) $(use_with kerberos kerberos5) \
218
		$(use_with libxml2 xml2) \
219
		$(use_with selinux) \
220
		$(use_with ssl gnutls) \
221
		$(use_with wide-int) \
222
		$(use_with zlib) \
220 223
		${myconf}
221 224
}
222 225

  
223 226
src_compile() {
224 227
	# Disable sandbox when dumping. For the unbelievers, see bug #131505
225
	emake CC="$(tc-getCC)" \
226
		AR="$(tc-getAR) cq" \
227
		RANLIB="$(tc-getRANLIB)" \
228
		RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
228
	emake RUN_TEMACS="SANDBOX_ON=0 LD_PRELOAD= env ./temacs"
229 229
}
230 230

  
231 231
src_install() {
232
	emake DESTDIR="${D}" install
232
	emake DESTDIR="${D}" NO_BIN_LINK=t install
233 233

  
234
	rm "${ED}"/usr/bin/emacs-${FULL_VERSION}-${EMACS_SUFFIX} \
235
		|| die "removing duplicate emacs executable failed"
236
	mv "${ED}"/usr/bin/emacs-${EMACS_SUFFIX} "${ED}"/usr/bin/${EMACS_SUFFIX} \
234
	mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
237 235
		|| die "moving emacs executable failed"
238

  
239
	# move man pages to the correct place
240
	local m
241
	mv "${ED}"/usr/share/man/man1/{emacs,${EMACS_SUFFIX}}.1 \
236
	mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
242 237
		|| die "moving emacs man page failed"
243
	for m in b2m ctags ebrowse emacsclient etags grep-changelog rcs-checkin; do
244
		mv "${ED}"/usr/share/man/man1/${m}{,-${EMACS_SUFFIX}}.1 \
245
			|| die "moving ${m} man page failed"
246
	done
247 238

  
248 239
	# move info dir to avoid collisions with the dir file generated by portage
249 240
	mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
......
262 253
	# remove COPYING file (except for etc/COPYING used by describe-copying)
263 254
	rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
264 255

  
256
	if use gzip-el; then
257
		# compress .el files when a corresponding .elc exists
258
		find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
259
			-name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
260
		assert "gzip .el failed"
261
	fi
262

  
265 263
	local cdir
266 264
	if use source; then
267 265
		cdir="/usr/share/emacs/${FULL_VERSION}/src"
......
269 267
		# This is not meant to install all the source -- just the
270 268
		# C source you might find via find-function
271 269
		doins src/*.{c,h,m}
272
		doins -r src/{m,s}
273
		rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/Makefile.c
274
		rm "${ED}"/usr/share/emacs/${FULL_VERSION}/src/{m,s}/README
275 270
	elif has installsources ${FEATURES}; then
276 271
		cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
277 272
	fi
......
309 304
		/usr/bin/emacs through the Emacs eselect module, which also
310 305
		redirects man and info pages. Therefore, several Emacs versions can
311 306
		be installed at the same time. \"man emacs.eselect\" for details.
312
		\\n\\nIf you upgrade from a previous major version of Emacs, then
313
		it is strongly recommended that you use app-admin/emacs-updater
314
		to rebuild all byte-compiled elisp files of the installed Emacs
315
		packages."
307
		\\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
308
		strongly recommended that you use app-admin/emacs-updater to rebuild
309
		all byte-compiled elisp files of the installed Emacs packages."
316 310
	use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
317 311
		Installing media-fonts/font-adobe-{75,100}dpi on the X server's
318 312
		machine would satisfy basic Emacs requirements under X11.
Thank you!