@@ -439,3 +439,81 @@ Skip review for this repository.
439439.B GenerateSrcinfo
440440Force regeneration of the .SRCINFO file even if it exists on disk. This is useful for
441441repositories that forget to update their .SRCINFO files.
442+
443+ .SH PER-PACKAGE BUILD OVERRIDES
444+ Per-package build overrides allow customizing build settings for specific packages.
445+ There are two types of override sections: package overrides and group overrides.
446+
447+ Package overrides always take precedence over group overrides. When multiple group
448+ overrides apply to the same package, later groups in the config file merge over
449+ earlier ones, with conflicting keys being overwritten.
450+
451+ .SS PACKAGE OVERRIDES
452+
453+ A package override section targets a single package by name:
454+
455+ .RS
456+ \fB [override.package. \fR\fI pkgname \fR\fB ] \fR
457+ .RE
458+
459+ .TP
460+ .B MakepkgConf = /path/to/makepkg.conf
461+ Use a different makepkg.conf for building this package. This overrides the global
462+ MakepkgConf option for this package only.
463+
464+ .TP
465+ .B Overrides = { KEY = value, KEY2 = "value2" }
466+ Set environment variables for building this package. Values may optionally be
467+ quoted with double quotes. Multiple key-value pairs are separated by commas.
468+
469+ .SS GROUP OVERRIDES
470+
471+ A group override section applies the same settings to multiple packages:
472+
473+ .RS
474+ \fB [override.group. \fR\fI groupname \fR\fB ] \fR
475+ .RE
476+
477+ .TP
478+ .B Packages = pkg1 pkg2 pkg3
479+ Space-separated list of package names this group applies to. This directive is
480+ required for group overrides.
481+
482+ .TP
483+ .B MakepkgConf = /path/to/makepkg.conf
484+ Same as the package override equivalent.
485+
486+ .TP
487+ .B Overrides = { KEY = value, KEY2 = "value2" }
488+ Same as the package override equivalent.
489+
490+ .SS EXAMPLES
491+
492+ Use a custom makepkg.conf for a specific package:
493+
494+ .RS
495+ .nf
496+ [override.package.firefox]
497+ MakepkgConf = /etc/makepkg-pgo.conf
498+ .fi
499+ .RE
500+
501+ Set custom compiler flags for a group of packages:
502+
503+ .RS
504+ .nf
505+ [override.group.lto-builds]
506+ Packages = mesa vulkan-radeon
507+ MakepkgConf = /etc/makepkg-lto.conf
508+ Overrides = { MAKEFLAGS = "-j$(nproc)", CFLAGS = "-O3 -march=native" }
509+ .fi
510+ .RE
511+
512+ Override environment variables for a single package:
513+
514+ .RS
515+ .nf
516+ [override.package.linux-zen]
517+ Overrides = { MAKEFLAGS = "-j4", CARGO_BUILD_JOBS = "4" }
518+ .fi
519+ .RE
0 commit comments