![]() ![]() Building optimized binariesĪ performance improvement of the packaged software can be achieved by enabling compiler optimizations for the host machine. This was discussed many times already, like here. depth=1), but in fact it will break pkgver() in VCS packages and more. Some people also propose to use shallow clone (e.g. PKGBUILDs may utilize git in unpredictable ways, relying on current Makepkg defaults. Warning: Be aware that any change in git flags may introduce breakage. You can pass it to makepkg using GITFLAGS variable. Git -filter=tree:0 flag allows to update the source tree only on demand. The other possibility for a considerable speedup is to use partial clone. Make use of SRCDEST, especially when building VCS packages, to save time acquiring and unpacking sources in subsequent rebuilds. Tips and tricks Reduce source download and extraction times Defining the sources location It prevents obsolete and remnant files from carrying over to the new builds: This is useful for multiple builds of the same package or updating the package version, while using the same build directory. To clean up leftover files and directories, such as files extracted to the $srcdir, add the option -c/ -clean. To install, use -i/ -install (same as pacman -U pkgname- ): Once all dependencies are satisfied and the package builds successfully, a package file ( pkgname- ) will be created in the working directory. Only global values are used when installing dependencies, i.e any override done in a split package's packaging function will not be used.Alternatively, one can manually install dependencies prior to building ( pacman -S -asdeps dep1 dep2). These dependencies must be available in the configured repositories see pacman#Repositories and mirrors for details.If constantly building packages, consider using Pacman/Tips and tricks#Removing unused packages (orphans) once in a while instead. To build the package and install needed dependencies, add the flag -s/ -syncdeps:Īdding the -r/ -rmdeps flag causes makepkg to remove the make dependencies later, which are no longer needed. If required dependencies are missing, makepkg will issue a warning before failing. Once in possession of a PKGBUILD, change to the directory where it is saved and run the following command to build the package: ![]() Existing scripts are available from the Arch build system (ABS) tree or the AUR. To build a package, one must first create a PKGBUILD, or build script, as described in Creating packages. Users who have no access to a regular user account should run makepkg as the nobody user. Besides how a PKGBUILD may contain arbitrary commands, building as root is generally considered unsafe. Running makepkg itself as root is disallowed.Make sure sudo is configured properly for commands passed to pacman.SRCPKGDEST - directory for storing resulting source packages (built with makepkg -S).SRCDEST - directory for storing source data (symbolic links will be placed to src/ if it points elsewhere).PKGDEST - directory for storing resulting packages.Custom paths can be configured, for example to keep all built packages in ~/build/packages/ and all sources in ~/build/sources/.Ĭonfigure the following nf variables if needed: To automatically produce signed packages, also set the GPGKEY variable in nf.īy default, makepkg creates the package tarballs in the working directory and downloads source data directly to the src/ directory. This can be done by setting the PACKAGER variable in nf. If multiple users will be compiling packages on a system, or if one is otherwise distributing packages to other users, it is convenient to provide real contact. By default, user-compiled packages are marked with Unknown Packager. It is recommended to review the configuration prior to building packages.Įach package is tagged with metadata identifying amongst others also the packager. The system configuration is available in /etc/nf, but user-specific changes can be made in $XDG_CONFIG_HOME/pacman/nf or ~/.nf. ![]() See nf(5) for details on configuration options for makepkg. Makepkg is provided by the pacman package. The requirements for using the script are a build-capable Unix platform and a PKGBUILD. Makepkg is a script to automate the building of packages. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |