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
This commit is contained in:
Leonardo Taccari 2017-09-11 23:58:32 +02:00
parent f37ceb1fc9
commit 09eb78f37b
15 changed files with 228 additions and 44 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"