summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2022-02-14 16:47:12 +0100
committerMaciej Barć <xgqt@gentoo.org>2022-02-14 16:48:15 +0100
commit10954586c34ff2f36282e86f250f110bc9e2dfbd (patch)
tree84b35b4a82660d89876c2e3d45ca416fc8b7d1dc /dev-scheme
parentdev-libs/libunistring: update metadata (diff)
downloadgentoo-10954586c34ff2f36282e86f250f110bc9e2dfbd.tar.gz
gentoo-10954586c34ff2f36282e86f250f110bc9e2dfbd.tar.bz2
gentoo-10954586c34ff2f36282e86f250f110bc9e2dfbd.zip
dev-scheme/racket: patch ncurses for expeditor support
Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'dev-scheme')
-rw-r--r--dev-scheme/racket/files/racket-8.4-ncurses.patch154
-rw-r--r--dev-scheme/racket/metadata.xml3
-rw-r--r--dev-scheme/racket/racket-8.4-r1.ebuild (renamed from dev-scheme/racket/racket-8.4.ebuild)11
3 files changed, 167 insertions, 1 deletions
diff --git a/dev-scheme/racket/files/racket-8.4-ncurses.patch b/dev-scheme/racket/files/racket-8.4-ncurses.patch
new file mode 100644
index 000000000000..4bf429d82daa
--- /dev/null
+++ b/dev-scheme/racket/files/racket-8.4-ncurses.patch
@@ -0,0 +1,154 @@
+From 683388b0fcc8d0cc386e0ab749bcbba7cea18c8f Mon Sep 17 00:00:00 2001
+From: Matthew Flatt <mflatt@racket-lang.org>
+Date: Mon, 14 Feb 2022 06:26:25 -0700
+Subject: [PATCH] configure: try -ltinfo as curses linking flag
+
+---
+ ac/curses.m4 | 21 +++++++++++++++++++--
+ bc/configure | 34 +++++++++++++++++++++++++++++++++-
+ cs/c/configure | 34 +++++++++++++++++++++++++++++++++-
+ 3 files changed, 85 insertions(+), 4 deletions(-)
+
+diff --git a/ac/curses.m4 b/ac/curses.m4
+index 25b0f1f99a3..d713c990949 100644
+--- a/ac/curses.m4
++++ b/ac/curses.m4
+@@ -22,7 +22,7 @@ if test "${skip_curses_check}" = "no" ; then
+ if test "${enable_curses}" = "no" ; then
+ if test "${enable_portable}" = "yes" ; then
+ if test "${curses_portable_link}" != "" ; then
+- # Try adding portabel link flags
++ # Try adding portable link flags
+ ORIG_LIBS="$LIBS"
+ ORIG_CPPFLAGS="$CPPFLAGS"
+ ORIG_PREFLAGS="$PREFLAGS"
+@@ -62,7 +62,24 @@ if test "${skip_curses_check}" = "no" ; then
+ LIBS="$ORIG_LIBS"
+ curses_lib_flag=""
+ fi
+- fi
++ fi
++ if test "${enable_curses}" = "no" ; then
++ # Try adding -lncurses -ltinfo
++ ORIG_LIBS="$LIBS"
++ curses_lib_flag=" -lncurses -ltinfo"
++ LIBS="$LIBS $curses_lib_flag"
++ AC_TRY_LINK(
++ [#include <curses.h>]
++ [#include <term.h>],
++[ int errret; ]
++[ setupterm("", 0, &errret);]
++ return 0;
++ , enable_curses=yes, enable_curses=no)
++ if test "${enable_curses}" = "no" ; then
++ LIBS="$ORIG_LIBS"
++ curses_lib_flag=""
++ fi
++ fi
+ fi
+ fi
+ fi
+diff --git a/bc/configure b/bc/configure
+index 543fab87411..132d2dedd6c 100755
+--- a/bc/configure
++++ b/bc/configure
+@@ -5991,7 +5991,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ if test "${enable_curses}" = "no" ; then
+ if test "${enable_portable}" = "yes" ; then
+ if test "${curses_portable_link}" != "" ; then
+- # Try adding portabel link flags
++ # Try adding portable link flags
+ ORIG_LIBS="$LIBS"
+ ORIG_CPPFLAGS="$CPPFLAGS"
+ ORIG_PREFLAGS="$PREFLAGS"
+@@ -6055,6 +6055,38 @@ if ac_fn_c_try_link "$LINENO"; then :
+ else
+ enable_curses=no
+ fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ if test "${enable_curses}" = "no" ; then
++ LIBS="$ORIG_LIBS"
++ curses_lib_flag=""
++ fi
++ fi
++ if test "${enable_curses}" = "no" ; then
++ # Try adding -lncurses -ltinfo
++ ORIG_LIBS="$LIBS"
++ curses_lib_flag=" -lncurses -ltinfo"
++ LIBS="$LIBS $curses_lib_flag"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <curses.h>
++ #include <term.h>
++int
++main ()
++{
++ int errret;
++ setupterm("", 0, &errret);
++ return 0;
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ enable_curses=yes
++else
++ enable_curses=no
++fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "${enable_curses}" = "no" ; then
+diff --git a/cs/c/configure b/cs/c/configure
+index db2132b7f4d..2ec78292f56 100755
+--- a/cs/c/configure
++++ b/cs/c/configure
+@@ -5635,7 +5635,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ if test "${enable_curses}" = "no" ; then
+ if test "${enable_portable}" = "yes" ; then
+ if test "${curses_portable_link}" != "" ; then
+- # Try adding portabel link flags
++ # Try adding portable link flags
+ ORIG_LIBS="$LIBS"
+ ORIG_CPPFLAGS="$CPPFLAGS"
+ ORIG_PREFLAGS="$PREFLAGS"
+@@ -5699,6 +5699,38 @@ if ac_fn_c_try_link "$LINENO"; then :
+ else
+ enable_curses=no
+ fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ if test "${enable_curses}" = "no" ; then
++ LIBS="$ORIG_LIBS"
++ curses_lib_flag=""
++ fi
++ fi
++ if test "${enable_curses}" = "no" ; then
++ # Try adding -lncurses -ltinfo
++ ORIG_LIBS="$LIBS"
++ curses_lib_flag=" -lncurses -ltinfo"
++ LIBS="$LIBS $curses_lib_flag"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <curses.h>
++ #include <term.h>
++int
++main ()
++{
++ int errret;
++ setupterm("", 0, &errret);
++ return 0;
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ enable_curses=yes
++else
++ enable_curses=no
++fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test "${enable_curses}" = "no" ; then
diff --git a/dev-scheme/racket/metadata.xml b/dev-scheme/racket/metadata.xml
index e33886b2c545..8a10d666d3ee 100644
--- a/dev-scheme/racket/metadata.xml
+++ b/dev-scheme/racket/metadata.xml
@@ -26,6 +26,9 @@ Whether you're just starting out, want to know more about programming language a
<flag name="futures">
Enable racket/future library for fine-grained hardware parallelism
</flag>
+ <flag name="ncurses">
+ Add ncurses support for expeditor (REPL expression editor)
+ </flag>
<flag name="places">
Enable racket/place library for share-nothing parallelism and message-passing communication. Compared to futures, places are heavyweight, but they have a simpler performance model.
</flag>
diff --git a/dev-scheme/racket/racket-8.4.ebuild b/dev-scheme/racket/racket-8.4-r1.ebuild
index ba7263a23ea8..1dae6d9cdb89 100644
--- a/dev-scheme/racket/racket-8.4.ebuild
+++ b/dev-scheme/racket/racket-8.4-r1.ebuild
@@ -25,7 +25,7 @@ LICENSE="
# where we use _p, _pre, etc it will have to be set manually.
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
-IUSE="+chez +doc +futures +jit minimal +places +threads"
+IUSE="+chez +doc +futures +jit minimal ncurses +places +threads"
# See bug #809785 re chez/threads
REQUIRED_USE="chez? ( futures places ) futures? ( jit threads ) places? ( threads )"
@@ -33,9 +33,17 @@ DEPEND="
!dev-tex/slatex
dev-db/sqlite:3
dev-libs/libffi:=
+ ncurses? ( sys-libs/ncurses:= )
"
RDEPEND="${DEPEND}"
+# Backports that will be probably available in next release (8.5)
+PATCHES=(
+ # Pick correct ncurses library
+ # https://github.com/racket/racket/commit/683388b0fcc8d0cc386e0ab749bcbba7cea18c8f
+ "${FILESDIR}"/${P}-ncurses.patch
+)
+
# "mred" and "mzscheme" are binaries generated by Racket, not CC
QA_FLAGS_IGNORED="usr/bin/mred usr/bin/mzscheme"
@@ -81,6 +89,7 @@ src_configure() {
--enable-libs
$(usex chez "--enable-cs --enable-csonly" "--enable-bc --enable-bconly")
$(use_enable doc docs)
+ $(use_enable ncurses curses)
)
# Some options are togglable only for the BC version (are forced in CS)
! use chez && myconf+=(