]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/commitdiff
compat-ncurses: Update to 5.9
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Dec 2022 16:32:57 +0000 (16:32 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Dec 2022 16:32:57 +0000 (16:32 +0000)
This might be a slightly older revision, but we just need this thing for
now.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
compat-ncurses/compat-ncurses.nm
compat-ncurses/patches/0001-Fix-errors-in-type-conversion.patch [new file with mode: 0644]

index 677060fdffb2af0bb5c1dc1ba382db7c5bb7a396..6e36d848a52f11b569a544a60fb4f8042ef10872 100644 (file)
@@ -5,9 +5,8 @@
 
 name       = compat-ncurses
 version    = 5.9
-revision   = 20150117
-release    = 12.%{revision}
-thisapp    = ncurses-%{version}-%{revision}
+release    = 13
+thisapp    = ncurses-%{version}
 
 groups     = System/Base
 url        = http://invisible-island.net/ncurses/ncurses.html
@@ -21,14 +20,16 @@ description
        discontinued 4.4 BSD classic curses library.
 end
 
-source_dl  = ftp://invisible-island.net/ncurses/current/
-sources    = %{thisapp}.tgz
+source_dl  = https://ftp.gnu.org/gnu/ncurses/
 
 build
        requires
                gcc-c++
        end
 
+       export CPPFLAGS += -P
+       CXXFLAGS += -std=c++98
+
        configure_options += \
                --with-shared \
                --without-debug \
@@ -100,6 +101,22 @@ packages
                end
        end
 
+       package compat-ncurses-devel
+               template DEVEL
+
+               requires
+                       compat-ncurses = %{thisver}
+               end
+
+               provides
+                       ncurses-devel = %{thisver}
+               end
+
+               obsoletes
+                       ncurses-devel <= %{thisver}
+               end
+       end
+
        package %{name}-debuginfo
                template DEBUGINFO
        end
diff --git a/compat-ncurses/patches/0001-Fix-errors-in-type-conversion.patch b/compat-ncurses/patches/0001-Fix-errors-in-type-conversion.patch
new file mode 100644 (file)
index 0000000..18ecf30
--- /dev/null
@@ -0,0 +1,153 @@
+From 6e12cb73e23e8e9488c6db1c4710bb4b3d2b48c3 Mon Sep 17 00:00:00 2001
+From: Adam Jiang <jiang.adam@gmail.com>
+Date: Fri, 1 Aug 2014 19:58:40 +0900
+Subject: [PATCH 1/2] Fix errors in type conversion
+
+Basically, converting to 'void*' is not a good idea. However, if that
+conversion is unavoidable, it should be done in a proper way. 'const_cast'
+itself could not convert type 'T*' to 'void *', this patch adds
+'reintepret_cast' to do it correctly.
+
+At the same time, function that returns on 'const' member like 'void*' should
+not be declared as 'const'.
+---
+ c++/cursesf.h | 12 +++++++-----
+ c++/cursesm.h | 10 +++++-----
+ c++/cursesp.h |  9 +++++----
+ 3 files changed, 17 insertions(+), 14 deletions(-)
+
+diff --git a/c++/cursesf.h b/c++/cursesf.h
+index 70a30c3..23b3022 100644
+--- a/c++/cursesf.h
++++ b/c++/cursesf.h
+@@ -673,7 +673,8 @@ protected:
+                  const T* p_UserData = STATIC_CAST(T*)(0))
+     : NCursesForm(nlines,ncols,begin_y,begin_x) {
+       if (form)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>
++                                   (p_UserData)));
+   }
+ public:
+@@ -683,7 +684,7 @@ public:
+                  bool autoDelete_Fields=FALSE)
+     : NCursesForm (Fields, with_frame, autoDelete_Fields) {
+       if (form)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   };
+   NCursesUserForm (NCursesFormField Fields[],
+@@ -697,19 +698,20 @@ public:
+     : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
+                  with_frame, autoDelete_Fields) {
+       if (form)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>
++                                   (p_UserData)));
+   };
+   virtual ~NCursesUserForm() {
+   };
+-  inline T* UserData (void) const {
++  inline T* UserData (void) {
+     return reinterpret_cast<T*>(get_user ());
+   };
+   inline virtual void setUserData (const T* p_UserData) {
+     if (form)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   }
+ };
+diff --git a/c++/cursesm.h b/c++/cursesm.h
+index d9c2273..545ed49 100644
+--- a/c++/cursesm.h
++++ b/c++/cursesm.h
+@@ -631,7 +631,7 @@ protected:
+                  const T* p_UserData = STATIC_CAST(T*)(0))
+     : NCursesMenu(nlines,ncols,begin_y,begin_x) {
+       if (menu)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   }
+ public:
+@@ -641,7 +641,7 @@ public:
+                  bool autoDelete_Items=FALSE)
+     : NCursesMenu (Items, with_frame, autoDelete_Items) {
+       if (menu)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   };
+   NCursesUserMenu (NCursesMenuItem Items[],
+@@ -653,19 +653,19 @@ public:
+                  bool with_frame=FALSE)
+     : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
+       if (menu)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   };
+   virtual ~NCursesUserMenu() {
+   };
+-  inline T* UserData (void) const {
++  inline T* UserData (void) {
+     return reinterpret_cast<T*>(get_user ());
+   };
+   inline virtual void setUserData (const T* p_UserData) {
+     if (menu)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   }
+ };
+diff --git a/c++/cursesp.h b/c++/cursesp.h
+index 9b63d6d..661e4a9 100644
+--- a/c++/cursesp.h
++++ b/c++/cursesp.h
+@@ -236,7 +236,8 @@ public:
+     : NCursesPanel (nlines, ncols, begin_y, begin_x)
+   {
+       if (p)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>
++                                   (p_UserData)));
+   };
+   // This creates an user panel of the requested size with associated
+   // user data pointed to by p_UserData.
+@@ -244,14 +245,14 @@ public:
+   NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
+   {
+     if (p)
+-      set_user(const_cast<void *>(p_UserData));
++      set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   };
+   // This creates an user panel associated with the ::stdscr and user data
+   // pointed to by p_UserData.
+   virtual ~NCursesUserPanel() {};
+-  T* UserData (void) const
++  T* UserData (void)
+   {
+     return reinterpret_cast<T*>(get_user ());
+   };
+@@ -260,7 +261,7 @@ public:
+   virtual void setUserData (const T* p_UserData)
+   {
+     if (p)
+-      set_user (const_cast<void *>(p_UserData));
++      set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
+   }
+   // Associate the user panel with the user data pointed to by p_UserData.
+ };
+-- 
+1.8.5.2 (Apple Git-48)
+