You are not logged in.

#1 2025-08-01 21:05:23

twfox
Member
Registered: 2025-07-07
Posts: 8

[Solved] Custom package with patches replaced by pacman

Hi!

I downloaded a package from extra, applied some custom patches and installed with:

pacman -U .tar.zst

The package gets overwritten when there's an update and I need to go through the same process of downloading the new tar file from archlinux.org/packages applying patches etc.

Any ideas how to do this in a smarter way next time? I would like to automate this somehow.

Last edited by twfox (2025-08-02 14:13:43)

Offline

#2 2025-08-01 21:41:16

ankabo
Member
Registered: 2025-07-14
Posts: 16

Re: [Solved] Custom package with patches replaced by pacman

Hi!

You can go to

/etc/pacman.conf

and there you can set

IgnorePkg = <packagename>

for example

IgnorePkg = ffmpeg

You will see it in the file, its documented there.

Offline

#3 2025-08-01 21:41:49

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

https://wiki.archlinux.org/title/Pacman#Hooks
Don't patch (what exactly?) the package, but the installation.

Offline

#4 2025-08-01 22:56:35

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,443
Website

Re: [Solved] Custom package with patches replaced by pacman

What are you patching and why?

Offline

#5 2025-08-02 08:37:50

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

ankabo wrote:

Hi!

You can go to

/etc/pacman.conf

and there you can set

IgnorePkg = <packagename>

for example

IgnorePkg = ffmpeg

You will see it in the file, its documented there.

I've tried this but it freezes the package and I still want the updates.

seth wrote:

https://wiki.archlinux.org/title/Pacman#Hooks
Don't patch (what exactly?) the package, but the installation.

This looks promising, I'll give it a try, thanks!

gromit wrote:

What are you patching and why?

Urxvt. Its my own combo of patches from different AUR pkgs.

Offline

#6 2025-08-02 09:28:09

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

So you're essentially using a completely different package.
Just don't install urxvt from the repos tbw.

Offline

#7 2025-08-02 14:13:22

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

Well I wouldn't say completely different, its still like 98% the same,  patches are small.

I don't know if it will be more work to maintain the hook or my own build but in any case I'll give a try to learn how it works.

Thanks again for the suggestion!

Offline

#8 2025-08-02 14:31:10

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

Well I wouldn't say completely different, its still like 98% the same,  patches are small.

Sure, but you apply them at build-time, right? You're completely replacing the files from the repo package, no?

Offline

#9 2025-08-02 19:51:31

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

I edit the PGKBUILD and apply the patches during build() , yes.

Offline

#10 2025-08-02 20:01:36

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

That's a completely different package, why would you install urxvt from the repos as well?

Offline

#11 2025-08-03 08:26:34

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

I don't remember doing that, but I did install the result package from makepkg with pacman -U.

Offline

#12 2025-08-03 11:19:49

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

The package gets overwritten when there's an update

pacman -Qi rxvt-unicode

Offline

#13 2025-08-06 17:40:22

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

seth wrote:

The package gets overwritten when there's an update

pacman -Qi rxvt-unicode

You are right, its installed. Is it recognized as the same package, even if I added the extra patches on the PKGBUILD?

In any case, I have reviewed it again and I think I will remove it and just rebuild using the src code, no packages involved.

Offline

#14 2025-08-06 18:49:55

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [Solved] Custom package with patches replaced by pacman

I'd rather keep installing your patched version through a package (ie. build the local package w/ you local patches and install that but keep the repo version uninstalled)
In doubt just adjust the package name in the PKGBUILD

Offline

#15 2025-08-06 19:41:58

GerBra
Forum Fellow
From: Bingen/Germany
Registered: 2007-05-10
Posts: 239

Re: [Solved] Custom package with patches replaced by pacman

twfox wrote:

In any case, I have reviewed it again and I think I will remove it and just rebuild using the src code, no packages involved.

You could also go this way:
- Keep building/managing YOUR rxvt-unicode Package with PKGBUILD/makepkg
- Add  rxvt-unicode to pacman.conf->IgnorePkg

As rxvt-unicode (YOUR package) is installed on pacman's sight it would now NOT get upgraded if there is a newer version in extra/rxvt-unicode (cause it is ignored).
But you get a hint during pacman -Syu that a newer version is available, but ignored to update.
This give you a good advise to maybe check the reason for a newer version (Upstream, other patches, ABI), , so you could think about modifying/rebuilding also YOUR package/PKGBUILD (//edit and your pkgver/pkgrel to keep in sync with extra repo)

Last edited by GerBra (2025-08-06 19:48:47)

Offline

#16 2025-08-06 21:58:53

tekstryder
Member
Registered: 2013-02-14
Posts: 468

Re: [Solved] Custom package with patches replaced by pacman

twfox wrote:

I think I will remove it and just rebuild using the src code, no packages involved.

Let pacman handle things. You'll forget something eventually and it'll bite you.

seth wrote:

I'd rather keep installing your patched version through a package

Indeed, do this rather.

GerBra wrote:

- Add  rxvt-unicode to pacman.conf->IgnorePkg

@GerBra raises good points about advisory, but ignoring packages can also lead to trouble long-term when you miss a required rebuild.

Easiest, IMO, is to simply increment the (pkgrel) + (.1) over the current Arch pkgrel.

With this you know when Arch rebuilds occur (and for what reason via git) AND when newer upstream versions are packaged.

E.g. my currently short list of such packages:

warning: hyprland: local (0.50.1-1.1) is newer than extra (0.50.1-1)
warning: libnautilus-extension: local (48.3-1.1) is newer than extra (48.3-1)
warning: nautilus: local (48.3-1.1) is newer than extra (48.3-1)
warning: nvidia-dkms: local (580.65.06-1) is newer than extra (575.64.05-2)
warning: nvidia-utils: local (580.65.06-1) is newer than extra (575.64.05-2)
warning: sway: local (1:1.11-1.1) is newer than extra (1:1.11-1)
warning: vulkan-tools: local (1.4.323-1) is newer than extra (1.4.321.0-1)
warning: wlroots0.19: local (0.19.0-1.1) is newer than extra (0.19.0-1)

Offline

#17 2025-08-08 16:59:26

twfox
Member
Registered: 2025-07-07
Posts: 8

Re: [Solved] Custom package with patches replaced by pacman

I've added IgnorePkg in pacman and tweaked the PKGBUILD to increase pkgrel.

Looking good!

Thanks.

Offline

Board footer

Powered by FluxBB