I think that if i can control what build options will be, i think i can solve mysql build issue. for example, i can only enable mysql support and disabling other backend supports and then it builds fine with mysql support.
Makefile:
.if empty(PORT_OPTIONS:MSQLITE3) && empty(PORT_OPTIONS:MMYSQL80) && \
!empty(PORT_OPTIONS:MPGSQL16)
USES+= pgsql
LIB_DEPENDS+= libpq.so:databases/postgresql16-client
CMAKE_ARGS+= -DBUILD_SQLITE=OFF -DBUILD_MYSQL=OFF
.endif
.if empty(PORT_OPTIONS:MPGSQL16) && empty(PORT_OPTIONS:MMYSQL80) && \
!empty(PORT_OPTIONS:MSQLITE3)
USES+= sqlite
LIB_DEPENDS+= libsqlite3.so:databases/sqlite3
CMAKE_ARGS+= -DBUILD_POSTGRESQL=OFF -DBUILD_MYSQL=OFF
.endif
.if empty(PORT_OPTIONS:MSQLITE3) && empty(PORT_OPTIONS:MPGSQL16) && \
!empty(PORT_OPTIONS:MMYSQL80)
USES+= mysql
LIB_DEPENDS+= libmysqlclient.so:databases/mysql80-client
CMAKE_ARGS+= -DBUILD_SQLITE=OFF -DBUILD_POSTGRESQL=OFF
.endif
Here is table of build options from upstream CMakeLists.txt.
Code:
include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(BUILD_POSTGRESQL "Build with postgresql support" ON "BUILD_ORM" OFF)
CMAKE_DEPENDENT_OPTION(LIBPQ_BATCH_MODE "Use batch mode for libpq" ON "BUILD_POSTGRESQL" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_MYSQL "Build with mysql support" ON "BUILD_ORM" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_SQLITE "Build with sqlite3 support" ON "BUILD_ORM" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_REDIS "Build with redis support" ON "BUILD_ORM" OFF)
CMAKE_DEPENDENT_OPTION(USE_SPDLOG "Allow using the spdlog logging library" OFF "USE_SUBMODULE" OFF)
Update: Added new options
My own ports overlay for FreeBSD . Contribute to nxjosephofficial/yusuf-ports-overlay development by creating an account on GitHub.
github.com