diff options
author | Tupone Alfredo <tupone@gentoo.org> | 2019-11-12 08:52:58 +0100 |
---|---|---|
committer | Tupone Alfredo <tupone@gentoo.org> | 2019-11-12 08:54:35 +0100 |
commit | 2705f66062e618aa4315ecda01d9bf8e3022e495 (patch) | |
tree | a199e8f7331a91393c7e8abe33c6c7a642cf5146 /dev-tcltk | |
parent | dev-util/rr: tweak build for glibc-2.30, bug #699886 (diff) | |
download | gentoo-2705f66062e618aa4315ecda01d9bf8e3022e495.tar.gz gentoo-2705f66062e618aa4315ecda01d9bf8e3022e495.tar.bz2 gentoo-2705f66062e618aa4315ecda01d9bf8e3022e495.zip |
dev-tcltk/blt: Fix some segfault
Bugs: https://bugs.gentoo.org/699364
Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'dev-tcltk')
-rw-r--r-- | dev-tcltk/blt/blt-2.4z-r14.ebuild | 128 | ||||
-rw-r--r-- | dev-tcltk/blt/files/blt-2.4z-gentoo.patch | 50 |
2 files changed, 178 insertions, 0 deletions
diff --git a/dev-tcltk/blt/blt-2.4z-r14.ebuild b/dev-tcltk/blt/blt-2.4z-r14.ebuild new file mode 100644 index 000000000000..896f8c28b833 --- /dev/null +++ b/dev-tcltk/blt/blt-2.4z-r14.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools eutils flag-o-matic multilib toolchain-funcs + +MY_V_SUFFIX="-8.5.2" + +DESCRIPTION="Extension to Tk, adding new widgets, geometry managers, and misc commands" +HOMEPAGE=" + http://blt.sourceforge.net/ + http://jos.decoster.googlepages.com/bltfortk8.5.2" +SRC_URI=" + https://dev.gentoo.org/~jlec/distfiles/${PN}${PV}${MY_V_SUFFIX}.tar.gz + http://jos.decoster.googlepages.com/${PN}${PV}${MY_V_SUFFIX}.tar.gz" + +IUSE="jpeg static-libs X" +SLOT="0" +LICENSE="BSD" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +DEPEND=" + dev-lang/tk:0= + jpeg? ( virtual/jpeg:0= ) + X? ( x11-libs/libX11 )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${PN}${PV}${MY_V_SUFFIX}" + +MAKEOPTS+=" -j1" + +src_prepare() { + epatch "${FILESDIR}/blt-2.4z-r4-fix-makefile2.patch" + epatch "${FILESDIR}/blt-2.4z-r4-fix-makefile3.patch" + # From blt-2.4z-6mdk.src.rpm + epatch "${FILESDIR}"/blt2.4z-64bit.patch + + epatch "${FILESDIR}"/blt-2.4z-tcl8.5-fixpkgruntime.patch + + epatch "${FILESDIR}"/${P}-ldflags.patch + + # Set the correct libdir and drop RPATH + sed \ + -e "s:\(^libdir=\${exec_prefix}/\)lib:\1$(get_libdir):" \ + -e 's:LD_RUN_PATH=.*$:LD_RUN_PATH="":g' \ + -e "/RANLIB/s:ranlib:$(tc-getRANLIB):g" \ + -i configure* || die "sed configure* failed" + sed \ + -e "/^scriptdir =/s:lib:$(get_libdir):" \ + -i Makefile.in demos/Makefile.in || die "sed Makefile.in failed" + + sed \ + -e "/AR/s:ar:$(tc-getAR):g" \ + -e 's:0444:0644:g' \ + -i src/Makefile.in || die + + epatch \ + "${FILESDIR}"/${P}-linking.patch \ + "${FILESDIR}"/${P}-darwin.patch \ + "${FILESDIR}"/${P}-gbsd.patch \ + "${FILESDIR}"/${P}-tk8.6.patch \ + "${FILESDIR}"/${P}-tcl8.6.patch \ + "${FILESDIR}"/${P}-gentoo.patch \ + "${FILESDIR}"/${P}-aclocal.patch + + append-cflags -fPIC + + mv configure.{in,ac} || die + + default + + eautoreconf +} + +src_configure() { + LC_ALL=C \ + econf \ + --x-includes="${EPREFIX}/usr/include" \ + --x-libraries="${EPREFIX}/usr/$(get_libdir)" \ + --with-blt="${EPREFIX}/usr/$(get_libdir)" \ + --with-tcl="${EPREFIX}/usr/$(get_libdir)" \ + --with-tk="${EPREFIX}/usr/$(get_libdir)" \ + --with-tclincls="${EPREFIX}/usr/include" \ + --with-tkincls="${EPREFIX}/usr/include" \ + --with-tcllibs="${EPREFIX}/usr/$(get_libdir)" \ + --with-tklibs="${EPREFIX}/usr/$(get_libdir)" \ + --with-cc="$(tc-getCC)" \ + --with-cflags="${CFLAGS}" \ + --with-gnu-ld \ + $(use_enable jpeg) \ + $(use_with X x) +} + +src_compile() { + emake LDFLAGS="${LDFLAGS}" +} + +src_install() { + sed \ + -e "s:\.\./src/bltwish:${EPREFIX}/usr/bin/bltwish:g" \ + -e "s:\.\./bltwish:${EPREFIX}/usr/bin/bltwish:g" \ + -e "s:/usr/local/bin/bltwish:${EPREFIX}/usr/bin/bltwish:g" \ + -e "s:/usr/local/bin/tclsh:${EPREFIX}/usr/bin/tclsh:g" \ + -i demos/{,scripts/}*.tcl || die + + dodir \ + /usr/bin \ + /usr/$(get_libdir)/blt2.4/demos/bitmaps \ + /usr/share/man/mann \ + /usr/include + + emake INSTALL_ROOT="${D}" install + + dodoc NEWS PROBLEMS README + dohtml html/*.html + for f in `ls "${ED}"/usr/share/man/mann` ; do + mv "${ED}"/usr/share/man/mann/${f} "${ED}"/usr/share/man/mann/${f/.n/.nblt} || die + done + + # fix for linking against shared lib with -lBLT or -lBLTlite + dosym libBLT24$(get_libname) /usr/$(get_libdir)/libBLT$(get_libname) + dosym libBLTlite24$(get_libname) /usr/$(get_libdir)/libBLTlite$(get_libname) + + use static-libs || \ + find "${ED}"/usr/$(get_libdir) -name "*.a" -print0 | \ + xargs -r -0 rm -fv +} diff --git a/dev-tcltk/blt/files/blt-2.4z-gentoo.patch b/dev-tcltk/blt/files/blt-2.4z-gentoo.patch new file mode 100644 index 000000000000..c0d0d7f7bfe1 --- /dev/null +++ b/dev-tcltk/blt/files/blt-2.4z-gentoo.patch @@ -0,0 +1,50 @@ +--- a/src/bltInit.c 2019-11-09 22:03:25.863937619 +0100 ++++ b/src/bltInit.c 2019-11-09 22:03:37.052748213 +0100 +@@ -413,7 +413,7 @@ + * Check that the versions of Tcl that have been loaded are + * the same ones that BLT was compiled against. + */ +- if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { ++ if (Tcl_InitStubs(interp, TCL_PATCH_LEVEL, 1) == NULL) { + return TCL_ERROR; + } + /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl +@@ -458,7 +458,7 @@ + register Tcl_AppInitProc **p; + Tcl_Namespace *nsPtr; + +- if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) { ++ if (Tk_InitStubs(interp, TK_PATCH_LEVEL, 1) == NULL) { + return TCL_OK; + } + +--- a/src/bltHtext.c 2019-11-10 21:37:10.229076065 +0100 ++++ b/src/bltHtext.c 2019-11-10 21:38:24.835776868 +0100 +@@ -3347,7 +3347,8 @@ + * The page is always draw at full width and the viewport will clip + * the text. + */ ++ if (htPtr->lineArr) { + if ((htPtr->first != oldFirst) || (htPtr->last != oldLast)) { + int offset; + int i; + int first, last; +@@ -3378,6 +3378,7 @@ + } + DrawPage(htPtr, deltaY); ++ } + SendBogusEvent(tkwin); + + /* Reset flags */ + htPtr->flags &= ~TEXT_DIRTY; +--- a/src/bltText.c 2019-11-12 08:33:39.905088060 +0100 ++++ b/src/bltText.c 2019-11-12 08:34:01.995349355 +0100 +@@ -48,7 +48,7 @@ + + fragPtr = textPtr->fragArr; + for (i = 0; i < textPtr->nFrags; i++, fragPtr++) { +-#if HAVE_UTF ++#if 0 + Tk_DrawChars(display, drawable, gc, font, fragPtr->text, + fragPtr->count, x + fragPtr->x, y + fragPtr->y); + #else |