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

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

  
80
BDEPEND="alsa? ( virtual/pkgconfig )
81
	dbus? ( virtual/pkgconfig )
82
	X? ( virtual/pkgconfig )
90
BDEPEND="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 sh; then
129 122
		replace-flags "-O[1-9]" -O0		#262359
......
138 131

  
139 132
	local myconf
140 133

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

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

  
160 155
		if use xft; then
161 156
			myconf+=" --with-xft"
......
168 163
				"USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
169 164
		fi
170 165

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

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

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

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

  
233 233
src_install () {
234
	emake DESTDIR="${D}" install
234
	emake DESTDIR="${D}" NO_BIN_LINK=t install
235 235

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

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

  
250 241
	# move info dir to avoid collisions with the dir file generated by portage
251 242
	mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
......
264 255
	# remove COPYING file (except for etc/COPYING used by describe-copying)
265 256
	rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
266 257

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

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