What is the idiomatic way to patch an app from the official repositories?


I want to patch an application (KiCad). For now, I’m just using a local git clone with my patch applied, so it doesn’t update via the package manager and that’s an issue.

Instead of using the official repository, I could use kicad-git from the AUR, so I can patch it during the build phase. However, by doing so it will want to re-build every time someone merge to master. I only want to build every few months, at about the same rate as the offical Manjaro package is updated.

So in simple terms:

  • I want to patch an app from the repositories (official or AUR).
  • But if I use the AUR, I don’t want to be prompted to update every day.

Is there an idiomatic/clean way to do that?


Let me summarize it:

  • You want package manager to handle (un)installation, so you don’t want to use local git clone
  • But you don’t want to use either official or AUR package, because you will be prompted to update whenever there is one

correct? If yes, then you can git clone the AUR package, then locally install the package using makepkg -si or makepkg followed by sudo pacman <resulting package>. Pacman will consider this as a package installed from neither repo, and thus will not prompt for update.

I still want updates when a new version of KiCad is released. That’s why I want to use the package manager. However, I don’t want an update every day, each time a new commit is made.

I think that the solution is to create a new package that install the app from a forked repo. This repo must be kept up to date each time a new version of the app is release using a CI/CD script.

As a temporary solution will the Flatpak not work? I mean, it has a testing build, so I presume it’s newer and has the patch?

Ugh, this is hard.

This might be the best, since you want something quite far from the ordinary. I don’t think there is any idiomatic way, so yeah just do whatever works.

Or create a custom PKGBUILD with a custom name that does everything, whatever you want and install it from local. Then it won’t get overridden wheen updating and your custom package is then managed on its own.



Packages from repo are also built from a PKGBUILD. You can edit those too.



I want to apply a patch that is not official so a newer version will not have it.

I don’t see a better solution yes… But at least there is one!

Yes that’s the idea but the problem was more about the update frequency: it needs to be updated automatically as new versions are released, but not for every commit. The combination of PKGBUILD + fork + CI/CD should do the trick.

Yes, but do you know where I can find the PKGBUILD that Manjaro uses for its official repositories? Because, there is not everything here: Extra · GitLab. Does that means that when something is missing here, Manjaro uses the Arch one: Packages · GitLab ?

95% of Manjaro’s repo are Arch packages. You can check package info for maintainer.

KiCad is inherited from Arch so PKGBUILD is published on Arch gitlab

PKGBUILD · main · Arch Linux / Packaging / Packages / kicad · GitLab