Skip to content

Commit

Permalink
dev-lang/icon: Fixes compile error with glibc 2.28
Browse files Browse the repository at this point in the history
Added patch pending upstream patch approval

Bug: https://bugs.gentoo.org/669330
Closes: gentoo#10288
Package-Manager: Portage-2.3.49, Repoman-2.3.11
Signed-off-by: Cheyenne Wills <[email protected]>
Signed-off-by: Georgy Yakovlev <[email protected]>
  • Loading branch information
CheyenneWills authored and gyakovlev committed Dec 2, 2018
1 parent a5e71b0 commit e620872
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dev-lang/icon/files/icon-9.5.1-fpoll.patch
Original file line number Diff line number Diff line change
@@ -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 */
114 changes: 114 additions & 0 deletions dev-lang/icon/icon-9.5.1-r2.ebuild
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit e620872

Please sign in to comment.