Allows for zinit to download and patch files it installs.
Go to file
2020-02-07 05:54:33 +01:00
images images: fbterm-ex.png 2019-09-10 01:19:00 +02:00
.gitignore Add .gitignore 2019-09-10 00:16:41 +02:00
:za-patch-dl-handler *handler: Show the messages only when the update is nonempty 2020-02-07 05:54:33 +01:00
LICENSE Initial commit 2019-09-08 04:33:28 +02:00
README.md README.md 2020-01-22 00:35:14 +01:00
z-a-patch-dl.plugin.zsh plugin.zsh: Zplugin → Zinit rename 2020-01-18 07:33:18 +01:00

Introduction

A Zsh-Zinit extension (i.e. an annex) that downloads files and applies patches. It adds two ice modifiers:

zinit ice dl'{URL} [-> {optional-output-file-name}]; …'

and

zinit ice patch'{file-name-with-the-patch-to-apply}; …'

The Zinit annex (i.e. an extension) will:

  • download the given {URL} under the path {optional-output-file-name} (if no file name given, then it is taken from last segment of the URL) in case of the dl'' ice-mod,
  • apply a patch given by the {file-name-with-the-patch-to-apply} in case of the patch'' ice-mod.

You can use this functionality to download and apply patches. For example, to install fbterm, two patches are being needed, one to fix the operation, the other one to fix the build:

zinit ice \
    as"command" pick"$ZPFX/bin/fbterm" \
    dl"https://bugs.archlinux.org/task/46860?getfile=13513 -> ins.patch" \
    dl"https://aur.archlinux.org/cgit/aur.git/plain/0001-Fix-build-with-gcc-6.patch?h=fbterm-git" \
    patch"ins.patch; 0001-Fix-build-with-gcc-6.patch" \
    atclone"./configure --prefix=$ZPFX" \
    atpull"%atclone" \
    make"install" reset
zinit load izmntuk/fbterm

This command will result in:

fbterm
example

Installation

Simply load like a plugin, i.e. the following will add the annex to Zinit:

zinit light zinit-zsh/z-a-patch-dl

After executing this command you can then use the dl'' and patch'' ice-mods.