Wednesday, November 06, 2024

Re: zstd: enable pzstd

re-inline patch with micro tweak, added original input from Nick Owens, and
Cc'ed Bjorn Ketelaars (maintaner)

On Wed, 06 Nov 2024 21:30:45 +0100,
Kirill A. Korinsky <kirill@korins.ky> wrote:
>
> On Wed, 06 Nov 2024 20:33:45 +0100,
> Nick Owens <mischief@offblast.org> wrote:
> >
> > On Tue, Nov 5, 2024 at 3:16 PM Kirill A. Korinsky <kirill@korins.ky> wrote:
> > >
> > > On Tue, 05 Nov 2024 00:58:37 +0100,
> > > Nick Owens <mischief@offblast.org> wrote:
> > > >
> > > > hi,
> > > >
> > > > here's a change to enable pzstd in archivers/zstd. pzstd can do parallel
> > > > de/compression, like pigz.
> > > >
> > > > i built this locally and it seemed to produce the right binary, but i'm not
> > > > very familiar with ports yet, so apologies if this change is incomplete.
> > > >
> > > > diff --git a/archivers/zstd/Makefile b/archivers/zstd/Makefile
> > > > index 3b6d18883ae..22dca58e7dd 100644
> > > > --- a/archivers/zstd/Makefile
> > > > +++ b/archivers/zstd/Makefile
> > > > @@ -44,6 +44,14 @@ TEST_TARGET = check
> > > > TESTTMP = ${WRKDIR}/tmp
> > > > TEST_ENV = TMPDIR=${TESTTMP}
> > > >
> > > > +do-build:
> > > > + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -C ${WRKSRC}
> > > > + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -C ${WRKSRC}/contrib/pzstd
> > > > +
> > > > +do-install:
> > > > + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -C ${WRKSRC} install
> > > > + ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -C ${WRKSRC}/contrib/pzstd install
> > > > +
> > >
> > > I think you need ${_PBUILD} here as well.
> >
> > i see do-build is invoked as
> >
> > bsd.port.mk:3065: @${_PMAKE} do-build
> >
> > and _PMAKE is ${_PBUILD} ${MAKE} if ${PORTS_PRIVSEP}
> >
> > pkgpath.mk:138:_PMAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec
> > ${_PBUILD} ${MAKE}
> >
> > so won't ${_PBUILD} be added automatically as needed? if i
> > misunderstood, i can still send a new patch to add it.
> >
>
> You absolutley right, no need of ${_PBUILD} here. Sorry to misslead you.
>
> Your original patch ignores value ALL_TARGET and if I understand zstd
> Makefile right, you build all target that builds all contrib. Am I wrong?
>
> Here a bit different approach which builds only contrib/pzstd:
>

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/archivers/zstd/Makefile,v
diff -u -p -r1.47 Makefile
--- Makefile 16 Apr 2024 17:29:50 -0000 1.47
+++ Makefile 6 Nov 2024 20:41:47 -0000
@@ -1,6 +1,7 @@
COMMENT = zstandard fast real-time compression algorithm

V = 1.5.6
+REVISION = 0
DISTNAME = zstd-${V}

SHARED_LIBS = zstd 6.4 # 1.5.6
@@ -46,6 +47,12 @@ TEST_ENV = TMPDIR=${TESTTMP}

pre-build:
ln -fs ${LOCALBASE}/bin/ggrep ${WRKDIR}/bin/grep
+
+post-build:
+ cd ${WRKSRC}/contrib/pzstd && exec ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS}
+
+post-install:
+ cd ${WRKSRC}/contrib/pzstd && exec ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${FAKE_TARGET}

pre-test:
mkdir -p ${TESTTMP}
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/archivers/zstd/pkg/PLIST,v
diff -u -p -r1.9 PLIST
--- pkg/PLIST 8 Mar 2022 08:53:49 -0000 1.9
+++ pkg/PLIST 6 Nov 2024 20:21:55 -0000
@@ -1,3 +1,4 @@
+@bin bin/pzstd
bin/unzstd
@bin bin/zstd
bin/zstdcat


--
wbr, Kirill

No comments:

Post a Comment