From e6208724793683c9c07dd2741483d39797dca1a2 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Sun, 28 Oct 2018 19:10:29 -0600 Subject: dev-lang/icon: Fixes compile error with glibc 2.28 Added patch pending upstream patch approval Bug: https://bugs.gentoo.org/669330 Closes: https://github.com/gentoo/gentoo/pull/10288 Package-Manager: Portage-2.3.49, Repoman-2.3.11 Signed-off-by: Cheyenne Wills Signed-off-by: Georgy Yakovlev --- dev-lang/icon/files/icon-9.5.1-fpoll.patch | 27 +++++++ dev-lang/icon/icon-9.5.1-r2.ebuild | 114 +++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 dev-lang/icon/files/icon-9.5.1-fpoll.patch create mode 100644 dev-lang/icon/icon-9.5.1-r2.ebuild diff --git a/dev-lang/icon/files/icon-9.5.1-fpoll.patch b/dev-lang/icon/files/icon-9.5.1-fpoll.patch new file mode 100644 index 000000000000..d2a4d5f33d21 --- /dev/null +++ b/dev-lang/icon/files/icon-9.5.1-fpoll.patch @@ -0,0 +1,27 @@ +diff --git a/ipl/cfuncs/fpoll.c b/ipl/cfuncs/fpoll.c +index 9230e18..33b8121 100644 +--- a/ipl/cfuncs/fpoll.c ++++ b/ipl/cfuncs/fpoll.c +@@ -60,12 +60,9 @@ int fpoll(int argc, descriptor *argv) /*: await data from file */ + + /* check for data already in buffer */ + /* there's no legal way to do this in C; we cheat */ +-#if defined(__GLIBC__) && defined(_STDIO_USES_IOSTREAM) /* new GCC library */ ++#if defined(__GLIBC__) /* New GCC library */ + if (f->_IO_read_ptr < f->_IO_read_end) + RetArg(1); +-#elif defined(__GLIBC__) /* old GCC library */ +- if (f->__bufp < f->__get_limit) +- RetArg(1); + #elif defined(_FSTDIO) /* new BSD library */ + if (f->_r > 0) + RetArg(1); +@@ -92,7 +89,7 @@ int fpoll(int argc, descriptor *argv) /*: await data from file */ + + if (r > 0) + RetArg(1); /* success */ +- else if (r == 0) ++ else if (r == 0) + Fail; /* timeout */ + else + ArgError(1, 214); /* I/O error */ diff --git a/dev-lang/icon/icon-9.5.1-r2.ebuild b/dev-lang/icon/icon-9.5.1-r2.ebuild new file mode 100644 index 000000000000..5f313ed60aae --- /dev/null +++ b/dev-lang/icon/icon-9.5.1-r2.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="very high level language" +HOMEPAGE="http://www.cs.arizona.edu/icon/" + +MY_PV=${PV//./} +SRC_URI="http://www.cs.arizona.edu/icon/ftp/packages/unix/icon-v${MY_PV}src.tgz" + +LICENSE="public-domain HPND" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="X iplsrc" + +S="${WORKDIR}/icon-v${MY_PV}src" + +RDEPEND=" + X? ( x11-libs/libX11:= )" +DEPEND=" + ${RDEPEND} + X? ( + x11-libs/libXpm + x11-libs/libXt + )" + +PATCHES=( + "${FILESDIR}"/${PN}-9.5.1-flags.patch + # https://bugs.gentoo.org/669330 + # Fix glibc 2.28 problem. + # Patch has also been submitted for upstream approval + "${FILESDIR}"/${PN}-9.5.1-fpoll.patch +) + +src_prepare() { + default + + # do not prestrip files + find src -name 'Makefile' | xargs sed -i -e "/strip/d" || die +} + +src_configure() { + # select the right compile target. Note there are many platforms + # available + local mytarget; + if [[ ${CHOST} == *-darwin* ]]; then + mytarget="macintosh" + else + mytarget="linux" + fi + + # Fails if more then one make job process. + # This is an upstream requirement. + emake -j1 $(usex X X-Configure Configure) name=${mytarget} + + # sanitise the Makedefs file generated by Configure + sed -i \ + -e 's:-L/usr/X11R6/lib64::g' \ + -e 's:-L/usr/X11R6/lib::g' \ + -e 's:-I/usr/X11R6/include::g' \ + Makedefs || die "sed of Makedefs failed" + + append-flags $(test-flags -fno-strict-aliasing -fwrapv) +} + +src_compile() { + # Fails if more then one make job process. + # This is an upstream requirement. + emake -j1 CC="$(tc-getCC)" CFLAGS="${CFLAGS}" +} + +src_test() { + emake Samples + emake Test +} + +src_install() { + # Needed for make Install + dodir /usr/$(get_libdir) + + emake Install dest="${D}/usr/$(get_libdir)/icon" + dosym ../$(get_libdir)/icon/bin/icont /usr/bin/icont + dosym ../$(get_libdir)/icon/bin/iconx /usr/bin/iconx + dosym ../$(get_libdir)/icon/bin/icon /usr/bin/icon + dosym ../$(get_libdir)/icon/bin/vib /usr/bin/vib + + cd "${S}/man/man1" || die + doman "${PN}"t.1 + doman "${PN}".1 + + cd "${S}/doc" || die + DOCS=( *.txt ../README ) + + HTML_DOCS=( *.{htm,gif,jpg,css} ) + einstalldocs + + # Clean up items from make Install that get installed elsewhere + rm -rf "${ED}"/usr/$(get_libdir)/${PN}/man || die + rm -rf "${ED}"/usr/$(get_libdir)/icon/{doc,README} || die + + # optional Icon Programming Library + if use iplsrc; then + cd "${S}" || die + + # Remove unneeded files before copy + rm -fv ipl/{BuildBin,BuildExe,CheckAll,Makefile} || die + + insinto /usr/$(get_libdir)/icon + doins -r ipl + fi +} -- cgit v1.2.3-18-g5258