patch-dl
Summary
Section titled “Summary”patch-dl adds two ices — dl and patch — that download extra files from URLs and apply unified-diff patches during plugin installation, enabling source-build recipes that require external patches.
Details
Section titled “Details”-
Problem it solves: Some plugins or source packages require additional files (patches, config files) that are not part of their repository. Fetching and applying them manually before building breaks reproducibility;
dlandpatchembed those steps directly into the Zinit invocation. -
New ices:
dl'{URL} [-> {output-filename}];'— downloads the file at{URL}into the plugin/snippet directory; if no output filename is given, the last URL segment is used; multiple downloads can be separated by;patch'{patch-file}; …'— applies the named patch file (already present in the directory, e.g., downloaded viadl) usingpatch; multiple patches separated by;
-
Install:
Terminal window zinit light zdharma-continuum/zinit-annex-patch-dl
Examples
Section titled “Examples”# Build fbterm from source, downloading and applying two required patcheszinit ice \ as"command" \ atclone"./configure --prefix=$ZPFX" \ atpull"%atclone" \ dl"https://aur.archlinux.org/cgit/aur.git/plain/0001-Fix-build-with-gcc-6.patch?h=fbterm-git" \ dl"https://bugs.archlinux.org/task/46860?getfile=13513 -> ins.patch" \ make"install" \ patch"ins.patch; 0001-Fix-build-with-gcc-6.patch" \ pick"$ZPFX/bin/fbterm" \ resetzinit load izmntuk/fbtermCaveats / Common Mistakes
Section titled “Caveats / Common Mistakes”- Patches must be downloaded with
dl(or otherwise placed in the plugin directory) before referencing them inpatch; the order of ice evaluation isdlthenpatch. - File download uses the last URL path segment as the default name; use
-> filenamewhen the URL has a query string or an unhelpful name.