1MAKEPKG.CONF(5)                  Pacman Manual                 MAKEPKG.CONF(5)
2
3
4

NAME

6       makepkg.conf - makepkg configuration file
7

SYNOPSIS

9       /etc/makepkg.conf, $XDG_CONFIG_HOME/pacman/makepkg.conf,
10       ~/.makepkg.conf
11

DESCRIPTION

13       Configuration options for makepkg are stored in makepkg.conf. This file
14       is sourced so you can include any special compiler flags you wish to
15       use. This is helpful when building for different architectures or with
16       different optimizations. However, only the variables described below
17       are exported to the build environment.
18
19           Note
20           This does not guarantee that all package Makefiles will use your
21           exported variables. Some of them are non-standard.
22
23       The system-wide configuration file is found in /etc/makepkg.conf.
24       Individual options can be overridden (or added to) on a per-user basis
25       in $XDG_CONFIG_HOME/pacman/makepkg.conf or ~/.makepkg.conf, with the
26       former taking priority.
27
28       The default file is fairly well commented, so it may be easiest to
29       simply follow directions given there for customization.
30

OPTIONS

32       DLAGENTS=('protocol::/path/to/command [options]' ...)
33           Sets the download agents used to fetch source files specified with
34           a URL in the PKGBUILD(5) file. Options can be specified for each
35           command as well, and any protocol can have a download agent. Any
36           spaces in option arguments are required to be escaped to avoid
37           being split. Several examples are provided in the default
38           makepkg.conf.
39
40           If present, %u will be replaced with the download URL. Otherwise,
41           the download URL will be placed on the end of the command. If
42           present, %o will be replaced with the local file name, plus a
43           “.part” extension, which allows makepkg to handle resuming file
44           downloads.
45
46       VCSCLIENTS=('protocol::package' ...)
47           Sets the packages required to fetch version controlled source
48           files. When required, makepkg will check that these packages are
49           installed or are included in the depends or makedepends arrays in
50           the PKGBUILD.
51
52       CARCH="carch"
53           Specifies your computer architecture; possible values include such
54           things as “i686”, “x86_64”, “ppc”, etc. This should be
55           automatically set on installation.
56
57       CHOST="chost"
58           A string such as “i686-pc-linux-gnu”; do not touch this unless you
59           know what you are doing. This can be commented out by most users if
60           desired.
61
62       CPPFLAGS="cppflags"
63           Flags used for the C preprocessor; see CFLAGS for more information.
64
65       CFLAGS="cflags"
66           Flags used for the C compiler. This is a key part to the use of
67           makepkg. Usually several options are specified, and the most common
68           string resembles something like this: “-march=i686 -O2 -pipe”.
69           Another useful option may be -mcpu in place of -march. Read gcc(1)
70           for more details on the wide variety of compiler flags available.
71
72       CXXFLAGS="cxxflags"
73           Flags used for the C++ compiler; see CFLAGS for more info.
74
75       RUSTFLAGS="rustflags"
76           Flags used for the Rust compiler, similar in spirit to CFLAGS. Read
77           rustc(1) for more details on the available flags.
78
79       LDFLAGS="ldflags"
80           Flags used for the linker. Several options may be specified with
81           common usage resembling “-Wl,--hash-style=gnu”. Read ld(1) for more
82           details on available linker flags.
83
84       MAKEFLAGS="makeflags"
85           This is often used to set the number of jobs used; for example,
86           -j2. Other flags that make accepts can also be passed.
87
88       DEBUG_CFLAGS="debug_cflags"
89           Additional compiler flags appended to CFLAGS for use in debugging.
90           Usually this would include: “-g”. Read gcc(1) for more details on
91           the wide variety of compiler flags available.
92
93       DEBUG_CXXFLAGS="debug_cxxflags"
94           Debug flags used for the C++ compiler; see DEBUG_CFLAGS for more
95           info.
96
97       DEBUG_RUSTFLAGS="debug_rustflags"
98           Additional compiler flags appended to RUSTFLAGS for use in
99           debugging. Usually this would include: “-C debuginfo=2”. Read
100           rustc(1) for more details on the available flags.
101
102       BUILDENV=(!distcc !color !ccache check !sign)
103           This array contains options that affect the build environment; the
104           defaults are shown here. All options should always be left in the
105           array; to enable or disable an option, simply remove or add an “!”
106           at the front of the option. If an option is specified multiple
107           times, the final value takes precedence. Each option works as
108           follows:
109
110           distcc
111               Use the distributed C/C++/ObjC compiler to spread compilation
112               among multiple machines. If this is enabled, DISTCC_HOSTS must
113               be specified as well.
114
115           color
116               Colorize output messages, making output easier to read.
117
118           ccache
119               Use ccache to cache compilation by default. This allows for
120               faster compiles if you are continuously recompiling the same
121               packages. It can be disabled for individual packages by placing
122               !ccache in the PKGBUILD options array.
123
124           check
125               Run the check() function if present in the PKGBUILD. This can
126               be enabled or disabled for individual packages through the use
127               of makepkg’s --check and --nocheck options, respectively.
128
129           sign
130               Generate a PGP signature file using GnuPG. This will execute
131               gpg --detach-sign --use-agent on the built package to generate
132               a detached signature file, using the GPG agent, if it is
133               available. The signature file will be the entire file name of
134               the package with a “.sig” extension.
135
136       DISTCC_HOSTS="host1 ..."
137           If using DistCC, this is used to specify a space-delimited list of
138           hosts running in the DistCC cluster. In addition, you will want to
139           modify your MAKEFLAGS.
140
141       BUILDDIR="/path/to/directory"
142           If this value is not set, packages will, by default, be built in
143           subdirectories of the directory that makepkg is called from. This
144           option allows setting the build location to another directory.
145           Incorrect use of $startdir in a PKGBUILD may cause building with
146           this option to fail.
147
148       GPGKEY=""
149           Specify a key to use for GPG signing instead of the default key in
150           the keyring. Can be overridden with makepkg’s --key option.
151
152       OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge
153       !debug)
154           This array contains options that affect default packaging. They are
155           equivalent to options that can be placed in the PKGBUILD; the
156           defaults are shown here. All options should always be left in the
157           array; to enable or disable an option, simply remove or add an “!”
158           at the front of the option. If an option is specified multiple
159           times, the final value takes precedence. Each option works as
160           follows:
161
162           strip
163               Strip symbols from binaries and libraries. If you frequently
164               use a debugger on programs or libraries, it may be helpful to
165               disable this option.
166
167           docs
168               Save doc directories. If you wish to delete doc directories,
169               specify !docs in the array. The directories affected are
170               specified by the DOC_DIRS variable.
171
172           libtool
173               Leave libtool (.la) files in packages. Specify !libtool to
174               remove them.
175
176           staticlibs
177               Leave static library (.a) files in packages. Specify
178               !staticlibs to remove them, if they have a shared counterpart.
179
180           emptydirs
181               Leave empty directories in packages.
182
183           zipman
184               Compress manual (man and info) pages with gzip. The directories
185               affected are specified by the MAN_DIRS variable.
186
187           purge
188               Remove files specified by the PURGE_TARGETS variable from the
189               package.
190
191           debug
192               Add the user-specified debug flags as specified in DEBUG_CFLAGS
193               and DEBUG_CXXFLAGS to their counterpart buildflags. Creates a
194               separate package containing the debug symbols when used with
195               ‘strip’.
196
197           lto
198               Enable building packages using link time optimization. Adds
199               -flto to both CFLAGS and CXXFLAGS.
200
201       INTEGRITY_CHECK=(check1 ...)
202           File integrity checks to use. Multiple checks may be specified;
203           this affects both generation and checking. The current valid
204           options are: ck, md5, sha1, sha224, sha256, sha384, sha512, and b2.
205
206       STRIP_BINARIES="--strip-all"
207           Options to be used when stripping binaries. See strip(1) for
208           details.
209
210       STRIP_SHARED="--strip-unneeded"
211           Options to be used when stripping shared libraries or PIE
212           executables. See strip(1) for details.
213
214       STRIP_STATIC="--strip-debug"
215           Options to be used when stripping static libraries. See strip(1)
216           for details.
217
218       MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info} ...)
219           If zipman is specified in the OPTIONS array, this variable will
220           instruct makepkg where to look to compress manual (man and info)
221           pages. If you build packages that are located in opt/, you may need
222           to add the directory to this array.  NOTE: Do not add the leading
223           slash to the directory name.
224
225       DOC_DIRS=(usr/{,share/}{doc,gtk-doc} ...)
226           If !docs is specified in the OPTIONS array, this variable will
227           instruct makepkg where to look to remove docs. If you build
228           packages that are located in opt/, you may need to add the
229           directory to this array.  NOTE: Do not add the leading slash to the
230           directory name.
231
232       PURGE_TARGETS=(usr/{,share}/info/dir .podlist *.pod...)
233           If purge is specified in the OPTIONS array, this variable will
234           instruct makepkg which files to remove from the package. This is
235           useful for index files that are added by multiple packages.
236
237       DBGSRCDIR="/usr/src/debug"
238           If strip and debug are specified in the OPTIONS array, this
239           variable will instruct makepkg where to place source files for
240           installed binaries. The binaries will be modified to link this
241           directory for the debugger search path.
242
243       PKGDEST="/path/to/directory"
244           If this value is not set, packages will, by default, be placed in
245           the current directory (location of the PKGBUILD(5)). Many people
246           like to keep all their packages in one place so this option allows
247           for this behavior. A common location is “/home/packages”.
248
249       SRCDEST="/path/to/directory"
250           If this value is not set, downloaded source files will only be
251           stored in the current directory. Many people like to keep all
252           source files in a central location for easy cleanup, so this path
253           can be set here.
254
255       SRCPKGDEST="/path/to/directory"
256           If this value is not set, source package files will be stored in in
257           the current directory. Many people like to keep all source package
258           files in a central location for easy cleanup, so this path can be
259           set here.
260
261       LOGDEST="/path/to/directory"
262           If this value is not set, log files are written to the current
263           directory. This centralizes the log location, facilitating cleanup
264           and compression.
265
266       PACKAGER="John Doe <john@example.com>"
267           This value is used when querying a package to see who was the
268           builder. The given format is required for PGP key lookup through
269           WKD. It is recommended to change this to your name and email
270           address.
271
272       COMPRESSGZ="(gzip -c -f -n)", COMPRESSBZ2="(bzip2 -c -f)",
273       COMPRESSXZ="(xz -c -z -)", COMPRESSZST="(zstd -c -z -)",
274       COMPRESSLZO"(lzop -q)", COMPRESSLRZ="(lrzip -q)", COMPRESSLZ4="(lz4
275       -q)", COMPRESSZ="(compress -c -f)", COMPRESSLZ="(lzip -c -f)"
276           Sets the command and options used when compressing compiled or
277           source packages in the named format.
278
279       PKGEXT=".pkg.tar.gz", SRCEXT=".src.tar.gz"
280           Sets the compression used when making compiled or source packages.
281           Valid suffixes are .tar.gz, .tar.bz2, .tar.xz, .tar.zst, .tar.lzo,
282           .tar.lrz, .tar.lz4, .tar.lz and .tar.Z, or simply .tar to disable
283           compression entirely.
284
285       PACMAN_AUTH=()
286           Specify a command prefix for running pacman as root. If unset,
287           makepkg will check for the presence of sudo(8) and su(1) in turn,
288           and try the first one it finds.
289
290           If present, %c will be replaced with the shell-quoted form of the
291           command to run. Otherwise, the command to run is appended to the
292           auth command.
293

SEE ALSO

295       makepkg(8), pacman(8), PKGBUILD(5)
296
297       See the pacman website at https://archlinux.org/pacman/ for current
298       information on pacman and its related tools.
299

BUGS

301       Bugs? You must be kidding; there are no bugs in this software. But if
302       we happen to be wrong, submit a bug report with as much detail as
303       possible at the Arch Linux Bug Tracker in the Pacman section.
304

AUTHORS

306       Current maintainers:
307
308       •   Allan McRae <allan@archlinux.org>
309
310       •   Andrew Gregory <andrew.gregory.8@gmail.com>
311
312       •   Eli Schwartz <eschwartz@archlinux.org>
313
314       •   Morgan Adamiec <morganamilo@archlinux.org>
315
316       Past major contributors:
317
318       •   Judd Vinet <jvinet@zeroflux.org>
319
320       •   Aurelien Foret <aurelien@archlinux.org>
321
322       •   Aaron Griffin <aaron@archlinux.org>
323
324       •   Dan McGee <dan@archlinux.org>
325
326       •   Xavier Chantry <shiningxc@gmail.com>
327
328       •   Nagy Gabor <ngaba@bibl.u-szeged.hu>
329
330       •   Dave Reisner <dreisner@archlinux.org>
331
332       For additional contributors, use git shortlog -s on the pacman.git
333       repository.
334
335
336
337Pacman 6.0.1                      2022-01-20                   MAKEPKG.CONF(5)
Impressum