pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

profanity: Add support for NetBSD curses(3)



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Mon Sep 11 23:58:32 2017 +0200
Changeset:	09eb78f37b3b6f198a5f1752fe40883378ea187b

Modified Files:
	profanity/Makefile
	profanity/TODO
	profanity/distinfo
	profanity/patches/patch-configure.ac
Added Files:
	profanity/patches/patch-src_common.c
	profanity/patches/patch-src_config.h.in
	profanity/patches/patch-src_config_theme.c
	profanity/patches/patch-src_ui_buffer.c
	profanity/patches/patch-src_ui_console.c
	profanity/patches/patch-src_ui_core.c
	profanity/patches/patch-src_ui_inputwin.c
	profanity/patches/patch-src_ui_statusbar.c
	profanity/patches/patch-src_ui_win__types.h
	profanity/patches/patch-src_ui_window.c
	profanity/patches/patch-src_ui_window.h

Log Message:
profanity: Add support for NetBSD curses(3)

- Add support for (at least) NetBSD's curses(3).
- Bump PKGREVISION
- Add a TODO about investigating possible non-monochromatic themes

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=09eb78f37b3b6f198a5f1752fe40883378ea187b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 profanity/Makefile                          |  4 +--
 profanity/TODO                              | 40 ++---------------------------
 profanity/distinfo                          | 13 +++++++++-
 profanity/patches/patch-configure.ac        | 25 +++++++++++++++---
 profanity/patches/patch-src_common.c        | 15 +++++++++++
 profanity/patches/patch-src_config.h.in     | 26 +++++++++++++++++++
 profanity/patches/patch-src_config_theme.c  | 19 ++++++++++++++
 profanity/patches/patch-src_ui_buffer.c     | 15 +++++++++++
 profanity/patches/patch-src_ui_console.c    | 15 +++++++++++
 profanity/patches/patch-src_ui_core.c       | 15 +++++++++++
 profanity/patches/patch-src_ui_inputwin.c   | 25 ++++++++++++++++++
 profanity/patches/patch-src_ui_statusbar.c  | 15 +++++++++++
 profanity/patches/patch-src_ui_win__types.h | 15 +++++++++++
 profanity/patches/patch-src_ui_window.c     | 15 +++++++++++
 profanity/patches/patch-src_ui_window.h     | 15 +++++++++++
 15 files changed, 228 insertions(+), 44 deletions(-)

diffs:
diff --git a/profanity/Makefile b/profanity/Makefile
index cda7c9b64e..afec656151 100644
--- a/profanity/Makefile
+++ b/profanity/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 DISTNAME=	profanity-0.5.1
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	chat
 MASTER_SITES=	http://www.profanity.im/
 
@@ -21,7 +21,6 @@ pre-configure:
 
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../devel/libuuid/buildlink3.mk"
-.include "../../devel/ncursesw/buildlink3.mk"
 .include "../../devel/readline/buildlink3.mk"
 BUILDLINK_API_DEPENDS.libmesode+=	libmesode>=0.9.1
 .include "../../wip/libmesode/buildlink3.mk"
@@ -30,4 +29,5 @@ BUILDLINK_API_DEPENDS.libmesode+=	libmesode>=0.9.1
 .include "../../lang/python/pyversion.mk"
 .include "../../www/curl/buildlink3.mk"
 .include "../../chat/libotr/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/profanity/TODO b/profanity/TODO
index ff8c50275e..b26f89f4f4 100644
--- a/profanity/TODO
+++ b/profanity/TODO
@@ -1,38 +1,2 @@
-Dumps core on NetBSD-8.99.2/amd64 during startup.
-
-Relevant part of backtrace from a NetBSD-8.99.1/amd64 system built with
-MKDEBUG:
-
- [...]
- Core was generated by `profanity'.
- Program terminated with signal SIGSEGV, Segmentation fault.
- #0  ti_getnum (term=<optimized out>, id=0x7c431b2553c7 "U8") at /usr/src/lib/libterminfo/ti.c:87
- 87                      if (ud->type == 'n' && strcmp(ud->id, id) == 0) {
- (gdb) bt
- #0  ti_getnum (term=<optimized out>, id=0x7c431b2553c7 "U8") at /usr/src/lib/libterminfo/ti.c:87
- #1  0x00007c431b23e22c in _nc_locale_breaks_acs () from /usr/pkg/lib/libncursesw.so.6
- #2  0x00007c431b227559 in _nc_setupscreen_sp () from /usr/pkg/lib/libncursesw.so.6
- #3  0x00007c431b2229f7 in newterm_sp () from /usr/pkg/lib/libncursesw.so.6
- #4  0x00007c431b21f185 in initscr () from /usr/pkg/lib/libncursesw.so.6
- #5  0x00000000004332b5 in ui_init ()
- #6  0x000000000041c7d9 in prof_run ()
- #7  0x000000000046a7c9 in main ()
- (gdb) f 0
- #0  ti_getnum (term=<optimized out>, id=0x7c431b2553c7 "U8") at /usr/src/lib/libterminfo/ti.c:87
- 87                      if (ud->type == 'n' && strcmp(ud->id, id) == 0) {
- (gdb) list
- 82                              return ABSENT_NUMERIC;
- 83                      return term->nums[ind];
- 84              }
- 85              for (i = 0; i < term->_nuserdefs; i++) {
- 86                      ud = &term->_userdefs[i];
- 87                      if (ud->type == 'n' && strcmp(ud->id, id) == 0) {
- 88                              if (!VALID_NUMERIC(ud->num))
- 89                                  return ABSENT_NUMERIC;
- 90                              return ud->num;
- 91                      }
- (gdb) p ud
- $1 = (TERMUSERDEF *) 0x1
- [...]
-
-    -- wiz and leot 20170911
+- Review curses(3) patches
+- Check if also non-monochromatic themes work
diff --git a/profanity/distinfo b/profanity/distinfo
index bd34295250..4852fa64ba 100644
--- a/profanity/distinfo
+++ b/profanity/distinfo
@@ -4,4 +4,15 @@ SHA1 (profanity-0.5.1.tar.gz) = b53cac6ae205eae09537d0d855ee92aca9541221
 RMD160 (profanity-0.5.1.tar.gz) = 5ce5f5cb21ceb78ed55d4ca30e285aa9e2cc34ad
 SHA512 (profanity-0.5.1.tar.gz) = fcafa7e1dcf0948d7fa30ba33665e1ec0e8bb9e0246df2d1cf3fe5d7f2bd25b07fa2cb0fd383ee23fc720850ff295159537567f175c21f1c93f50da0099e209d
 Size (profanity-0.5.1.tar.gz) = 691508 bytes
-SHA1 (patch-configure.ac) = b9d7dba8d676184e2834b7b9bacddf28b1899157
+SHA1 (patch-configure.ac) = f16f95aa1bc4ef9eee36d5e89a2ffc707371a4cb
+SHA1 (patch-src_common.c) = 1df8ee42b0548c0a0f01e19361ddb6321deca0c9
+SHA1 (patch-src_config.h.in) = a6597f343bbb06128ce97849f02a6f6f2b57d25e
+SHA1 (patch-src_config_theme.c) = f85b6d1950c3601970642ecc9bf641d9ccf61025
+SHA1 (patch-src_ui_buffer.c) = 00b5296abdd8db3f42cf9fa1f7844118843805bd
+SHA1 (patch-src_ui_console.c) = eb0f3da92040e26f118afd0a174b3504a0b1fb75
+SHA1 (patch-src_ui_core.c) = 3b4ed47456650f9378cdb355c045a728bc32e4c0
+SHA1 (patch-src_ui_inputwin.c) = 0db3e6ad0fb8f4f3749052d94e15e1651a41a085
+SHA1 (patch-src_ui_statusbar.c) = 69138eae73758d8c70eda3d7fc6b575bb091ef9f
+SHA1 (patch-src_ui_win__types.h) = ad130a3acd1fcf74526958a511e90e354acb3d0e
+SHA1 (patch-src_ui_window.c) = f221ed015ed53aee2d01ac179730cd87822cb84f
+SHA1 (patch-src_ui_window.h) = ae95e732f4bef7628de8423bfb8c6468ad3aba33
diff --git a/profanity/patches/patch-configure.ac b/profanity/patches/patch-configure.ac
index 3bf0f5b42f..37c696d425 100644
--- a/profanity/patches/patch-configure.ac
+++ b/profanity/patches/patch-configure.ac
@@ -1,9 +1,10 @@
 $NetBSD$
 
 chunk 1: test(1) operator portability
-chunk 2: simplify check for readline
+chunk 2: Add support for curses(3)
+chunk 3: simplify check for readline
 
---- configure.ac.orig	2016-09-14 20:52:04.000000000 +0000
+--- configure.ac.orig	2017-01-28 21:10:55.000000000 +0000
 +++ configure.ac
 @@ -78,7 +78,7 @@ elif test "x$enable_python_plugins" != x
          rm -f Python.framework
@@ -14,7 +15,17 @@ chunk 2: simplify check for readline
          AX_PYTHON_DEVEL
          AM_CONDITIONAL([BUILD_PYTHON_API], [true])
          AC_DEFINE([HAVE_PYTHON], [1], [Python support])
-@@ -172,15 +172,8 @@ AS_IF([test "x$enable_icons" != xno],
+@@ -135,7 +135,8 @@ PKG_CHECK_MODULES([ncursesw], [ncursesw]
+         [NCURSES_CFLAGS="$ncurses_CFLAGS"; NCURSES_LIBS="$ncurses_LIBS"; NCURSES="ncurses"],
+         [AC_CHECK_LIB([ncursesw], [main], [],
+             [AC_CHECK_LIB([ncurses], [main], [],
+-            	[AC_MSG_ERROR([ncurses is required for profanity])])])])])
++	        [AC_CHECK_LIB([curses], [main], [],
++            	    [AC_MSG_ERROR([ncurses is required for profanity])])])])])])
+ AM_CPPFLAGS="$AM_CPPFLAGS $NCURSES_CFLAGS"
+ LIBS="$NCURSES_LIBS $LIBS"
+ 
+@@ -172,15 +173,8 @@ AS_IF([test "x$enable_icons" != xno],
              [AC_MSG_ERROR([gtk+-2.0 or higher is required for icons])],
              [AC_MSG_NOTICE([gtk+-2.0 not found, icons not enabled])])])])
  
@@ -32,3 +43,11 @@ chunk 2: simplify check for readline
  
  ### Check for desktop notification support
  ### Linux/FreeBSD require libnotify
+@@ -280,6 +274,7 @@ AC_CHECK_LIB([expect], [main], [AM_CONDI
+ ### Check for ncursesw/ncurses.h first, Arch linux uses ncurses.h for ncursesw
+ AC_CHECK_HEADERS([ncursesw/ncurses.h], [], [])
+ AC_CHECK_HEADERS([ncurses.h], [], [])
++AC_CHECK_HEADERS([curses.h], [], [])
+ 
+ ### Default parameters
+ AM_CFLAGS="-Wall -Wno-deprecated-declarations"
diff --git a/profanity/patches/patch-src_common.c b/profanity/patches/patch-src_common.c
new file mode 100644
index 0000000000..a744f0d94d
--- /dev/null
+++ b/profanity/patches/patch-src_common.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/common.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/common.c
+@@ -51,6 +51,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "log.h"
diff --git a/profanity/patches/patch-src_config.h.in b/profanity/patches/patch-src_config.h.in
new file mode 100644
index 0000000000..3559782bf5
--- /dev/null
+++ b/profanity/patches/patch-src_config.h.in
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/config.h.in.orig	2017-01-28 21:11:20.000000000 +0000
++++ src/config.h.in
+@@ -6,6 +6,9 @@
+ /* C support */
+ #undef HAVE_C
+ 
++/* Define to 1 if you have the <curses.h> header file. */
++#undef HAVE_CURSES_H
++
+ /* Define to 1 if you have the <dlfcn.h> header file. */
+ #undef HAVE_DLFCN_H
+ 
+@@ -21,6 +24,9 @@
+ /* Define to 1 if you have the `curl' library (-lcurl). */
+ #undef HAVE_LIBCURL
+ 
++/* Define to 1 if you have the `curses' library (-lcurses). */
++#undef HAVE_LIBCURSES
++
+ /* Have libgpgme */
+ #undef HAVE_LIBGPGME
+ 
diff --git a/profanity/patches/patch-src_config_theme.c b/profanity/patches/patch-src_config_theme.c
new file mode 100644
index 0000000000..267016de8c
--- /dev/null
+++ b/profanity/patches/patch-src_config_theme.c
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/config/theme.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/config/theme.c
+@@ -43,6 +43,12 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
++#endif
++
++#ifndef NCURSES_COLOR_T
++#define NCURSES_COLOR_T short
+ #endif
+ 
+ #include "common.h"
diff --git a/profanity/patches/patch-src_ui_buffer.c b/profanity/patches/patch-src_ui_buffer.c
new file mode 100644
index 0000000000..01a2d6b23c
--- /dev/null
+++ b/profanity/patches/patch-src_ui_buffer.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/buffer.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/buffer.c
+@@ -44,6 +44,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "ui/window.h"
diff --git a/profanity/patches/patch-src_ui_console.c b/profanity/patches/patch-src_ui_console.c
new file mode 100644
index 0000000000..659f58d725
--- /dev/null
+++ b/profanity/patches/patch-src_ui_console.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/console.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/console.c
+@@ -41,6 +41,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "common.h"
diff --git a/profanity/patches/patch-src_ui_core.c b/profanity/patches/patch-src_ui_core.c
new file mode 100644
index 0000000000..7212c4a1f8
--- /dev/null
+++ b/profanity/patches/patch-src_ui_core.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/core.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/core.c
+@@ -54,6 +54,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "log.h"
diff --git a/profanity/patches/patch-src_ui_inputwin.c b/profanity/patches/patch-src_ui_inputwin.c
new file mode 100644
index 0000000000..73135ff99d
--- /dev/null
+++ b/profanity/patches/patch-src_ui_inputwin.c
@@ -0,0 +1,25 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/inputwin.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/inputwin.c
+@@ -51,6 +51,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "profanity.h"
+@@ -282,7 +284,8 @@ _inp_win_update_virtual(void)
+ {
+     int wrows, wcols;
+     getmaxyx(stdscr, wrows, wcols);
+-    pnoutrefresh(inp_win, 0, pad_start, wrows-1, 0, wrows-1, wcols-2);
++    if (inp_win != NULL)
++	    pnoutrefresh(inp_win, 0, pad_start, wrows-1, 0, wrows-1, wcols-2);
+ }
+ 
+ static void
diff --git a/profanity/patches/patch-src_ui_statusbar.c b/profanity/patches/patch-src_ui_statusbar.c
new file mode 100644
index 0000000000..bb1b8418d8
--- /dev/null
+++ b/profanity/patches/patch-src_ui_statusbar.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/statusbar.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/statusbar.c
+@@ -42,6 +42,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "config/theme.h"
diff --git a/profanity/patches/patch-src_ui_win__types.h b/profanity/patches/patch-src_ui_win__types.h
new file mode 100644
index 0000000000..4e334e6c3a
--- /dev/null
+++ b/profanity/patches/patch-src_ui_win__types.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/win_types.h.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/win_types.h
+@@ -44,6 +44,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "tools/autocomplete.h"
diff --git a/profanity/patches/patch-src_ui_window.c b/profanity/patches/patch-src_ui_window.c
new file mode 100644
index 0000000000..79337b6c1d
--- /dev/null
+++ b/profanity/patches/patch-src_ui_window.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/window.c.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/window.c
+@@ -46,6 +46,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "config/theme.h"
diff --git a/profanity/patches/patch-src_ui_window.h b/profanity/patches/patch-src_ui_window.h
new file mode 100644
index 0000000000..3a5ecccd74
--- /dev/null
+++ b/profanity/patches/patch-src_ui_window.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add support for curses(3).
+
+--- src/ui/window.h.orig	2017-01-28 21:10:04.000000000 +0000
++++ src/ui/window.h
+@@ -43,6 +43,8 @@
+ #include <ncursesw/ncurses.h>
+ #elif HAVE_NCURSES_H
+ #include <ncurses.h>
++#elif HAVE_CURSES_H
++#include <curses.h>
+ #endif
+ 
+ #include "ui/ui.h"


Home | Main Index | Thread Index | Old Index