summaryrefslogtreecommitdiff
path: root/databases/mysql-connector-odbc
diff options
context:
space:
mode:
Diffstat (limited to 'databases/mysql-connector-odbc')
-rw-r--r--databases/mysql-connector-odbc/Makefile49
-rw-r--r--databases/mysql-connector-odbc/distinfo3
-rw-r--r--databases/mysql-connector-odbc/files/patch-driver_dll.cc11
-rw-r--r--databases/mysql-connector-odbc/files/patch-include_mysql-8.0_my__sys.h24
-rw-r--r--databases/mysql-connector-odbc/pkg-descr1
-rw-r--r--databases/mysql-connector-odbc/pkg-plist51
6 files changed, 139 insertions, 0 deletions
diff --git a/databases/mysql-connector-odbc/Makefile b/databases/mysql-connector-odbc/Makefile
new file mode 100644
index 000000000000..e78c38cc2edb
--- /dev/null
+++ b/databases/mysql-connector-odbc/Makefile
@@ -0,0 +1,49 @@
+PORTNAME= mysql-connector-odbc
+DISTVERSION= 9.4.0
+CATEGORIES= databases
+MASTER_SITES= MYSQL/Connector-ODBC/9.0
+DISTNAME= ${PORTNAME}-${DISTVERSION}-src
+
+MAINTAINER= bofh@FreeBSD.org
+COMMENT= ODBC driver for MySQL
+WWW= https://www.mysql.com/
+
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+LIB_DEPENDS= libunwind.so:devel/libunwind \
+ libzstd.so:archivers/zstd
+.if ${FLAVOR:U} == unixodbc
+LIB_DEPENDS+= libodbc.so:databases/unixODBC
+.elif ${FLAVOR:U} == iodbc
+LIB_DEPENDS+= libiodbc.so:databases/libiodbc
+.endif
+
+FLAVORS= unixodbc iodbc
+FLAVOR?= ${FLAVORS:[1]}
+iodbc_PKGNAMESUFFIX= -iodbc
+unixodbc_PKGNAMESUFFIX= -unixodbc
+
+USES= cmake localbase:ldflags mysql ssl
+USE_GCC= yes
+USE_LDCONFIG= yes
+
+CMAKE_ARGS= -DINSTALL_DOCDIR=${DOCSDIR} \
+ -DINSTALL_TESTDIR=${DATADIR}/test
+CMAKE_ON= DISABLE_GUI
+.if ${FLAVOR:U} == unixodbc
+CMAKE_ON+= WITH_UNIXODBC
+.elif ${FLAVOR:U} == iodbc
+CMAKE_OFF+= WITH_UNIXODBC
+CMAKE_ARGS+= -DODBC_INCLUDES=${PREFIX}/include/libiodbc
+.endif
+
+LDFLAGS+= -lexecinfo
+
+OPTIONS_DEFINE= DOCS
+
+post-install:
+ @${RM} ${STAGEDIR}${DOCSDIR}/INFO_BIN
+ @${RM} ${STAGEDIR}${DOCSDIR}/INFO_SRC
+
+.include <bsd.port.mk>
diff --git a/databases/mysql-connector-odbc/distinfo b/databases/mysql-connector-odbc/distinfo
new file mode 100644
index 000000000000..8d7fe7f69108
--- /dev/null
+++ b/databases/mysql-connector-odbc/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1753569340
+SHA256 (mysql-connector-odbc-9.4.0-src.tar.gz) = 67a7ddae7303fda95903f374286316a9e2e19b6181eb2badbb280ef70f779bd9
+SIZE (mysql-connector-odbc-9.4.0-src.tar.gz) = 3986982
diff --git a/databases/mysql-connector-odbc/files/patch-driver_dll.cc b/databases/mysql-connector-odbc/files/patch-driver_dll.cc
new file mode 100644
index 000000000000..402d1b423879
--- /dev/null
+++ b/databases/mysql-connector-odbc/files/patch-driver_dll.cc
@@ -0,0 +1,11 @@
+--- driver/dll.cc.orig 2025-06-19 12:19:21 UTC
++++ driver/dll.cc
+@@ -144,7 +144,7 @@ void myodbc_end()
+ This eliminates the delay when mysys_end() is called and other threads
+ have been initialized but not ended.
+ */
+- my_thread_end_wait_time= 0;
++ static uint my_thread_end_wait_time= 0;
+ #endif
+ /*
+ When driver is unloaded the plugin pool must be cleared.
diff --git a/databases/mysql-connector-odbc/files/patch-include_mysql-8.0_my__sys.h b/databases/mysql-connector-odbc/files/patch-include_mysql-8.0_my__sys.h
new file mode 100644
index 000000000000..265c31628422
--- /dev/null
+++ b/databases/mysql-connector-odbc/files/patch-include_mysql-8.0_my__sys.h
@@ -0,0 +1,24 @@
+--- include/mysql-8.0/my_sys.h.orig 2025-06-19 12:19:21 UTC
++++ include/mysql-8.0/my_sys.h
+@@ -41,8 +41,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ #include "my_config.h"
+
+ #ifdef HAVE_ALLOCA_H
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
++#include <stdlib.h>
++#else
+ #include <alloca.h>
+ #endif
++#endif
+ #include <limits.h>
+ #ifdef _WIN32
+ #include <malloc.h>
+@@ -332,6 +336,8 @@ typedef int (*IO_CACHE_CALLBACK)(IO_CACHE *);
+
+ struct IO_CACHE;
+ typedef int (*IO_CACHE_CALLBACK)(IO_CACHE *);
++
++typedef unsigned long ulong;
+
+ struct IO_CACHE_SHARE {
+ mysql_mutex_t mutex; /* To sync on reads into buffer. */
diff --git a/databases/mysql-connector-odbc/pkg-descr b/databases/mysql-connector-odbc/pkg-descr
new file mode 100644
index 000000000000..0441dd6a5d7f
--- /dev/null
+++ b/databases/mysql-connector-odbc/pkg-descr
@@ -0,0 +1 @@
+MySQL Connector ODBC is an ODBC driver for interfacing to MySQL databases.
diff --git a/databases/mysql-connector-odbc/pkg-plist b/databases/mysql-connector-odbc/pkg-plist
new file mode 100644
index 000000000000..895ec74fbd0d
--- /dev/null
+++ b/databases/mysql-connector-odbc/pkg-plist
@@ -0,0 +1,51 @@
+bin/myodbc-installer
+lib/libmyodbc9a.so
+lib/libmyodbc9w.so
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
+%%PORTDOCS%%%%DOCSDIR%%/README.txt
+%%DATADIR%%/test/CTestTestfile.cmake
+%%DATADIR%%/test/dltest
+%%DATADIR%%/test/my_auth
+%%DATADIR%%/test/my_basics
+%%DATADIR%%/test/my_blob
+%%DATADIR%%/test/my_bug13766
+%%DATADIR%%/test/my_bulk
+%%DATADIR%%/test/my_catalog1
+%%DATADIR%%/test/my_catalog2
+%%DATADIR%%/test/my_catalog3
+%%DATADIR%%/test/my_crash
+%%DATADIR%%/test/my_curext
+%%DATADIR%%/test/my_cursor
+%%DATADIR%%/test/my_data
+%%DATADIR%%/test/my_datetime
+%%DATADIR%%/test/my_desc
+%%DATADIR%%/test/my_dyn_cursor
+%%DATADIR%%/test/my_error
+%%DATADIR%%/test/my_info
+%%DATADIR%%/test/my_keys
+%%DATADIR%%/test/my_options
+%%DATADIR%%/test/my_param
+%%DATADIR%%/test/my_param2
+%%DATADIR%%/test/my_pooling
+%%DATADIR%%/test/my_prepare
+%%DATADIR%%/test/my_relative
+%%DATADIR%%/test/my_result1
+%%DATADIR%%/test/my_result2
+%%DATADIR%%/test/my_result3
+%%DATADIR%%/test/my_scroll
+%%DATADIR%%/test/my_setup
+%%DATADIR%%/test/my_tran
+%%DATADIR%%/test/my_types
+%%DATADIR%%/test/my_unicode
+%%DATADIR%%/test/my_unixodbc
+%%DATADIR%%/test/my_use_result
+%%DATADIR%%/test/odbc.ini
+%%DATADIR%%/test/odbcinst.ini
+%%DATADIR%%/test/openid_token_correct.txt
+%%DATADIR%%/test/openid_token_empty.txt
+%%DATADIR%%/test/openid_token_expired.txt
+%%DATADIR%%/test/openid_token_invalid.txt
+%%DATADIR%%/test/openid_token_issuer2.txt
+%%DATADIR%%/test/openid_token_key2.txt
+%%DATADIR%%/test/openid_token_user2.txt