Sunday, November 08, 2026

Re: pkg-config file for bzip2

On Sun, Nov 08, 2026 at 08:12:30AM -0700, Anthony J. Bentley wrote: > Based on a recent discussion... > > bzip2 doesn't come with a .pc file. The next bzip2 release would almost > certainly have one, but it's unlikely there will ever be a new release. > Not soon, at any rate. In the meantime, meson assumes pkg-config will > find libbz2 and tries to use cmake otherwise, which dies since we poison > cmake. This may warrant another approach to forcefully disable bz2. > This fixes my test case, misc/qman. But I think it might be a bad idea. > FreeBSD and Debian don't provide a .pc file. (I have no idea how they > satisfy meson.) Still, to close this out in my own head, here's a diff. > > Thoughts? Regarding your diff, you should be able to > blob - 58824a2897a49eed013e2cc62b513a983113d620 > blob + 2d36486ce3ea1a38632c05d13b1ebd72ea166a3c > --- archivers/bzip2/Makefile > +++ archivers/bzip2/Makefile > @@ -1,7 +1,8 @@ > COMMENT= block-sorting file compressor, unencumbered > > -DISTNAME= bzip2-1.0.8 > -REVISION= 0 > +BZ2_VERSION = 1.0.8 > +DISTNAME= bzip2-${BZ2_VERSION} > +REVISION= 1 > > CATEGORIES= archivers > > @@ -26,8 +27,16 @@ DEBUG_PACKAGES= ${BUILD_PACKAGES} > TEST_FLAGS= LD_LIBRARY_PATH="${WRKBUILD}" LIBbz2_VERSION=${LIBbz2_VERSION} > TEST_TARGET= test > > +SUBST_VARS= BZ2_VERSION > + > +pre-configure: > + cp ${FILESDIR}/bzip2.pc ${WRKBUILD} > + drop pre-configure > post-install: > ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/bzip2 > ${INSTALL_DATA} ${WRKBUILD}/manual.html ${PREFIX}/share/doc/bzip2 > + ${SUBST_CMD} ${WRKBUILD}/bzip2.pc > + ${INSTALL_DATA_DIR} ${PREFIX}/lib/pkgconfig > + ${INSTALL_DATA} ${WRKBUILD}/bzip2.pc ${PREFIX}/lib/pkgconfig and replace those three lines with: ${SUBST_CMD} -m ${SHAREMODE} -c ${FILESDIR}/bzip2.pc ${PREFIX}/lib/pkgconfig/bzip2.pc (lib/pkgconfig is created by default.) > .include <bsd.port.mk> > blob - /dev/null > blob + d660f649eb5b8ca139e5ba82ffcec581b5ae8661 (mode 644) > --- /dev/null > +++ archivers/bzip2/files/bzip2.pc > @@ -0,0 +1,11 @@ > +prefix=${TRUEPREFIX} > +exec_prefix=${prefix} > +bindir=${prefix}/bin > +libdir=${prefix}/lib > +includedir=${prefix}/include > + > +Name: bzip2 > +Description: Lossless, block-sorting data compression > +Version: ${BZ2_VERSION} > +Libs: -L${libdir} -lbz2 > +Cflags: -I${includedir} > blob - b2524ffb9c000994e61d7889b89284cf94fabe2e > blob + 4ac28201ca235890e5a86943b965a677f89dccde > --- archivers/bzip2/pkg/PLIST > +++ archivers/bzip2/pkg/PLIST > @@ -10,8 +10,9 @@ bin/bzgrep > bin/bzless > bin/bzmore > include/bzlib.h > -lib/libbz2.a > +@static-lib lib/libbz2.a > @lib lib/libbz2.so.${LIBbz2_VERSION} > +lib/pkgconfig/bzip2.pc > @man man/man1/bunzip2.1 > @man man/man1/bzcat.1 > @man man/man1/bzcmp.1 > -- jca

pkg-config file for bzip2

Based on a recent discussion... bzip2 doesn't come with a .pc file. The next bzip2 release would almost certainly have one, but it's unlikely there will ever be a new release. Not soon, at any rate. In the meantime, meson assumes pkg-config will find libbz2 and tries to use cmake otherwise, which dies since we poison cmake. This fixes my test case, misc/qman. But I think it might be a bad idea. FreeBSD and Debian don't provide a .pc file. (I have no idea how they satisfy meson.) Still, to close this out in my own head, here's a diff. Thoughts? blob - 58824a2897a49eed013e2cc62b513a983113d620 blob + 2d36486ce3ea1a38632c05d13b1ebd72ea166a3c --- archivers/bzip2/Makefile +++ archivers/bzip2/Makefile @@ -1,7 +1,8 @@ COMMENT= block-sorting file compressor, unencumbered -DISTNAME= bzip2-1.0.8 -REVISION= 0 +BZ2_VERSION = 1.0.8 +DISTNAME= bzip2-${BZ2_VERSION} +REVISION= 1 CATEGORIES= archivers @@ -26,8 +27,16 @@ DEBUG_PACKAGES= ${BUILD_PACKAGES} TEST_FLAGS= LD_LIBRARY_PATH="${WRKBUILD}" LIBbz2_VERSION=${LIBbz2_VERSION} TEST_TARGET= test +SUBST_VARS= BZ2_VERSION + +pre-configure: + cp ${FILESDIR}/bzip2.pc ${WRKBUILD} + post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/bzip2 ${INSTALL_DATA} ${WRKBUILD}/manual.html ${PREFIX}/share/doc/bzip2 + ${SUBST_CMD} ${WRKBUILD}/bzip2.pc + ${INSTALL_DATA_DIR} ${PREFIX}/lib/pkgconfig + ${INSTALL_DATA} ${WRKBUILD}/bzip2.pc ${PREFIX}/lib/pkgconfig .include <bsd.port.mk> blob - /dev/null blob + d660f649eb5b8ca139e5ba82ffcec581b5ae8661 (mode 644) --- /dev/null +++ archivers/bzip2/files/bzip2.pc @@ -0,0 +1,11 @@ +prefix=${TRUEPREFIX} +exec_prefix=${prefix} +bindir=${prefix}/bin +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: bzip2 +Description: Lossless, block-sorting data compression +Version: ${BZ2_VERSION} +Libs: -L${libdir} -lbz2 +Cflags: -I${includedir} blob - b2524ffb9c000994e61d7889b89284cf94fabe2e blob + 4ac28201ca235890e5a86943b965a677f89dccde --- archivers/bzip2/pkg/PLIST +++ archivers/bzip2/pkg/PLIST @@ -10,8 +10,9 @@ bin/bzgrep bin/bzless bin/bzmore include/bzlib.h -lib/libbz2.a +@static-lib lib/libbz2.a @lib lib/libbz2.so.${LIBbz2_VERSION} +lib/pkgconfig/bzip2.pc @man man/man1/bunzip2.1 @man man/man1/bzcat.1 @man man/man1/bzcmp.1