aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-08-28 14:03:38 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-09 18:17:03 +0200
commitf79a6f65acde9753ea65887e0e0d4bc7f76ff52b (patch)
tree6c7b266871110fd56e5738555b906f5f8b609acc
parent4c6b6814abfc9c022c6ea8d1e23097c2a774fde5 (diff)
downloadsciteco-f79a6f65acde9753ea65887e0e0d4bc7f76ff52b.tar.gz
prefer libncursesw (widechar variant) (refs #5)
* Some platforms like Ubuntu actually ship widechar and non-widechar versions of ncurses with different pkg-config files. Other platforms like FreeBSD will ship an "ncursesw" and "ncurses" pkg-config file but both point to the same wide-char library anyway. * Currently we are not using wide-char APIs to ensure maximum compatibility even with embedded systems where ncurses might be built without widechar support. But in order to handle Unicode correctly, we still need to link against the widechar version of ncurses (if available). * Compilation on platforms without a widechar ncurses is now handled by the common AC_CHECK_LIB() fallback (which might actually find a widechar version anyway if it just didn't install the pkg-config file). If necessary, we could also check for the "ncurses" package if "ncursesw" is not found. * This fixes Unicode display and input on Ubuntu.
-rw-r--r--TODO4
-rw-r--r--configure.ac7
-rw-r--r--debian/control2
3 files changed, 9 insertions, 4 deletions
diff --git a/TODO b/TODO
index 4babbf9..c42d39b 100644
--- a/TODO
+++ b/TODO
@@ -313,7 +313,6 @@ Features:
be a special TAB-completion (^G mode?) that completes only buffers
in the ring. It should also display the numeric buffer ids.
* properly support Unicode encodings and the character-based model
- * link against libncursesw if possible
* translate documents to Unicode strings
* a position refers to a character/codepoint
* Progress indication in commandline cursor:
@@ -526,4 +525,5 @@ Documentation:
* Write some tutorials for the Wiki, e.g. about paragraph
reflowing...
Object-oriented SciTECO ideoms etc. ;-)
- * Record a "video" on https://asciinema.org/
+ * What to do with `--xembed`: tabbed, st
+ when used as the git editor, etc.
diff --git a/configure.ac b/configure.ac
index 511d169..3606803 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,11 +226,16 @@ case $INTERFACE in
*curses*)
case $INTERFACE in
ncurses | netbsd-curses)
- PKG_CHECK_MODULES(NCURSES, [ncurses], [
+ # The widechar version of ncurses is necessary for Unicode
+ # support even when not using widechar APIs.
+ PKG_CHECK_MODULES(NCURSES, [ncursesw], [
CFLAGS="$CFLAGS $NCURSES_CFLAGS"
CXXFLAGS="$CXXFLAGS $NCURSES_CFLAGS"
LIBS="$LIBS $NCURSES_LIBS"
], [
+ # This should be sufficient to detect non-widechar
+ # ncurses versions as well, although we could also check
+ # for an "ncurses" package.
AC_CHECK_LIB(ncurses, initscr, , [
AC_MSG_ERROR([libncurses missing!])
])
diff --git a/debian/control b/debian/control
index 10862ca..a5aeca0 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: editors
Priority: optional
Maintainer: Robin Haberkorn <robin.haberkorn@googlemail.com>
Build-Depends: debhelper (>= 10), dh-exec, g++ (>= 4:5.0), libglib2.0-dev (>= 2.44),
- ncurses-term, libncurses5-dev,
+ ncurses-term, libncurses-dev,
libgtk-3-dev (>= 3.12), xvfb,
groff-base
Standards-Version: 4.5.0