How does pamac know what build environment to install for an AUR package?

I use pamac to install a few AUR packages. The packages required to compile the AUR package appear in the output of pamac list --orphan. I’d like to understand better how pamac knew to install these packages.

Who or what told pamac that these packages (m4, bison, autoconf, etc) were required to build this specific package?

For example, I looked at the PKGBUILD and github for upd72020x-fw and I didn’t see anything that specifically mentioned how to build. Please note the versions below might not be current because I grepped installation logs that I maintain.

Checking upd72020x-fw dependencies...
Resolving dependencies...
Checking inter-conflicts...
To install (9):
  m4            1.4.19-1                         core   264.5 kB
  autoconf      2.71-1                           core   660.7 kB
  pkgconf       1.8.0-1                          core   59.0 kB
  flex          2.6.4-3                          core   304.4 kB
  guile         2.2.7-2     (Required By: make)  extra  6.6 MB
  make          4.3-3                            core   493.2 kB
  bison         3.8.2-1                          core   803.5 kB
  patch         2.7.6-8                          core   94.7 kB
  automake      1.16.5-1                         core   627.5 kB
To build (1):
  upd72020x-fw  20200826-3                       AUR

The “To install” list are all packages from the base-devel package group, so when you tell it to build an AUR package it will always check if the packages in that group is installed or not and if some are missing it will install them.

base-devel is a package group in Arch based distributions, which is always assumed installed when you build your own packages.

https://wiki.archlinux.org/title/Arch_User_Repository#Prerequisites

1 Like

Yes, all this PKGBUILD does is copy 3 files.