#1077495 amarok FTCBFS: pkgconf-based mariadb detection is broken

Package:
src:amarok
Source:
src:amarok
Submitter:
Helmut Grohne
Date:
2024-07-29 12:27:45 UTC
Severity:
normal
Tags:
#1077495#5
Date:
2024-07-29 10:03:09 UTC
From:
To:
amarok fails to cross build from source, because it fails to detect
mariadb. It actually has two methods for detecting mariadb. It first
tries mariadb_config and then also tries pkgconf. The former method is
unfixably broken for cross compilation, because mariadb_config is an ELF
executable and it either cannot be run or reports results for the wrong
architecture. The native build successfully uses mariadb_config. For
cross compilation, the only reasonable way is using pkgconf. While the
package is correctly detected, the fallback mechanism is subtly broken
as it expects a cmake variable MYSQL_LIBRARIES to be set, but that
variable (unlike MYSQL_INCLUDE_DIR and MySQL_VERSION_STRING) is only set
by the mariadb_config and considered required producing the failure. I'm
attaching a patch that also initialized MYSQL_LIBRARIES from pkgconf
when available. After applying it, cross building amarok works. I
suggest forwarding the patch upstream as it will also help other
distributions such as Yocto or PtxDist but have not done so myself.

Helmut