mysql-connector fails to build if either CFLAGS or CXXFLAGS are unset in a misleading way throwing CMake Error at CMakeLists.txt:879 (STRING): STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to command. CMake Error at CMakeLists.txt:881 (STRING): STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to command. Reproducible: Always I suggest to add a direct check weather CFLAGS/CXXFLAGS are empty before proceeding with configure and if they are - throw a meaningful message like CFLAGS are empty, please configure CFLAGS/CXXFLAGS
I can confirm this REGEX problem with arm64, more specifically with 8.0.32-r1 ebuild. I fixed it by replacing STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) with STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") STRING(REGEX REPLACE "-specs=/usr/lib/rpm/redhat/.*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") Please note the added "". I hope someone benefit from this. Seeya.
I have edited the file: /var/tmp/portage/dev-db/mysql-connector-c-8.0.32-r1/work/mysql-8.0.32/CMakeLists.txt
Some websites that may help someone: https://forums.gentoo.org/viewtopic-t-1113956-start-0.html https://forums.gentoo.org/viewtopic-t-1118822-start-0.html
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65e810c9b1123f6c07d92328dfdf1e60498bc392 commit 65e810c9b1123f6c07d92328dfdf1e60498bc392 Author: Tomáš Mózes <hydrapolic@gmail.com> AuthorDate: 2024-04-08 14:37:50 +0000 Commit: Petr Vaněk <arkamar@gentoo.org> CommitDate: 2024-04-27 12:53:24 +0000 dev-db/mysql-connector-c: add 8.0.36 Changes: - musl patch upstreamed, see [1-3] - mysql.info not present any more, see [4] - lz4 patch updated [1] https://github.com/mysql/mysql-server/commit/dc6b9e2556bf247cda80670b824cb24b271946f2 [2] https://bugs.mysql.com/bug.php?id=110808 [3] https://github.com/mysql/mysql-server/pull/455 [4] https://github.com/mysql/mysql-server/commit/18b2dd3ddfbe06bef9a378f1a87e63d494514b0b Closes: https://bugs.gentoo.org/893912 Closes: https://bugs.gentoo.org/900667 Closes: https://bugs.gentoo.org/759058 Closes: https://bugs.gentoo.org/882743 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/36160 Signed-off-by: Petr Vaněk <arkamar@gentoo.org> dev-db/mysql-connector-c/Manifest | 1 + ...-8.0.36-always-build-decompress-utilities.patch | 23 ++++ .../mysql-connector-c-8.0.36.ebuild | 123 +++++++++++++++++++++ 3 files changed, 147 insertions(+)