Hi, The below diff updates snownews to 1.8 with a new repo owner and finally a lot of modern features [0]! I tend to separate upstream vs ports changes, but it's unpractical here:
> Added Atom feed support Modify COMMENT and DESCR accordingly. While here, update to valid feeds and a mix of RSS and Atom. HTTPS is used where applicable. > Use curl for networking Add proper LIB_DEPENDS, remove README now that HTTPS is supported. There is a year 2038 printf() warning, but it would require to sprinkle CURLINFO_FILETIME_T instead of CURLINFO_FILETIME in many places first. Also, refresh WANTLIB, and remove the netio.c patch accordingly. > Use the OPML format to store the feed list, and XDG dirs Snownews-1.8 will migrate your urls file to the OPML format in ~/.config/snownews where you can find other settings (key bindings, colors etc.). The OPML conversion tools (snow2opml, opml2snow) have been removed, so we don't need p5-XML-LibXML as a RUN_DEPENDS. > Use UTF-8 everywhere (including manpages) The upstream configuration system couldn't find our ncurses library with wide chars support, so i needed to tweak CFLAGS and LDFLAGS. > Deal with lack of verbosity for the fake stage The most painful part of that update has been the fake stage, because upstream hides issued commands, so i preferred to unsilence them. All the rest is mostly updating old patches. Testing: It builds and works fine on amd64 and macppc. Note that feed items' text enclosed in '<content type="xhtml">' is not displayed (yet?). Comments and feedback are welcome, Charlène. [0] https://github.com/msharov/snownews/releases Index: Makefile =================================================================== RCS file: /cvs/ports/www/snownews/Makefile,v retrieving revision 1.41 diff -u -p -u -p -r1.41 Makefile --- Makefile 21 Nov 2020 22:03:13 -0000 1.41 +++ Makefile 5 Jul 2021 13:01:43 -0000 @@ -1,13 +1,11 @@ # $OpenBSD: Makefile,v 1.41 2020/11/21 22:03:13 kmos Exp $ -COMMENT= text mode rss newsreader +COMMENT= text mode rss and atom newsreader CATEGORIES= www -GH_ACCOUNT= kouya +GH_ACCOUNT= msharov GH_PROJECT= snownews -GH_TAGNAME= 1.6.10 - -HOMEPAGE= https://github.com/kouya/snownews +GH_TAGNAME= v1.8 # GPLv3 only PERMIT_PACKAGE= Yes @@ -15,21 +13,25 @@ PERMIT_PACKAGE= Yes # C11 COMPILER= base-clang ports-gcc -WANTLIB += c curses iconv intl xml2 z +WANTLIB += c crypto curl curses iconv intl xml2 NO_TEST= Yes USE_GMAKE= Yes BUILD_DEPENDS= devel/gettext,-tools -RUN_DEPENDS= textproc/p5-XML-LibXML LIB_DEPENDS= devel/gettext,-runtime \ + net/curl \ textproc/libxml CONFIGURE_STYLE= simple -CONFIGURE_ARGS= --prefix="\$${PREFIX}" \ - --mandir="\$${PREFIX}/man" \ - --builddir=${WRKDIR} -MAKE_ENV= COPTFLAGS="${CFLAGS}" +CONFIGURE_ARGS+= --builddir=${WRKDIR} --mandir=${PREFIX}/man +MAKE_ENV= cflags="${CFLAGS}" ldflags="${LDFLAGS}" + +# Needed for cchar_t, setcchar() and getcchar() +CFLAGS+= -D_XOPEN_SOURCE_EXTENDED +# Fix linking errors due to upstream build system +# not being able to find proper LDFLAGS for ncurses +LDFLAGS+= -lncursesw .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/www/snownews/distinfo,v retrieving revision 1.17 diff -u -p -u -p -r1.17 distinfo --- distinfo 20 Nov 2020 20:48:11 -0000 1.17 +++ distinfo 5 Jul 2021 13:01:43 -0000 @@ -1,2 +1,2 @@ -SHA256 (snownews-1.6.10.tar.gz) = jHgGeu914oPfSzzKHJZlh7ZlTp6Eo+bl64vdWCl5kkI= -SIZE (snownews-1.6.10.tar.gz) = 189715 +SHA256 (snownews-1.8.tar.gz) = kNJhGz46ALwUqIaTZdNmrR2rF+oWh4V0QBWfxxN8O+0= +SIZE (snownews-1.8.tar.gz) = 154813 Index: patches/patch-Config_mk_in =================================================================== RCS file: /cvs/ports/www/snownews/patches/patch-Config_mk_in,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-Config_mk_in --- patches/patch-Config_mk_in 20 Nov 2020 20:48:11 -0000 1.1 +++ patches/patch-Config_mk_in 5 Jul 2021 13:01:43 -0000 @@ -3,25 +3,25 @@ $OpenBSD: patch-Config_mk_in,v 1.1 2020/ Index: Config.mk.in --- Config.mk.in.orig +++ Config.mk.in -@@ -21,7 +21,7 @@ PREFIX := @prefix@ - BINDIR := @bindir@ - LOCALEPATH := @localedir@ - MANPATH := @mandir@ --BUILDDIR := @builddir@/${NAME} -+BUILDDIR := @builddir@/build - PKGDIR := @pkgdir@ +@@ -19,20 +19,13 @@ mandir := @mandir@ + man1dir := @man1dir@ + localedir := @localedir@ + TMPDIR := @TMPDIR@ +-builddir := @builddir@/${name} ++builddir := @builddir@/build O := .o/ -@@ -29,11 +29,5 @@ O := .o/ + ################ Compiler options #################################### - CFLAGS := -Wall -Wextra -Wredundant-decls -Wshadow \ - -std=c11 -I/usr/include/libxml2 - LDFLAGS := -liconv -lintl -lxml2 -lncurses -lz --ifdef DEBUG -- CFLAGS += -O0 -ggdb3 -- LDFLAGS += -g -rdynamic + #debug := 1 + libs := @pkg_libs@ -liconv -lintl +-ifdef debug +- cflags := -O0 -ggdb3 +- ldflags := -g -rdynamic -else -- CFLAGS += -Os -g0 -DNDEBUG=1 -- LDFLAGS += -s +- cflags := -Os -g0 -DNDEBUG=1 +- ldflags := -s -endif -+CFLAGS += ${COPTFLAGS} + CFLAGS := -Wall -Wextra -Wredundant-decls -Wshadow + cflags += -std=c11 @pkg_cflags@ ${CFLAGS} + ldflags += @pkg_ldflags@ ${LDFLAGS} Index: patches/patch-Makefile =================================================================== RCS file: /cvs/ports/www/snownews/patches/patch-Makefile,v retrieving revision 1.14 diff -u -p -u -p -r1.14 patch-Makefile --- patches/patch-Makefile 20 Nov 2020 20:48:11 -0000 1.14 +++ patches/patch-Makefile 5 Jul 2021 13:01:43 -0000 @@ -1,28 +1,41 @@ $OpenBSD: patch-Makefile,v 1.14 2020/11/20 20:48:11 sthen Exp $ +Don't hide compilation/installation invocations + Index: Makefile --- Makefile.orig +++ Makefile -@@ -19,19 +19,16 @@ run: ${EXE} - @${EXE} +@@ -20,16 +20,13 @@ run: ${exe} + @${exe} - ${EXE}: ${OBJS} + ${exe}: ${objs} - @echo "Linking $@ ..." -- @${CC} -o $@ $^ ${LDFLAGS} -+ ${CC} -o $@ $^ ${LDFLAGS} - - ${EXE}-static: ${SRCS} - ${CC} -s -static -o $@ ${CFLAGS} ${SRCS} ${LDFLAGS} +- @${CC} ${ldflags} -o $@ $^ ${libs} ++ ${CC} ${ldflags} -o $@ $^ ${libs} $O%.o: %.c - @echo " Compiling $< ..." -- @${CC} ${CFLAGS} -MMD -MT "$(<:.c=.s) $@" -o $@ -c $< -+ ${CC} ${CFLAGS} -MMD -MT "$(<:.c=.s) $@" -o $@ -c $< +- @${CC} ${cflags} -MMD -MT "$(<:.c=.s) $@" -o $@ -c $< ++ ${CC} ${cflags} -MMD -MT "$(<:.c=.s) $@" -o $@ -c $< %.s: %.c - @echo " Compiling $< to assembly ..." -- @${CC} ${CFLAGS} -S -o $@ -c $< -+ ${CC} ${CFLAGS} -S -o $@ -c $< +- @${CC} ${cflags} -S -o $@ -c $< ++ ${CC} ${cflags} -S -o $@ -c $< include man/Module.mk include po/Module.mk +@@ -43,11 +40,9 @@ exed := ${DESTDIR}${bindir} + exei := ${exed}/$(notdir ${exe}) + + ${exed}: +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + ${exei}: ${exe} | ${exed} +- @echo "Installing $@ ..." +- @${INSTALL_PROGRAM} $< $@ ++ ${INSTALL_PROGRAM} $< $@ + + installdirs: ${exed} + install: ${exei} Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/www/snownews/patches/patch-configure,v retrieving revision 1.4 diff -u -p -u -p -r1.4 patch-configure --- patches/patch-configure 20 Nov 2020 20:48:11 -0000 1.4 +++ patches/patch-configure 5 Jul 2021 13:01:43 -0000 @@ -1,46 +1,51 @@ $OpenBSD: patch-configure,v 1.4 2020/11/20 20:48:11 sthen Exp $ +Hunk #0: report proper version +Hunk #1: ncurses can't be found using pkg-config(1) +Hunk #2: make our sed(1) happy + Index: configure --- configure.orig +++ configure -@@ -36,9 +36,9 @@ seds=[s/^#undef \(USE_UNSUPPORTED_AND_BROKEN_CODE\)/#d - PROGS="CC=gcc CC=clang INSTALL=install MSGFMT=msgfmt" +@@ -4,7 +4,7 @@ + ###################################################################### + + pkg_name="snownews" +-pkg_verstr="v1.7" ++pkg_verstr="v1.8" + pkg_bugreport="Mike Sharov <msha...@users.sourceforge.net>" + + # Files that get created by this script +@@ -34,7 +34,7 @@ seds=[s/^#undef \(USE_UNSUPPORTED_AND_BROKEN_CODE\)/#d + progs="CC=gcc CC=clang CC=cc INSTALL=install MSGFMT=msgfmt" # Libs found using pkg-config --LIBS="libxml-2.0 ncurses zlib" -+LIBS="libxml-2.0" - # Defaults to substitute with pkg-config --libs output --DEFLIBS="-lxml2 -lncursesw -lz" -+DEFLIBS="-lxml2" - # Defaults to substitute with pkg-config --cflags output - DEFINCS="-I\/usr\/include\/libxml2" +-pkgs="libcurl libxml-2.0 libcrypto ncursesw" ++pkgs="libcurl libxml-2.0 libcrypto" + # Default pkg flags to substitute when pkg-config is not found + pkg_libs="-lcurl -lxml2 -lcrypto -lncursesw" + pkg_cflags="-I\/usr\/include\/libxml2" +@@ -154,15 +154,15 @@ done -@@ -156,21 +156,21 @@ done #### Set directory prefixes ########################################## - sub "s/@prefix@/${ac_var_prefix:=\/usr\/local}/g --s/@bindir@/${ac_var_bindir:=$ac_var_prefix\/bin}/g --s/@mandir@/${ac_var_mandir:=$ac_var_prefix\/share\/man}/g --s/@localedir@/${ac_var_localedir:=$ac_var_prefix\/share\/locale}/g --s/@builddir@/\/tmp\/$USER\/make/g -+s/@bindir@/${ac_var_bindir:=$ac_var_prefix\\/bin}/g -+s/@mandir@/${ac_var_mandir:=$ac_var_prefix\\/share\\/man}/g -+s/@localedir@/${ac_var_localedir:=$ac_var_prefix\\/share\\/locale}/g -+s/@builddir@/\\/tmp\\/$USER\\/make/g - s/@pkgdir@//g" - - # Replace prefix variables, where available - if [ "$ac_var_bindir" = "$ac_var_prefix\/bin" ]; then -- sub "s/$ac_var_bindir/\${PREFIX}\/bin/"; -+ sub "s/$ac_var_bindir/\${PREFIX}\\/bin/"; - fi - if [ "$ac_var_mandir" = "$ac_var_prefix\/share\/man" ]; then -- sub "s/$ac_var_mandir/\${PREFIX}\/share\/man/"; -+ sub "s/$ac_var_mandir/\${PREFIX}\\/share\\/man/"; - fi - if [ "$ac_var_localedir" = "$ac_var_prefix\/share\/locale" ]; then -- sub "s/ $ac_var_localedir/ \${PREFIX}\/share\/locale/"; -+ sub "s/ $ac_var_localedir/ \${PREFIX}\\/share\\/locale/"; - fi +-sub "s/@prefix@/${ac_var_prefix:=\/usr\/local}/g +-s/@bindir@/${ac_var_bindir:=\$\{prefix\}\/bin}/g +-s/@datadir@/${ac_var_datadir:=\$\{prefix\}\/share}/g +-s/@mandir@/${ac_var_mandir:=\$\{datadir\}\/man}/g +-s/@man1dir@/${ac_var_man1dir:=\$\{mandir\}\/man1}/g +-s/@localedir@/${ac_var_localedir:=\$\{datadir\}\/locale}/g +-s/@localepath@/${ac_var_prefix}\/share\/locale/g ++sub "s/@prefix@/${ac_var_prefix:=\\/usr\\/local}/g ++s/@bindir@/${ac_var_bindir:=\$\{prefix\}\\/bin}/g ++s/@datadir@/${ac_var_datadir:=\$\{prefix\}\\/share}/g ++s/@mandir@/${ac_var_mandir:=\$\{datadir\}\\/man}/g ++s/@man1dir@/${ac_var_man1dir:=\$\{mandir\}\\/man1}/g ++s/@localedir@/${ac_var_localedir:=\$\{datadir\}\\/locale}/g ++s/@localepath@/${ac_var_prefix}\\/share\\/locale/g + s/@TMPDIR@/$(escpath ${TMPDIR:-/tmp})/g +-s/@builddir@/\$\{TMPDIR\}\/make/g" ++s/@builddir@/\$\\{TMPDIR\}\\/make/g" #### Find programs and libs ########################################## + Index: patches/patch-man_Module_mk =================================================================== RCS file: patches/patch-man_Module_mk diff -N patches/patch-man_Module_mk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-man_Module_mk 5 Jul 2021 13:01:43 -0000 @@ -0,0 +1,36 @@ +$OpenBSD$ + +Making the fake step easier to debug + +Index: man/Module.mk +--- man/Module.mk.orig ++++ man/Module.mk +@@ -15,23 +15,18 @@ man/emani := $(subst man/,${man1d}/,${man/mans}) + man/lmani := $(foreach l,${man/langs},${mand}/${l}/man1/snownews.1) + + ${mand}: +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + ${man1d}: | ${mand} +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + ${lmand}: | ${mand} +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + man/mani := ${man/emani} + ${man/emani}: ${man1d}/%: man/% | ${man1d} +- @echo "Installing $@ ..." +- @${INSTALL_DATA} $< $@ ++ ${INSTALL_DATA} $< $@ + ifdef localedir + man/mani += ${man/lmani} + ${man/lmani}: ${mand}/%/man1/snownews.1: man/snownews.%.1 | ${lmand} +- @echo "Installing $@ ..." +- @${INSTALL_DATA} $< $@ ++ ${INSTALL_DATA} $< $@ + endif + + installdirs: ${mand} ${man1d} Index: patches/patch-netio_c =================================================================== RCS file: patches/patch-netio_c diff -N patches/patch-netio_c --- patches/patch-netio_c 20 Nov 2020 20:48:11 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ -$OpenBSD: patch-netio_c,v 1.3 2020/11/20 20:48:11 sthen Exp $ - -Index: netio.c ---- netio.c.orig -+++ netio.c -@@ -30,6 +30,7 @@ - #include <errno.h> - #include <netdb.h> - #include <netinet/in.h> -+#include <sys/select.h> - #include <sys/socket.h> - #include <syslog.h> - #include <unistd.h> Index: patches/patch-po_Module_mk =================================================================== RCS file: patches/patch-po_Module_mk diff -N patches/patch-po_Module_mk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-po_Module_mk 5 Jul 2021 13:01:43 -0000 @@ -0,0 +1,35 @@ +$OpenBSD$ + +Making the fake step easier to debug + +Index: po/Module.mk +--- po/Module.mk.orig ++++ po/Module.mk +@@ -17,14 +17,11 @@ polds := $(foreach l,${locales},${pod}/${l}/LC_MESSAG + po/objsi := $(foreach l,${polds},${l}/${name}.mo) + + ${pod}: +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + ${polds}: | ${pod} +- @echo "Creating $@ ..." +- @${INSTALL} -d $@ ++ ${INSTALL} -d $@ + ${po/objsi}: ${pod}/%/LC_MESSAGES/${name}.mo: $Opo/%.mo | ${polds} +- @echo "Installing $@ ..." +- @${INSTALL_DATA} $< $@ ++ ${INSTALL_DATA} $< $@ + + installdirs: ${polds} + install: po/install +@@ -38,8 +35,7 @@ po/uninstall: + fi + + $O%.mo: %.po +- @echo " Compiling $< ..." +- @${MSGFMT} -o $@ $< ++ ${MSGFMT} -o $@ $< + endif + + ################ Maintenance ########################################### Index: pkg/DESCR =================================================================== RCS file: /cvs/ports/www/snownews/pkg/DESCR,v retrieving revision 1.4 diff -u -p -u -p -r1.4 DESCR --- pkg/DESCR 20 Feb 2006 16:33:55 -0000 1.4 +++ pkg/DESCR 5 Jul 2021 13:01:43 -0000 @@ -1,11 +1,10 @@ -Snownews is a text mode RSS newsreader. It supports RSS 1.0 feeds that -comply with the W3C RDF specification and also supports Radio Userland's -RSS 0.91 and 2.0 versions. +Snownews is a text mode RSS and Atom newsreader. It supports RSS 1.0 and 2.0 +feeds that comply with the W3C specifications, Radio Userland's RSS 0.91 and +Atom feeds. Here are some feeds to get you started: -Freshmeat - http://freshmeat.net/backend/fm.rdf -OpenBSD Journal - http://undeadly.org/cgi?action=rss -The Register - http://www.theregister.co.uk/excerpts.rss -Slashdot - http://slashdot.org/slashdot.rdf -Snownews - http://home.kcore.de/~kiza/software/snownews/snowlog.rdf +OpenBSD Journal - https://undeadly.org/cgi?action=rss +r/OpenBSD - https://www.reddit.com/r/openbsd.rss +The Register - https://www.theregister.com/off_prem/channel/headlines.atom +Slashdot - http://rss.slashdot.org/Slashdot/slashdotMainatom Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/www/snownews/pkg/PLIST,v retrieving revision 1.13 diff -u -p -u -p -r1.13 PLIST --- pkg/PLIST 20 Nov 2020 20:48:12 -0000 1.13 +++ pkg/PLIST 5 Jul 2021 13:01:43 -0000 @@ -1,6 +1,4 @@ @comment $OpenBSD: PLIST,v 1.13 2020/11/20 20:48:12 sthen Exp $ -bin/opml2snow -bin/snow2opml @bin bin/snownews man/de/ man/de/man1/ @@ -11,15 +9,13 @@ man/fr/man1/ man/it/ man/it/man1/ @man man/it/man1/snownews.1 -@man man/man1/opml2snow.1 @man man/man1/snownews.1 man/nl/ man/nl/man1/ @man man/nl/man1/snownews.1 -man/ru.KOI8-R/ -man/ru.KOI8-R/man1/ -@man man/ru.KOI8-R/man1/snownews.1 -share/doc/pkg-readmes/${PKGSTEM} +man/ru/ +man/ru/man1/ +@man man/ru/man1/snownews.1 share/locale/be@latin/ share/locale/be@latin/LC_MESSAGES/ share/locale/be@latin/LC_MESSAGES/snownews.mo Index: pkg/README =================================================================== RCS file: pkg/README diff -N pkg/README --- pkg/README 20 Nov 2020 20:48:12 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: README,v 1.1 2020/11/20 20:48:12 sthen Exp $ - -+------------------------------------------------------------------------------- -| Running ${PKGSTEM} on OpenBSD -+------------------------------------------------------------------------------- - -Snownews does not natively support https. - -To fetch feeds that require https you can use an external process to fetch -by entering something like this in the URL box: - - exec:ftp -Vo- <FEED URL>