Modifying the Makepkg configuration

According to Wiki the way to modify runtime behaviour of makepkg is to put key-value parameters in a file /etc/makepkg.conf.d/ or in the file $HOME/.makepkg.conf or$HOME/.config/pacman/makepkg.conf.d For this I have the following queries

  1. If I were to put in a modified /etc/makepkg.conf.d/makepkg.conf file, different values for CFLAGS, CARCH and other flags than the file /etc/makepkg.conf, then will variables with the changes in /etc/makepkg.conf.d/makepkg.conf overwrite whatever values are provided in /etc/makepkg.conf?

  2. According to the manual page of makepkg.conf the path $HOME/.config/pacman/makepkg.conf.d takes priority over $HOME/.makepkg.conf. So for a desktop system what would be preferred? Putting the changed values inside $HOME/.config/pacman/makepkg.conf.d or /etc/makepkg.conf.d/makepkg.conf?

  3. If I were to set the value of CFLAGS as ‘’-march=x86-64-v4 …" or “-march=x86-64-v3 …” then will it work for all the packages installed from Arch repositories as well as AUR using pacman/yay?

Yes, the changes in /etc/makepkg.conf.d/ override the changes in /etc/makepkg.conf

Whenever a tool provides drop-ins, it is generally preferred to use them. So adding files to /etc/makepkg.conf.d.

However, you wouldn’t generally put a file called makepkg.conf in there, you would put files in there that describe your changes. So you might add a cflags.conf in your example. You can have more than one file in that directory.

No, only packages from AUR that are built from source. The packages in the repos are already prebuilt so your build options will not affect them.

1 Like