Yay: How to edit PKGBUILD before install

Created on 4 Oct 2018  路  7Comments  路  Source: Jguer/yay

Hello !

I'm a new yay user.
I migrated from yaourt very recently.

I've noticed one missing feature compared to yaourt.
I can't edit the PKGBUILD before the install.
It's very useful, because it allows me to remove unwanted dependencies.
I have 2 real examples:

smartgit requires to install java-runtime.
Actually it is not needed because the source archive file provides its own Java runtime.
So I edit the PKGBUILD before an install/update and remove this dependency.

Another example is yay itself.
I'm a Go developer and I use my own Go environment.
I don't need the go Archlinux package.
When I installed yay the first time, using yaourt, I could edit the PKGBUILD and remove the go dependency.

How can I do that with yay ?
Thanks.

Most helpful comment

If someone has the same problem and is reading this, my workaround is:

  • yay -G <package_name>
  • edit the PKGBUILD
  • makepkg -si

All 7 comments

See the manpage/help for --editmenu.

Do note that yay doesn't use the pkgbuild for dependencies it uses the RPC. So yay will ignore these changes in its dependency solving. The changes will still apply to the built packages though. This is noted in the FAQ and manpage.

ok, thank you !

If someone has the same problem and is reading this, my workaround is:

  • yay -G <package_name>
  • edit the PKGBUILD
  • makepkg -si

I think there's no need for a workaround. yay --editmenu -S <package-name> does exactly what you're asking for.

I'm sorry for the (very) late comment. I just wanted to point that out in case somebody else stumbles upon this issue.

@brainplot no, yay installs the dependencies before allowing you to edit the PKGBUILD

Ah, I see. Thanks for the clarification.

Also it seems that (at least) the provides array is cached before the changes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

muesli picture muesli  路  4Comments

captn3m0 picture captn3m0  路  4Comments

drrlvn picture drrlvn  路  4Comments

tapir picture tapir  路  3Comments

torvic9 picture torvic9  路  4Comments