Index | Thread | Search

From:
Johannes Thyssen Tishman <jtt@openbsd.org>
Subject:
Re: [new] textproc/bibtool
To:
Marco van Hulten <marco@hulten.org>
Cc:
ports@openbsd.org
Date:
Thu, 4 Dec 2025 13:45:10 +0000

Download raw body.

Thread
2025-12-02T14:17:28+0100 Marco van Hulten <marco@hulten.org>:
> Hi Johannes,
> 
> On Tue Dec 2, 2025 at 12:41 PM CET, Johannes Thyssen Tishman wrote:
> > 2025-11-24T16:13:44+0100 Marco van Hulten <marco@hulten.org>:
> >> Hello,
> >> 
> >> Attached is a new port for manipulating BibTeX entries.  I have used it
> >> for the last decade or so for sanatising BibTeX entries (typically, for
> >> any newly downloaded work) and redirecting this to my BibTeX database.
> >> Sometimes I use it to search the database.
> >> 
> >> For a more complete description of its functionality, see its homepage:
> >> 
> >> https://www.gerd-neugebauer.de/software/TeX/BibTool/en/
> >> 
> >> I'd be happy to maintain this.
> >> 
> >>  Marco
> >
> > Hi Marco,
> >
> > Thanks for working on this. I haven't tested bibtool yet since I have
> > some initial remarks about the port:
> >
> > - The trailing en/ needs to be removed from SITES to fetch the sources.
> >
> > - I'd prefer if HOMEPAGE pointed to the english version of the website,
> >   i.e., please add the trailing en/ here. I assume this was your initial
> >   intention and accidentally switched it with SITES? With this, you can
> >   do SITES = ${HOMEPAGE:S|en/$||}.
> 
> Yes, exactly.
> 
> > - The kpathsea library is picked up at configure time if found. The
> >   install documentation (see install.tex) mentions that the usage of
> >   this library is experimental and that it is only used to search for
> >   BibTeX files. If you don't need it, maybe we could disable it with
> >   CONFIGURE_ARGS = --without-kpathsea, so as to avoid having
> >   print/texlive/base as a build dependency?
> 
> And as test dependency.  Doing this results in two more tests begin
> (successfully) executed that I suppose are there as substitutes for
> functionality kpathsea would provide.
> 
> In any case, all test still succeed and how I typically use BibTool also
> still works, so I'm fine with dropping this dependency.
> 
> > - Why is print/texlive/base needed as a runtime dependency?
> 
> This was needed for both test and run, because otherwise
> 
>   warning: kpathsea: configuration file texmf.cnf not found in these directories: /usr/local/share/texmf-dist/web2c.
> 
> but we can leave out the kpathsea dependency, which I do now.
> 
> > - Bibtool depends on an old version of the GNU Regular Expression
> >   Library that it bundles. I don't know if we could pull this from base
> >   or a port. I'd wait for feedback on this.
> >
> > - Lots of warnings at build time? Can anything be done about this?
> >
> > I'll try to take another look later if I find some time.
> 
> Thank you!  I did not address the last two (harder) issues.
> 
> New tarball attached.

SITES is still wrong. Either add a trailing slash to HOMEPAGE or remove
it from the substitution in SITES.

Below a diff that addresses the following nits:

- Fix SITES.
- Use braces in all variables for consistency. This is just my
  preference, ignore if you wish.
- Install man page. Not as good as the manual (see BUGS in bibtool(1)),
  but the manual can be looked up online and this is better than
  nothing.

With this ok jtt@, but it'd be nice to have another dev's input
regarding the bundled regex library and compilation warnings.

diff -rup /tmp/bibtool/Makefile bibtool/Makefile
--- /tmp/bibtool/Makefile	Tue Dec  2 14:13:49 2025
+++ bibtool/Makefile	Thu Dec  4 14:14:24 2025
@@ -1,12 +1,12 @@
 COMMENT =		tool for manipulating BibTeX databases
 
 VERSION =		2.68
-DISTNAME =		BibTool-$(VERSION)
-PKGNAME =		bibtool-$(VERSION)
+DISTNAME =		BibTool-${VERSION}
+PKGNAME =		bibtool-${VERSION}
 
 CATEGORIES =		textproc
 
-HOMEPAGE =		https://www.gerd-neugebauer.de/software/TeX/BibTool/en
+HOMEPAGE =		https://www.gerd-neugebauer.de/software/TeX/BibTool/en/
 
 MAINTAINER =		Marco van Hulten <marco@hulten.org>
 
@@ -15,17 +15,20 @@ PERMIT_PACKAGE =	Yes
 
 WANTLIB += c
 
-SITES =			$(HOMEPAGE:S|en/$||)
+SITES =			${HOMEPAGE:S|en/$||}
 # At https://mirrors.ctan.org/biblio/bibtex/utils/bibtool/ lives a tarball with
 # a different checksum, but their contents are identical.
 
 FAKE_FLAGS =		INSTALLPREFIX=${WRKINST}
-TEST_FLAGS =		TEXMFCNF=$(PREFIX)/share/texmf-dist/web2c
+TEST_FLAGS =		TEXMFCNF=${PREFIX}/share/texmf-dist/web2c
 
 CONFIGURE_STYLE =	gnu
 CONFIGURE_ARGS =	--without-kpathsea
 
 MAKE_FILE =		makefile
 WRKDIST =		${WRKDIR}/BibTool
+
+post-install:
+	${INSTALL_MAN} ${WRKSRC}/doc/bibtool.1 ${PREFIX}/man/man1
 
 .include <bsd.port.mk>
diff -rup /tmp/bibtool/pkg/PLIST bibtool/pkg/PLIST
--- /tmp/bibtool/pkg/PLIST	Tue Nov 18 15:10:12 2025
+++ bibtool/pkg/PLIST	Thu Dec  4 14:14:36 2025
@@ -13,3 +13,4 @@ lib/BibTool/month.rsc
 lib/BibTool/opt.rsc
 lib/BibTool/sort_fld.rsc
 lib/BibTool/tex_def.rsc
+@man man/man1/bibtool.1