Giter Site home page Giter Site logo

zinit-annex-patch-dl's Introduction

zinit-annex-patch-dl

A 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 is given, then it is taken from the 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" \
    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" \
    reset

zinit load izmntuk/fbterm

This command will result in:

fbterm example

Installation

Run the following command to add the annex to Zinit:

zinit light zdharma-continuum/zinit-annex-patch-dl

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

zinit-annex-patch-dl's People

Contributors

jankatins avatar pschmitt avatar psprint avatar ryaminal avatar vladdoster avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

zinit-annex-patch-dl's Issues

[bug]: bad floating point constant

Describe the bug

When first run on .zshrc, it installs some packages and show this error message:

za-patch-dl-handler:78: bad floating point constant

Steps to reproduce

Use this zshrc:

### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
    print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
    command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
    command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
        print -P "%F{33} %F{34}Installation successful.%f%b" || \
        print -P "%F{160} The clone has failed.%f%b"
fi

source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
    zdharma-continuum/zinit-annex-as-monitor \
    zdharma-continuum/zinit-annex-bin-gem-node \
    zdharma-continuum/zinit-annex-patch-dl \
    zdharma-continuum/zinit-annex-rust

### End of Zinit's installer chunk

zinit pack"binary+keys" for fzf

Expected behavior

No error message

Screenshots and recordings

asciicast

Operating System & Version

linux-gnu | pc | x86_64 | x86_64 | x86_64 unknown

Zsh version

zsh 5.9 (x86_64-pc-linux-gnu)

Terminal emulator

alacritty

If using WSL on Windows, which version of WSL

No response

Additional context

No response

[bug]: fails to install fzf additonal files

Describe the bug

Since a few weeks, it fails to install the additional files which I want to install together with fzf.

I hunted it down to this change:

- srcdst=( ${srcdst[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/} )
+ srcdst=(${${srcdst[@]##[[:blank:]]##}%%[[:blank:]]##})

In 7121802

If I use the old version, it works, if I use the new version, I get an error. Given that I've neither an idea what the old version does nor the new version, I abstain from making a PR for just reverting this line.

Steps to reproduce

zinit lbin'!' completions \
    dl'https://raw.githubusercontent.com/junegunn/fzf/master/bin/fzf-tmux;
       https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> _fzf_completion;
       https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh;
       https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1 -> $ZPFX/man/man1/fzf-tmux.1;
       https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1 -> $ZPFX/man/man1/fzf.1' \
    src"key-bindings.zsh" \
    for @junegunn/fzf

Run zinit update to get all the latest versions (Might already observe the below problems in case fzf gets updated).

Run zinit delete junegunn/fzf -y && exec zsh

Expected behavior

All the nice additional files are installed.

Screenshots and recordings

Bad behaviour:

λ  zinit delete junegunn/fzf -y && exec zsh
==> linkbin: Deleted fzf soft link
==> Uninstalled junegunn/fzf

Downloading junegunn/fzf…


(Requesting `fzf-0.45.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################################### 100.0%
[ziextract] Unpacking the files from: `fzf-0.45.0-linux_amd64.tar.gz'
[ziextract] Successfully extracted and assigned +x chmod to the file: fzf.
==> patch-dl: fzf-tmux downloaded successfully
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh
\$ZPFX/man/man1/fzf-tmux.1"
\$ZPFX/man/man1/fzf-tmux.1"
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1
\$ZPFX/man/man1/fzf.1"
\$ZPFX/man/man1/fzf.1"
curl: (3) URL rejected: Malformed input to a URL function
curl: (3) URL rejected: Malformed input to a URL function
Error:  patch-dl: Failed to download the URL
 https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1
==> linkbin: Created fzf soft link & set +x on the fzf binary
==> Installed 1 completion

With the old line:

λ  zinit delete junegunn/fzf
==> Delete junegunn/fzf? [y/N]: y
==> linkbin: Deleted fzf soft link
==> Uninstalled junegunn/fzf

λ  exec zsh

Downloading junegunn/fzf…


(Requesting `fzf-0.45.0-linux_amd64.tar.gz'…)
####################################################################################################################################################################################### 100.0%
[ziextract] Unpacking the files from: `fzf-0.45.0-linux_amd64.tar.gz'
[ziextract] Successfully extracted and assigned +x chmod to the file: fzf.
==> patch-dl: fzf-tmux downloaded successfully
==> patch-dl: _fzf_completion downloaded successfully
==> patch-dl: key-bindings.zsh downloaded successfully
\$ZPFX/man/man1/fzf-tmux.1"
\$ZPFX/man/man1/fzf-tmux.1"
==> patch-dl: fzf-tmux.1 downloaded successfully
\$ZPFX/man/man1/fzf.1"
\$ZPFX/man/man1/fzf.1"
==> patch-dl: fzf.1 downloaded successfully
==> linkbin: Created fzf soft link & set +x on the fzf binary
==> Installed 1 completion

Operating System & Version

linux-gnu | debian | x86_64 | x86_64 | x86_64 unknown

Zsh version

zsh 5.9 (x86_64-debian-linux-gnu

Terminal emulator

wezterm

If using WSL on Windows, which version of WSL

None

Additional context

No response

[bug]: test

Describe the bug

s

Steps to reproduce

s

Expected behavior

s

Screenshots and recordings

No response

Operating System & Version

s

Zsh version

s

Terminal emulator

s

If using WSL on Windows, which version of WSL

None

Additional context

No response

[bug]: dl doesn't work

Describe the bug

Recently dl doesn't work in my env. No files are downloaded.
My configuration is below.

env:

  • zsh 5.9 (x86_64-apple-darwin21.3.0)
  • zinit c3d1bb5
# FZF: fuzzy finder
zinit ice wait lucid as"null" from"gh-r" nocompile src'key-bindings.zsh' sbin \
      dl'https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh;
         https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh -> $ZPFX/completions/_fzf_completion;
         https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf.1 -> $ZPFX/share/man/man1/fzf.1
         https://raw.githubusercontent.com/junegunn/fzf/master/man/man1/fzf-tmux.1 -> $ZPFX/share/man/man1/fzf-tmux.1;'
zinit light junegunn/fzf

Steps to reproduce

  1. Enable junegunn/fzf
  2. Run exec zsh

Expected behavior

Download fzf bninary and scripts.

Screenshots and recordings

No response

Operating System & Version

darwin21.3.0 | apple | x86_64 | x86_64 | x86_64 i386

Zsh version

5.9

Terminal emulator

iTerm2

If using WSL on Windows, which version of WSL

No response

Additional context

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.