Re-enable ncurses5

Needed to bootstrap ghc.
This commit is contained in:
Adrien Destugues
2018-08-11 16:30:02 +02:00
parent b187490e69
commit 05fb58219a
3 changed files with 105 additions and 53 deletions

View File

@@ -17,14 +17,13 @@ tools."
HOMEPAGE="http://www.gnu.org/software/ncurses/ncurses.html"
COPYRIGHT="1998-2011 Free Software Foundation, Inc."
LICENSE="MIT"
REVISION="12"
REVISION="13"
SOURCE_URI="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz"
CHECKSUM_SHA256="9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b"
PATCHES="ncurses-5.9.patchset
ncurses-5.9-gcc-5.patch"
PATCHES="ncurses-5.9.patchset"
ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64 ?arm"
SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64 ?arm"
SECONDARY_ARCHITECTURES="?x86_gcc2 x86"
PROVIDES="
ncurses$secondaryArchSuffix = $portVersion compat >= 5

View File

@@ -1,46 +0,0 @@
https://bugs.gentoo.org/545114
extracted from the upstream change (which had many unrelated commits in one)
From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
From: "Thomas E. Dickey" <dickey@invisible-island.net>
Date: Sun, 7 Dec 2014 03:10:09 +0000
Subject: [PATCH] ncurses 5.9 - patch 20141206
+ modify MKlib_gen.sh to work around change in development version of
gcc introduced here:
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
(reports by Marcus Shawcroft, Maohui Lei).
diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
index d8cc3c9..b91398c 100755
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -474,11 +474,22 @@ sed -n -f $ED1 \
-e 's/gen_$//' \
-e 's/ / /g' >>$TMP
+cat >$ED1 <<EOF
+s/ / /g
+s/^ //
+s/ $//
+s/P_NCURSES_BOOL/NCURSES_BOOL/g
+EOF
+
+# A patch discussed here:
+# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+# introduces spurious #line markers. Work around that by ignoring the system's
+# attempt to define "bool" and using our own symbol here.
+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
+cat $ED2 >$TMP
+
$preprocessor $TMP 2>/dev/null \
-| sed \
- -e 's/ / /g' \
- -e 's/^ //' \
- -e 's/_Bool/NCURSES_BOOL/g' \
+| sed -f $ED1 \
| $AWK -f $AW2 \
| sed -f $ED3 \
| sed \

View File

@@ -1,4 +1,4 @@
From c10c7316b0be6ee2249ee2eeeeea6bbeb973d4cd Mon Sep 17 00:00:00 2001
From 37e997f3fcf44261e3af16289f7412f63c7060d8 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Mon, 8 Jul 2013 15:51:09 +0200
Subject: progs/Makefile.in: make sure the right programs are installed
@@ -38,5 +38,104 @@ index bdb8a0f..f3170f1 100644
-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
--
1.7.10.2
2.16.4
From da0fc621f822b1a96893382c96671a6107d4c8fc Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 11 Aug 2018 15:25:13 +0200
Subject: applying patch ncurses-5.9-gcc-5.patch
diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
index 66ae295..b92f22b 100755
--- a/ncurses/base/MKlib_gen.sh
+++ b/ncurses/base/MKlib_gen.sh
@@ -437,11 +437,22 @@ sed -n -f $ED1 \
-e 's/gen_$//' \
-e 's/ / /g' >>$TMP
+cat >$ED1 <<EOF
+s/ / /g
+s/^ //
+s/ $//
+s/P_NCURSES_BOOL/NCURSES_BOOL/g
+EOF
+
+# A patch discussed here:
+# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+# introduces spurious #line markers. Work around that by ignoring the system's
+# attempt to define "bool" and using our own symbol here.
+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
+cat $ED2 >$TMP
+
$preprocessor $TMP 2>/dev/null \
-| sed \
- -e 's/ / /g' \
- -e 's/^ //' \
- -e 's/_Bool/NCURSES_BOOL/g' \
+| sed -f $ED1 \
| $AWK -f $AW2 \
| sed -f $ED3 \
| sed \
--
2.16.4
From f3bd12f6cbc6838c00758b2a0d2d57223cc2d429 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 11 Aug 2018 16:23:27 +0200
Subject: gcc7 build fix.
diff --git a/c++/cursesf.h b/c++/cursesf.h
index 70a30c3..21eae51 100644
--- a/c++/cursesf.h
+++ b/c++/cursesf.h
@@ -381,7 +381,7 @@ protected:
uptr->m_user = user;
}
- inline void *get_user() {
+ inline void *get_user() const {
UserHook* uptr = reinterpret_cast<UserHook*>(::form_userptr (form));
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form);
return uptr->m_user;
diff --git a/c++/cursesm.h b/c++/cursesm.h
index d9c2273..f2d9466 100644
--- a/c++/cursesm.h
+++ b/c++/cursesm.h
@@ -242,7 +242,7 @@ protected:
uptr->m_user = user;
}
- inline void *get_user() {
+ inline void *get_user() const {
UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu));
assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu);
return uptr->m_user;
diff --git a/c++/cursesp.h b/c++/cursesp.h
index 9b63d6d..ca8f283 100644
--- a/c++/cursesp.h
+++ b/c++/cursesp.h
@@ -58,7 +58,7 @@ private:
const PANEL* m_owner; // the panel itself
} UserHook;
- inline UserHook *UserPointer()
+ inline UserHook *UserPointer() const
{
UserHook* uptr = reinterpret_cast<UserHook*>(
const_cast<void *>(::panel_userptr (p)));
@@ -77,7 +77,7 @@ protected:
}
// Set the user pointer of the panel.
- void *get_user()
+ void *get_user() const
{
UserHook* uptr = UserPointer();
void *result = 0;
--
2.16.4