FS#69488 - PKGBUILD processing. CFLAGS, CXXFLAGS and LDFLAGS aren't exported during `prepare()`
Attached to Project:
Pacman
Opened by Alex (hurufu) - Sunday, 31 January 2021, 16:10 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 31 January 2021, 16:32 GMT
Opened by Alex (hurufu) - Sunday, 31 January 2021, 16:10 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 31 January 2021, 16:32 GMT
|
Details
Build customization variables that are defined in
/etc/makepkg.conf, like CXXFLAGS aren't exported during
prepare() phase.
The problem is actually visible for most CMake projects. If you wish to use custom CXXFLAGS then this variable should be available during first run of cmake: https://cmake.org/cmake/help/latest/envvar/CXXFLAGS.html, but it's absent during prepare() - the most obvious place for cmake invocation. So, imho in order to fix this either all cmake invocations for all projects should be moved to build() function or makepkg should export *FLAGS variables during prepare(). Steps to reproduce: 0. Make sure that CFLAGS and friends are defined in /etc/makepkg.conf 1. Download minimal PKGBUILD from the attachments 2. Run `makepkg` 3. Observe output: package() fails because *FLAGS variables are absent Additional info: * makepkg version v5.2.2 |
This task depends upon
Closed by Eli Schwartz (eschwartz)
Sunday, 31 January 2021, 16:32 GMT
Reason for closing: Not a bug
Additional comments about closing: Intentional
Sunday, 31 January 2021, 16:32 GMT
Reason for closing: Not a bug
Additional comments about closing: Intentional
PKGBUILD
FS#69040prepare() is explicitly intended for post-auto-extraction setup of the source directory e.g. applying patches ONLY.
It MUST NOT be used for running ./configure or cmake or meson -- as, indeed, the official repo packages do not do.