Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
textproc/txt2tags, update to simplified py3 version?
To:
Matthias Kilian <kili@outback.escape.de>
Cc:
ports <ports@openbsd.org>
Date:
Wed, 16 Jul 2025 15:02:24 +0100

Download raw body.

Thread
There's a Python 3 version of txt2tags, branched from 2.6. Some features
are lost (as is the manpage), I wonder if it would be worth switching to
get away from py2 though?

 "Removed features (GUI, macros, i18n, translations,
 ASCII Art/PageMaker/XHTML targets) and only supports
 UTF-8 files, to achieve easier maintenance (see changelog)."

(if not, the @sample change fixes a ports bug).


Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/txt2tags/Makefile,v
diff -u -p -r1.27 Makefile
--- Makefile	27 Sep 2023 18:09:06 -0000	1.27
+++ Makefile	16 Jul 2025 13:57:37 -0000
@@ -1,64 +1,42 @@
 COMMENT=	utility to turn simply formatted text into markup

-DISTNAME=	txt2tags-2.6
-REVISION=	2
+MODPY_DISTV=	3.9
+GH_ACCOUNT=	txt2tags
+GH_PROJECT=	txt2tags
+GH_TAGNAME=	${MODPY_DISTV}
 CATEGORIES=	textproc

-HOMEPAGE=	http://txt2tags.org/
+HOMEPAGE=	https://txt2tags.org/

 MAINTAINER=	Matthias Kilian <kili@openbsd.org>

 # GPLv2
 PERMIT_PACKAGE=	Yes

-SITES=		${SITE_GOOGLECODE:=txt2tags/}
-EXTRACT_SUFX=	.tgz
-
 MODULES=	lang/python
-MODPY_VERSION =	${MODPY_DEFAULT_VERSION_2}
-
-BUILD_DEPENDS=	devel/gettext,-tools
-
-PKG_ARCH=	*
+MODPY_PYBUILD=	setuptools

 DOCDIR=		${PREFIX}/share/doc/txt2tags
 EXAMPLESDIR=	${PREFIX}/share/examples/txt2tags
-LOCALEDIR=	${PREFIX}/share/locale
-
-MODPY_ADJ_FILES={txt2tags,extras/gensite,test/run.py} \
-		samples/module/module-{body,full}.py

-pre-configure:
-	${MODPYTHON_pre-configure}
-	sed -i "s,/usr/share/locale/,${LOCALBASE}/share/locale," \
-		${WRKSRC}/txt2tags
-
-do-build:
-	cd ${WRKSRC}/po && for l in $$(ls *.po | sed 's@\.po$$@@'); do \
-		msgfmt -o $$l.mo $$l.po; \
-	done
+post-build:
+.for i in markup userguide
+	cd ${WRKSRC}/docs/$i && ${MODPY_BIN} ../../build/lib/txt2tags.py $i.t2t
+.endfor

-do-install:
+post-install:
 	${INSTALL_DATA_DIR} ${DOCDIR} ${EXAMPLESDIR}{,/img,/css,/module}
-	${INSTALL_SCRIPT} ${WRKSRC}/txt2tags ${PREFIX}/bin
-	${INSTALL_SCRIPT} ${WRKSRC}/extras/gensite ${PREFIX}/bin
 	${INSTALL_DATA} ${WRKSRC}/extras/txt2tagsrc \
 		${EXAMPLESDIR}/txt2tagsrc.dist
-	${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCDIR}
-	${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/docs/*/*.html ${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/*.md ${DOCDIR}
 	${INSTALL_DATA} ${WRKSRC}/samples/*.* ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/samples/img/* ${EXAMPLESDIR}/img
 	${INSTALL_DATA} ${WRKSRC}/samples/css/* ${EXAMPLESDIR}/css
 	${INSTALL_DATA} ${WRKSRC}/samples/module/* ${EXAMPLESDIR}/module
-	${INSTALL_MAN} ${WRKSRC}/doc/manpage.man ${PREFIX}/man/man1/txt2tags.1
-	cd ${WRKSRC}/po && for l in $$(ls *.mo | sed 's@\.mo$$@@'); do \
-		d=${LOCALEDIR}/$$l/LC_MESSAGES && \
-		${INSTALL_DATA_DIR} $$d && \
-		${INSTALL_DATA} $$l.mo $$d/txt2tags.mo; \
-	done

 do-test:
-	@sed -i 's,abspath,basename,' ${WRKSRC}/test/lib.py
-	PATH=${WRKSRC}:$$PATH ${WRKSRC}/test/run.py
+	ln -fs ${MODPY_BIN} ${WRKDIR}/bin/python
+	cd ${WRKSRC}; PATH=${WRKSRC}:${PORTPATH} ./test/run.py

 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/txt2tags/distinfo,v
diff -u -p -r1.7 distinfo
--- distinfo	18 Jan 2015 03:15:31 -0000	1.7
+++ distinfo	16 Jul 2025 13:57:37 -0000
@@ -1,2 +1,2 @@
-SHA256 (txt2tags-2.6.tgz) = YBRn14YPPPs9SAUHB8Ynf/POsi+nvk9b2WjeVArFsFw=
-SIZE (txt2tags-2.6.tgz) = 544724
+SHA256 (txt2tags-3.9.tar.gz) = HxiL4cPczfa+r/0aRYKbTfKy9YlzyN5rwafJzvHA5PE=
+SIZE (txt2tags-3.9.tar.gz) = 252334
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/txt2tags/pkg/PLIST,v
diff -u -p -r1.7 PLIST
--- pkg/PLIST	11 Mar 2022 20:03:34 -0000	1.7
+++ pkg/PLIST	16 Jul 2025 13:57:37 -0000
@@ -1,8 +1,17 @@
-bin/gensite
 bin/txt2tags
-@man man/man1/txt2tags.1
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}/
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}txt2tags.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}txt2tags.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/METADATA
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/RECORD
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/WHEEL
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/entry_points.txt
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/licenses/
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/licenses/COPYING
+lib/python${MODPY_VERSION}/site-packages/txt2tags-${MODPY_DISTV}.dist-info/top_level.txt
+lib/python${MODPY_VERSION}/site-packages/txt2tags.py
 share/doc/txt2tags/
-share/doc/txt2tags/README
 @comment share/doc/txt2tags/manpage-ca.man
 @comment share/doc/txt2tags/manpage-de.man
 @comment share/doc/txt2tags/manpage-es.man
@@ -13,16 +22,17 @@ share/doc/txt2tags/README
 @comment share/doc/txt2tags/manpage-zh.man
 @comment share/doc/txt2tags/manpage.man
 @comment share/doc/txt2tags/manpage.t2t
-share/doc/txt2tags/txt2tags-quickref.pdf
-share/doc/txt2tags/userguide.pdf
+share/doc/txt2tags/CHANGELOG.md
+share/doc/txt2tags/README.md
+share/doc/txt2tags/TODO.md
+share/doc/txt2tags/markup.html
+share/doc/txt2tags/userguide.html
 share/examples/txt2tags/
 share/examples/txt2tags/css/
+share/examples/txt2tags/css/build
 share/examples/txt2tags/css/color.css
-share/examples/txt2tags/css/color.html
 share/examples/txt2tags/css/modern.css
-share/examples/txt2tags/css/modern.html
 share/examples/txt2tags/css/tech.css
-share/examples/txt2tags/css/tech.html
 share/examples/txt2tags/img/
 share/examples/txt2tags/img/madeinbr.png
 share/examples/txt2tags/img/old-poweredby-1.png
@@ -39,35 +49,23 @@ share/examples/txt2tags/module/
 share/examples/txt2tags/module/README
 share/examples/txt2tags/module/module-body.py
 share/examples/txt2tags/module/module-full.py
-share/examples/txt2tags/sample-slides-80x25.art
 share/examples/txt2tags/sample.adoc
-share/examples/txt2tags/sample.art
 share/examples/txt2tags/sample.creole
+share/examples/txt2tags/sample.ctx
 share/examples/txt2tags/sample.dbk
 share/examples/txt2tags/sample.doku
 share/examples/txt2tags/sample.gwiki
 share/examples/txt2tags/sample.html
 share/examples/txt2tags/sample.lout
 share/examples/txt2tags/sample.man
+share/examples/txt2tags/sample.md
 share/examples/txt2tags/sample.mgp
 share/examples/txt2tags/sample.moin
-share/examples/txt2tags/sample.pm6
 share/examples/txt2tags/sample.pmw
 share/examples/txt2tags/sample.sgml
 share/examples/txt2tags/sample.t2t
 share/examples/txt2tags/sample.tex
 share/examples/txt2tags/sample.txt
 share/examples/txt2tags/sample.wiki
-share/examples/txt2tags/sample.xhtml
-@sample share/examples/txt2tags/txt2tagsrc
 share/examples/txt2tags/txt2tagsrc.dist
-share/locale/de/LC_MESSAGES/txt2tags.mo
-share/locale/es/LC_MESSAGES/txt2tags.mo
-share/locale/eu/LC_MESSAGES/txt2tags.mo
-share/locale/fi/LC_MESSAGES/txt2tags.mo
-share/locale/fr/LC_MESSAGES/txt2tags.mo
-share/locale/hu/LC_MESSAGES/txt2tags.mo
-share/locale/it/LC_MESSAGES/txt2tags.mo
-share/locale/pt_BR/LC_MESSAGES/txt2tags.mo
-share/locale/uk/LC_MESSAGES/txt2tags.mo
-share/locale/zh_CN/LC_MESSAGES/txt2tags.mo
+@sample share/examples/txt2tags/txt2tagsrc