Skip to content

Commit

Permalink
Introduce notcurses-based growlight #43 (#70)
Browse files Browse the repository at this point in the history
Coarse conversion to notcurses #70. We're still building both for now. notcurses version has some rough edges for sure.
  • Loading branch information
dankamongmen authored Dec 25, 2019
1 parent 114dfde commit f6aba78
Show file tree
Hide file tree
Showing 16 changed files with 6,957 additions and 153 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ configure.scan
depcomp
.deps/
doc/growlight.ent
growlight
growlight-curses
growlight-readline
growlight-test
growlight.8
growlight.xhtml
growlight-curses.8
growlight-curses.xhtml
growlight-readline.8
Expand Down
17 changes: 11 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LANG=C
LC_ALL=c

AM_CFLAGS=-std=gnu11 -Wall -O2 -W -Wshadow -Wextra -fvisibility=hidden \
AM_CFLAGS=-std=gnu11 -Wall -g -ggdb -W -Wshadow -Wextra -fvisibility=hidden \
-D_FORTIFY_SOURCE=2 \
$(PTHREAD_CFLAGS) $(OPENSSL_INCLUDES) $(ZFS_CFLAGS)
AM_LDFLAGS=-Wl,-O2,--no-undefined-version,--enable-new-dtags,--as-needed,--warn-common
Expand All @@ -10,8 +10,8 @@ AM_CC=$(PTHREAD_CC)
LIBS+=$(PTHREAD_LIBS) $(OPENSSL_LIBS) $(ZFS_LIBS)

# FIXME can we not define these with addsuffix or something
dist_man_MANS = growlight-readline.8 growlight-curses.8
dist_xhtml_XHTML = growlight-readline.xhtml growlight-curses.xhtml
dist_man_MANS = growlight-readline.8 growlight.8
dist_xhtml_XHTML = growlight-readline.xhtml growlight.xhtml

doc_DIR=doc
doc_DATA=
Expand All @@ -20,11 +20,12 @@ doc_DATA+=README.md
EXTRA_DIST=zfs

dist_doc_DATA=
dist_doc_DATA+=COPYING growlight-readline.xhtml growlight-curses.xhtml
dist_doc_DATA+=COPYING growlight-readline.xhtml growlight.xhtml

AM_CPPFLAGS=-D_GNU_SOURCE

bin_PROGRAMS=growlight-readline
bin_PROGRAMS+=growlight
bin_PROGRAMS+=growlight-curses
bin_PROGRAMS+=growlight-test

Expand All @@ -45,11 +46,15 @@ common_SOURCES=src/growlight.c src/growlight.h src/mbr.c src/mbr.h \

growlight_readline_SOURCES=$(common_SOURCES)
growlight_readline_SOURCES+=src/readline.c
growlight_readline_LDADD=@outcurses_LIBS@ @PANEL_LIBS@ @CURSES_LIBS@
growlight_readline_LDADD=@notcurses_LIBS@ @CURSES_LIBS@

growlight_SOURCES=$(common_SOURCES)
growlight_SOURCES+=src/notcurses.c src/notcurses.h src/notui-aggregate.h src/notui-aggregate.c
growlight_LDADD=@notcurses_LIBS@

growlight_curses_SOURCES=$(common_SOURCES)
growlight_curses_SOURCES+=src/ncurses.c src/ncurses.h src/ui-aggregate.h src/ui-aggregate.c
growlight_curses_LDADD=@outcurses_LIBS@ @PANEL_LIBS@ @CURSES_LIBS@
growlight_curses_LDADD=@notcurses_LIBS@ @PANEL_LIBS@ @CURSES_LIBS@

growlight_test_SOURCES=$(common_SOURCES)
growlight_test_SOURCES+=test/growlight.c
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://nick-black.com/dankwiki/index.php/Growlight

Dependencies:

- outcurses 0.0.7+
- notcurses 0.9.3+
- libudev 175+
- libblkid 2.20.1+
- libpci 3.1.9+
Expand Down Expand Up @@ -36,7 +36,6 @@ Build-only dependencies:
- pkg-config (tested with 0.29)
- cunit (tested with 2.1)
- autoconf-archive (tested with 2018+)
- liboutcurses 0.0.5+

Building from a git checkout:

Expand All @@ -49,8 +48,8 @@ Building from a tarball:

## Using it

Terse help is available from the `growlight-curses` and `growlight-readline`
man pages, or by pressing 'H' in curses mode, or type "help" in readline mode.
Terse help is available from the `growlight` and `growlight-readline` man
pages, or by pressing 'H' in fullscreeen mode, or type "help" in readline mode.

### User's guide

Expand All @@ -69,7 +68,7 @@ of an adapter from which all devices are removed while it's running).
The highest level of structure in growlight is the controller ("controller" and
"adapter" are used interchangeably in growlight). A virtual controller is also
defined, to collect various virtual devices (especially aggregates). In the
curses view, controllers are boxes labeled by their type, bus path, and
fullscreen view, controllers are boxes labeled by their type, bus path, and
bandwidth. Below, we see a machine with one SATA SSD, a dmcrypt device mapper
block built atop that, and an unloaded SD card reader hanging off USB 3.0:

Expand Down
10 changes: 5 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ PKG_PROG_PKG_CONFIG

if test "x$zfs" = "xtrue" ; then
PKG_CHECK_MODULES([ZFS], [libzfs], [AC_DEFINE([HAVE_ZFS], [1], [Use libzfs from ZoL])])
#CFLAGS+=" $ZFS_CFLAGS"
LFLAGS+=" $ZFS_LIBS"
ZFS_CFLAGS+=" $ZFS_CFLAGS"
ZFS_LFLAGS+=" $ZFS_LIBS"
fi

# FIXME what about the --without-ncurses/--without-ncursesw cases?
Expand Down Expand Up @@ -76,9 +76,9 @@ AC_CHECK_LIB(pci, pci_get_dev, [have_libpci=yes],
[AC_MSG_ERROR([Cannot find libpci.])])
LIBS+=" -lpci"

PKG_CHECK_MODULES([outcurses], [outcurses >= 0.0.7], [have_outcurses=yes])
CFLAGS+=" $outcurses_CFLAGS"
LIBS+= " -loutcurses"
PKG_CHECK_MODULES([notcurses], [notcurses >= 0.9.3])
notcurses_CFLAGS+=" $notcurses_CFLAGS"
notcurses_LIBS+=" $notcurses_LIBS"

PKG_CHECK_MODULES([libatasmart], [libatasmart >= 0.19], [AC_DEFINE([HAVE_ATASMART], [1], [Use libatasmart])])
CFLAGS+=" $libatasmart_CFLAGS"
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
growlight (2.0.0) UNRELEASED; urgency=medium

* Swap out GUI for notcurses, add dep on notcurses

-- Nick Black <dankamongmen@gmail.com> Thu, 12 Dec 2019 11:51:45 -0500

growlight (1.1.3.3-1) unstable; urgency=medium

* Reenable ZFS support; build-dep on libzfslinux-dev
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintainer: Nick Black <dankamongmen@gmail.com>
Build-Depends: debhelper (>= 12), libatasmart-dev, libblkid-dev,
libcryptsetup-dev, libpci-dev, libpciaccess-dev, libdevmapper-dev, libudev-dev,
autoconf-archive, libncurses-dev, libreadline-dev, libcunit1-ncurses-dev,
pkg-config, xsltproc, docbook-xsl, libssl-dev, liboutcurses-dev (>= 0.0.5),
pkg-config, xsltproc, docbook-xsl, libssl-dev, libnotcurses-dev (>= 0.9.0),
libzfslinux-dev (>= 0.8.0)
Standards-Version: 4.4.1.1
Homepage: https://nick-black.com/dankwiki/index.php/Growlight
Expand Down
9 changes: 5 additions & 4 deletions doc/man/man8/growlight-curses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<!ENTITY dhtitle "growlight reference">

<!-- This is the application/package name. -->
<!ENTITY dhucpackage "growlight-curses">
<!ENTITY dhpackage "growlight-curses">
<!ENTITY dhucpackage "growlight">
<!ENTITY dhpackage "growlight">

<!-- If the application e.g. belongs to a package like X.org, -->
<!-- this should be set to the package/suite name instead of -->
Expand Down Expand Up @@ -45,7 +45,7 @@
</author>
</authorgroup>
<copyright>
<year>2012-2019</year>
<year>2012-2020</year>
<holder>&dhusername;</holder>
</copyright>
</refentryinfo>
Expand Down Expand Up @@ -79,7 +79,8 @@
facilitates use of UUID/WWN- and HBA-based identification of block devices.</para>
<para>This page describes the fullscreen <emphasis role="bold">ncurses(3ncurses)</emphasis> implementation.
Consult <emphasis role="bold">growlight-readline(8)</emphasis> for a line-oriented <emphasis role="bold">readline(3)</emphasis>
variant.</para>
variant, or <emphasis role="bold">growlight(8)</emphasis> for the flagship
notcurses-based tool.</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
Expand Down
7 changes: 4 additions & 3 deletions doc/man/man8/growlight-readline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</author>
</authorgroup>
<copyright>
<year>2012-2019</year>
<year>2012-2020</year>
<holder>&dhusername;</holder>
</copyright>
</refentryinfo>
Expand Down Expand Up @@ -77,8 +77,9 @@
aware of variable sector sizes, GPT, and UEFI. <emphasis>&dhpackage;</emphasis>
facilitates use of UUID/WWN- and HBA-based identification of block devices.</para>
<para>This page describes the <emphasis role="bold">readline(3)</emphasis> implementation.
Consult <emphasis role="bold">growlight-curses(8)</emphasis> for an <emphasis role="bold">ncurses(3ncurses)</emphasis>
variant.</para>
Consult <emphasis role="bold">growlight(8)</emphasis> for a fullscreen
<emphasis role="bold">notcurses(3notcurses)</emphasis> variant, or <emphasis role="bold">growlight(8)</emphasis> for the flagship
notcurses-based tool.</para>
</refsect1>
<refsect1 id="options">
<title>OPTIONS</title>
Expand Down
Loading

0 comments on commit f6aba78

Please sign in to comment.