From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1034077-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id EDFBF138334
	for <garchives@archives.gentoo.org>; Sun,  1 Jul 2018 13:22:28 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DEA8EE0825;
	Sun,  1 Jul 2018 13:22:27 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 99A74E0825
	for <gentoo-commits@lists.gentoo.org>; Sun,  1 Jul 2018 13:22:27 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 699EE335C89
	for <gentoo-commits@lists.gentoo.org>; Sun,  1 Jul 2018 13:22:25 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 650992B3
	for <gentoo-commits@lists.gentoo.org>; Sun,  1 Jul 2018 13:22:23 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1530451331.67300938dec2b8e726bcee9a3bded684a63e9262.ulm@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/emacs/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-editors/emacs/Manifest app-editors/emacs/emacs-18.59-r12.ebuild
X-VCS-Directories: app-editors/emacs/
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 67300938dec2b8e726bcee9a3bded684a63e9262
X-VCS-Branch: master
Date: Sun,  1 Jul 2018 13:22:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: d2d00d70-bfa0-4469-86ea-6c76da7d3d0d
X-Archives-Hash: 1d3af40c381d0149a368da6ed8e1e6e5

commit:     67300938dec2b8e726bcee9a3bded684a63e9262
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  1 13:18:08 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jul  1 13:22:11 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67300938

app-editors/emacs: Make the X11 interface in Emacs 18 work again.

Package-Manager: Portage-2.3.41, Repoman-2.3.9

 app-editors/emacs/Manifest               |   1 +
 app-editors/emacs/emacs-18.59-r12.ebuild | 162 +++++++++++++++++++++++++++++++
 2 files changed, 163 insertions(+)

diff --git a/app-editors/emacs/Manifest b/app-editors/emacs/Manifest
index f15ec949952..3930fa08353 100644
--- a/app-editors/emacs/Manifest
+++ b/app-editors/emacs/Manifest
@@ -1,5 +1,6 @@
 DIST emacs-18.59-linux22x-elf-glibc21.diff.gz 15671 BLAKE2B 0106fe8053b4f65f384d451ca85138991a57afaca16b32035585055bb877c039af826859fa58c4660ec80664d3bfb0ee7a757ad76381c150ebcb22cb333a98d6 SHA512 c6c6ea33850dadf08d68fff56fc6aacc80ad1aa36661260715d50b95438942d56e6244094427d50356cfe716f26559feb885254c436399bff7be639637d605b6
 DIST emacs-18.59-patches-10.tar.xz 21496 BLAKE2B bfa0202511a9e41d3278c63f43f174cca4ba95f42675796d85139fc43654ca3b9bc56a8c547029eaae967df66ec1e520d3bcdc67c4d53261fea70def6641574c SHA512 c0255d9d02e047cc2173cebb916677e268d8f5043c9dd08041b78019df208cdd02eb8eb49256acde7a3d5b004a7227ee9a1220d7b1e24580bdb5a5258216fc39
+DIST emacs-18.59-patches-11.tar.xz 22032 BLAKE2B cfdb85aeefa7a71dfd0719de893e9ea3f7118baa0b8c5aa97b3800c1a5743e77d63c35ab1e4afb13c284f5c6dda522d1e2e37f8bfd9bbba052e543af7401565b SHA512 cac3f2efc8b3f18cdf43474453acc406c5b469ecc11955f8216083a4deced887aea4a73221aa36f0bc6b7480788606f969ee1df15a8932ee771fdf790e98c00c
 DIST emacs-18.59.tar.gz 2962652 BLAKE2B d617636daff41e672af2dcda26ec24b2495cf0a3e6373561ee26a2a922b7252c074dd6b79289d771853a4720c60f084f5726b904bf65989718173232ac874b0b SHA512 03ce565e346e89b7aacb1852f4783e8907f394de7da0c543b475cb038eb89b87f980d0f7ca1841b1d2108b20f211e95113c7214e4a33e5767a1827ff43173f33
 DIST emacs-23.4-patches-21.tar.xz 19604 BLAKE2B 97327f2079c496c28122203d233a12199a3c11a8c4efb2107247a4ca4483b898467d73d19d4f0570ec7be2a49dc5f6bd1bc9ee0811f932e7deb6b1c4ca96e362 SHA512 135eda432de64200797456d594f7de811275a7adf792d10a1c3a51ca4bbbbaa3a2c682b9fd577c4d93fbce967ca08d4ac47eb45f031477c3e44c69c14d5d5b48
 DIST emacs-23.4.tar.bz2 38646508 BLAKE2B 33dac5d27a63b7aab6b4053964a0ecf7f7939c7aea5af15103f2da7bd34fbb18dba7a1bf44cc4fcc2e3fb1439cdf7085d8dfc4b0005f5485748996e75ca6872d SHA512 def7a95ecaefae24d8102b96b1d575a23def1b11a8f0bb17b68f7913bd118e2ea4449a8feee76c1bd649f099b70419f0d494ddd9bb32b26f92720cda842b0296

diff --git a/app-editors/emacs/emacs-18.59-r12.ebuild b/app-editors/emacs/emacs-18.59-r12.ebuild
new file mode 100644
index 00000000000..48dbd0a516e
--- /dev/null
+++ b/app-editors/emacs/emacs-18.59-r12.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs flag-o-matic multilib
+
+DESCRIPTION="The extensible self-documenting text editor"
+HOMEPAGE="https://www.gnu.org/software/emacs/"
+SRC_URI="ftp://ftp.gnu.org/old-gnu/emacs/${P}.tar.gz
+	ftp://ftp.splode.com/pub/users/friedman/emacs/${P}-linux22x-elf-glibc21.diff.gz
+	https://dev.gentoo.org/~ulm/emacs/${P}-patches-11.tar.xz"
+
+LICENSE="GPL-1+ GPL-2+ BSD HPND"
+SLOT="18"
+KEYWORDS="~amd64 ~x86"
+IUSE="abi_x86_x32 X"
+
+RDEPEND=">=app-eselect/eselect-emacs-1.16
+	sys-libs/ncurses:0=
+	amd64? (
+		abi_x86_x32? ( >=sys-libs/ncurses-5.9-r3:0=[abi_x86_x32(-)?] )
+		!abi_x86_x32? ( >=sys-libs/ncurses-5.9-r3:0=[abi_x86_32(-)] )
+	)
+	X? ( x11-libs/libX11 )"
+
+DEPEND="${RDEPEND}
+	X? (
+		x11-base/xorg-proto
+		x11-misc/xbitmaps
+	)"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES="../${P}-linux22x-elf-glibc21.diff ../patch"
+
+src_prepare() {
+	default
+
+	# Do not use the sandbox, or the dumped Emacs will be twice as large
+	sed -i -e 's:\./temacs.*dump:SANDBOX_ON=0 LD_PRELOAD= env &:' \
+		src/ymakefile || die
+}
+
+src_configure() {
+	# autoconf? What's autoconf? We are living in 1992. ;-)
+	local arch
+	case ${ARCH} in
+		amd64)
+			if use abi_x86_x32; then
+				arch=x86-x32
+				multilib_toolchain_setup x32
+			else
+				arch=intel386
+				multilib_toolchain_setup x86
+			fi
+			;;
+		x86) arch=intel386 ;;
+		*) die "Architecture ${ARCH} not yet supported" ;;
+	esac
+	local cmd="s/\"s-.*\.h\"/\"s-linux.h\"/;s/\"m-.*\.h\"/\"m-${arch}.h\"/"
+	use X && cmd="${cmd};s/.*\(#define HAVE_X_WINDOWS\).*/\1/"
+	sed -e "${cmd}" src/config.h-dist >src/config.h || die
+
+	cat <<-END >src/paths.h
+		#define PATH_LOADSEARCH "/usr/share/emacs/${PV}/lisp"
+		#define PATH_EXEC "/usr/share/emacs/${PV}/etc"
+		#define PATH_LOCK "/var/lib/emacs/lock/"
+		#define PATH_SUPERLOCK "/var/lib/emacs/lock/!!!SuperLock!!!"
+	END
+
+	sed -i -e "s:/usr/lib/\([^ ]*\).o:/usr/$(get_libdir)/\1.o:g" \
+		-e "s:-lncurses:$("$(tc-getPKG_CONFIG)" --libs ncurses):" \
+		src/s-linux.h || die
+
+	# -O3 and -finline-functions cause segmentation faults at run time.
+	# -Wno-implicit will quieten GCC 5; feel free to submit a patch
+	# adding all those missing prototypes.
+	strip-flags
+	filter-flags -finline-functions -fpie
+	append-flags -Wno-implicit
+	append-ldflags $(test-flags -no-pie)	#639562
+	replace-flags -O[3-9] -O2
+}
+
+src_compile() {
+	addpredict /var/lib/emacs/lock
+	emake --jobs=1 \
+		CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Demacs" \
+		LD="$(tc-getCC) -nostdlib" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+	local basedir="/usr/share/emacs/${PV}" i
+
+	dodir ${basedir}
+	dodir /usr/share/man/man1
+	emake --jobs=1 \
+		LIBDIR="${D}"${basedir} \
+		BINDIR="${D}"/usr/bin \
+		MANDIR="${D}"/usr/share/man/man1 \
+		install
+
+	rmdir "${D}"${basedir}/lock || die
+	find "${D}"${basedir} -type f \( -name "*.c" -o -name ChangeLog \
+		-o -name COPYING ! -path "*/etc/COPYING" \) -exec rm "{}" + || die
+	fperms -R go-w ${basedir}
+
+	# remove duplicate DOC file
+	rm "${D}"${basedir}/etc/DOC || die
+
+	# move executables to the correct place
+	mv "${D}"/usr/bin/emacs{,-${SLOT}} || die
+	for i in etags ctags emacsclient; do
+		mv "${D}"/usr/bin/${i}{,-emacs-${SLOT}} || die
+		rm "${D}"${basedir}/etc/${i} || die
+	done
+
+	dodir /usr/libexec/emacs/${PV}
+	for i in wakeup digest-doc sorted-doc movemail cvtmail fakemail \
+		yow env server
+	do
+		mv "${D}"${basedir}/etc/${i} "${D}"/usr/libexec/emacs/${PV}/${i} || die
+		dosym ../../../../libexec/emacs/${PV}/${i} ${basedir}/etc/${i}
+	done
+	for i in test-distrib make-docfile; do
+		rm "${D}"${basedir}/etc/${i} || die
+	done
+
+	# move man page
+	mv "${D}"/usr/share/man/man1/emacs{,-${SLOT}}.1 || die
+
+	# move Info files
+	dodir /usr/share/info
+	mv "${D}"${basedir}/info "${D}"/usr/share/info/emacs-${SLOT} || die
+	dosym ../../info/emacs-${SLOT} "${basedir}"/info
+	docompress -x /usr/share/info
+
+	# move Info dir to avoid collisions with the dir file generated by portage
+	mv "${D}"/usr/share/info/emacs-${SLOT}/dir{,.orig} || die
+	touch "${D}"/usr/share/info/emacs-${SLOT}/.keepinfodir
+
+	dodir /var/lib/emacs
+	diropts -m0777
+	keepdir /var/lib/emacs/lock
+
+	dodoc README PROBLEMS
+}
+
+pkg_preinst() {
+	# move Info dir file to correct name
+	if [[ -d "${D}"/usr/share/info ]]; then
+		mv "${D}"/usr/share/info/emacs-${SLOT}/dir{.orig,} || die
+	fi
+}
+
+pkg_postinst() {
+	eselect emacs update ifunset
+}
+
+pkg_postrm() {
+	eselect emacs update ifunset
+}