Skip to content

portextract: add use_zstd option for .tar.zst distfiles#379

Closed
herbygillot wants to merge 1 commit into
macports:masterfrom
herbygillot:use-zstd
Closed

portextract: add use_zstd option for .tar.zst distfiles#379
herbygillot wants to merge 1 commit into
macports:masterfrom
herbygillot:use-zstd

Conversation

@herbygillot
Copy link
Copy Markdown
Member

Adds native support for extracting zstandard-compressed distfiles via a new use_zstd option, following the same pattern as use_xz, use_lzip, etc. The zstd binary is located at runtime via PATH (same approach as lzip and 7za, since zstd is not a macOS system tool).

  • portextract.tcl: add use_zstd to all_use_options; wire up get_extract_cmd (binaryInPath zstd), get_extract_suffix (.tar.zst), and add_extract_deps (bin:zstd:zstd)
  • doc/portfile.7: document use_zstd between use_xz and use_7z
  • tests/portextract.test: new test file covering get_extract_suffix and get_extract_pre_args for all use_* options, plus a mocked get_extract_cmd test for use_zstd

Closes: https://trac.macports.org/ticket/72713

Adds native support for extracting zstandard-compressed distfiles via
a new use_zstd option, following the same pattern as use_xz, use_lzip,
etc. The zstd binary is located at runtime via PATH (same approach as
lzip and 7za, since zstd is not a macOS system tool).

- portextract.tcl: add use_zstd to all_use_options; wire up
  get_extract_cmd (binaryInPath zstd), get_extract_suffix (.tar.zst),
  and add_extract_deps (bin:zstd:zstd)
- doc/portfile.7: document use_zstd between use_xz and use_7z
- tests/portextract.test: new test file covering get_extract_suffix
  and get_extract_pre_args for all use_* options, plus a mocked
  get_extract_cmd test for use_zstd

Closes: https://trac.macports.org/ticket/72713

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jmroot
Copy link
Copy Markdown
Member

jmroot commented Mar 28, 2026

I think we were wanting to avoid adding any more use_* options, and instead move in the direction of figuring out the extract command automatically from extract.suffix. See discussion in #50969 and #64960.
@ryandesign @mojca @raimue

@herbygillot
Copy link
Copy Markdown
Member Author

I think we were wanting to avoid adding any more use_* options, and instead move in the direction of figuring out the extract command automatically from extract.suffix. See discussion in #50969 and #64960. @ryandesign @mojca @raimue

OK, closing this in preference of file_extract - PR for that here: #402

@ryandesign
Copy link
Copy Markdown
Contributor

I don't recall a discussion about not wanting to add new use_* options. A generic extract-any-file feature would be great and having it replace the use_* options is the ultimate goal but there were many design questions that I don't think were answered yet and in the interim I'm not opposed to the straightforward addition of a new use_zstd option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants