Stuart Henderson:

> > Log message:
> > archivers/xz: update to 5.4.1
> > 
> > Significant changes:
> > * threaded .xz decompressor
> > * decompression support for the .lz (lzip) file format
> > * upstream pledge(2) sandboxing
> 
> Would it make sense to switch lzip decompression to use this instead?
> I'm also wondering if we should add a way to pass user-defined flags to
> xz; the new threaded decompressor saves a lot of clock time extracting
> large xz files (including ports like chromium, firefox, texmf).

Threaded decompression only provides a benefit if the file was
compressed in multithreaded mode.  Currently, this applies only to
a handful of distfiles.  Notably not texmf.  Here's probably the
best case:

iridium-browser-2022.12.108.1.tar.xz, make -DNO_CHECKSUM extract
MAKE_JOBS=1    2m33.07s real     2m11.10s user     1m00.22s system
MAKE_JOBS=1    2m32.76s real     2m12.22s user     1m01.62s system
MAKE_JOBS=4    1m09.20s real     2m17.62s user     1m06.11s system
MAKE_JOBS=4    1m09.69s real     2m17.74s user     1m05.08s system

But yes, I wanted to make more or less the same suggestions.
* Now that upstream supports pledge(), switch from xzdec to xz.
* Enable threaded decompression: use ${MAKE_JOBS} threads.
* Also use xz for .lz files.

Patch below.
This also drops support for lz-compressed patch files, because
there aren't any.  We never added support for xz-compressed patch
files, because we never encountered any.  If the need arises,
it will be trivial to add.

ok?


Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1582
diff -u -p -r1.1582 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       9 Jan 2023 17:08:50 -0000       1.1582
+++ infrastructure/mk/bsd.port.mk       17 Jan 2023 14:15:32 -0000
@@ -1366,20 +1366,11 @@ EXTRACT_CASES += *.zip) \
 .endif
 
 .if !empty(_LIST_EXTRACTED:M*.xz) || \
-       !empty(_LIST_EXTRACTED:M*.lzma)
-BUILD_DEPENDS += archivers/xz
-EXTRACT_CASES += *.tar.xz) \
-       xzdec <${FULLDISTDIR}/$$archive | ${TAR} -xf - -- ${EXTRACT_FILES};;
-EXTRACT_CASES += *.tar.lzma) \
-       lzmadec <${FULLDISTDIR}/$$archive | ${TAR} -xf - -- ${EXTRACT_FILES};;
-.endif
-
-.if !empty(_LIST_EXTRACTED:M*.tar.lz)
-BUILD_DEPENDS += archivers/lzip/lunzip
-EXTRACT_CASES += *.tar.lz) \
-       lunzip <${FULLDISTDIR}/$$archive | ${TAR} -xf - -- ${EXTRACT_FILES};;
-PATCH_CASES += *.lz) \
-       lunzip <$$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
+       !empty(_LIST_EXTRACTED:M*.lzma) || \
+       !empty(_LIST_EXTRACTED:M*.tar.lz)
+BUILD_DEPENDS += archivers/xz>=5.4.0
+EXTRACT_CASES += *.tar.xz|*.tar.lzma|*.tar.lz) \
+       xz -T${MAKE_JOBS} -d <${FULLDISTDIR}/$$archive | ${TAR} -xf - -- 
${EXTRACT_FILES};;
 .endif
 
 .if !empty(_LIST_EXTRACTED:M*.bz2) || \
-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to