dev-lang/ucblogo: new revision to fix a few open bugs.
authorMichael Orlitzky <mjo@gentoo.org>
Sun, 14 Aug 2016 23:40:54 +0000 (19:40 -0400)
committerMichael Orlitzky <mjo@gentoo.org>
Sun, 14 Aug 2016 23:42:52 +0000 (19:42 -0400)
The build system for this package forces -O0, and we have an ancient
bug for that. The only way to fix it is with a patch, and this new
revision adds a patch stripping the -O0.

There is also a build failure in the existing 6.x series
ebuilds. There is wxWidgets support hidden behind USE=X, but we make a
call to some wxWidgets stuff unconditionally and it crashes when
wxWidgets is not present (i.e. with USE="-X").

The elisp-common eclass is no longer used and has been dropped. A call
to strip-flags has been removed, and flag-o-matic "downgraded" to
toolchain-funcs.

Gentoo-Bug: 327359
Gentoo-Bug: 584602

Package-Manager: portage-2.2.28

dev-lang/ucblogo/files/ucblogo-6.0-optimization-flags.patch [new file with mode: 0644]
dev-lang/ucblogo/ucblogo-6.0-r2.ebuild [new file with mode: 0644]

diff --git a/dev-lang/ucblogo/files/ucblogo-6.0-optimization-flags.patch b/dev-lang/ucblogo/files/ucblogo-6.0-optimization-flags.patch
new file mode 100644 (file)
index 0000000..15a097c
--- /dev/null
@@ -0,0 +1,26 @@
+commit 5971737bac9a6f0d74f9292342a0e15530960e23
+Author: Michael Orlitzky <michael@orlitzky.com>
+Date:   Sun Aug 14 16:37:07 2016 -0400
+
+    Don't kill optimization in makefile.in.
+
+diff --git a/makefile.in b/makefile.in
+index 2eadd50..e56164d 100644
+--- a/makefile.in
++++ b/makefile.in
+@@ -1,5 +1,5 @@
+ CC    = @CC@
+-CFLAGS        = @CFLAGS@ @CPPFLAGS@ @X_CFLAGS@ -O0 -DUSE_OLD_TTY
++CFLAGS        = @CFLAGS@ @CPPFLAGS@ @X_CFLAGS@ -DUSE_OLD_TTY
+ CXX     = g++
+ CXXFLAGS = @CXXFLAGS@
+ LDFLAGS       = @LDFLAGS@
+@@ -28,7 +28,7 @@ everything:  logo logolib/Messages helpfiles helpfiles/HELPCONTENTS
+ #logo-mode
+ mem.o:        mem.c
+-      $(CC) $(CFLAGS) -O0 -c mem.c
++      $(CC) $(CFLAGS) -c mem.c
+ svn.c:        $(SRCS)
+       echo 'char* SVN = "('`svnversion|tr -d '\r'`')";' > svn.c
diff --git a/dev-lang/ucblogo/ucblogo-6.0-r2.ebuild b/dev-lang/ucblogo/ucblogo-6.0-r2.ebuild
new file mode 100644 (file)
index 0000000..3196383
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs wxwidgets
+
+DESCRIPTION="a reflective, functional programming language"
+HOMEPAGE="https://www.cs.berkeley.edu/~bh/logo.html"
+SRC_URI="ftp://ftp.cs.berkeley.edu/pub/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+DEPEND="
+       app-text/texi2html
+       dev-libs/libbsd
+       virtual/tex-base
+       virtual/texi2dvi
+       X? ( x11-libs/wxGTK:2.8[X] )"
+
+PATCHES=(
+       "${FILESDIR}/${P}-wx.patch"
+       "${FILESDIR}/${P}-no-libtermcap.patch"
+       "${FILESDIR}/${P}-texi.patch"
+       "${FILESDIR}/${P}-destdir.patch"
+       "${FILESDIR}/${P}-optimization-flags.patch"
+)
+
+src_prepare() {
+       default
+
+       # Drop math.h in two places to fix the build, bug 565122.
+       sed -i -e "/math.h/d" coms.c \
+               || die 'failed to drop math.h from coms.c'
+
+       sed -i -e "/math.h/d" graphics.c \
+               || die 'failed to drop math.h from graphics.c'
+
+       if use X ; then
+               WX_GTK_VER=2.8 need-wxwidgets unicode
+
+               sed -i -e "s_/usr/local/bin/wx-config_${WX_CONFIG}_g" configure-gtk \
+                       || die 'failed to fix wx-config in configure-gtk script'
+
+               sed -i -e 's_--host=gtk__g' configure-gtk \
+                       || die 'failed to fix --host in configure-gtk script'
+       fi
+
+       sed -i -e "s_/lib/logo_/share/${PN}_" makefile.in \
+               || die 'failed to fix data path in makefile.in'
+
+       sed -i -e "/doc$/s_\$_/${PF}_" docs/makefile \
+               || die 'failed to fix docs path in docs/makefile'
+
+       rm -rf csls/CVS || die 'failed to remove useless CVS directory'
+}
+
+src_configure() {
+       if use X ; then
+               ./configure-gtk --prefix=/usr --with-x --wx-enable \
+                       || die 'configure script returned an error'
+       else
+               econf --without-x --wx-disable
+       fi
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}