From 0ce7459b96b32d416a608efdda21047bcfa8261b Mon Sep 17 00:00:00 2001 From: Hythera <87016780+Hythera@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:03:24 +0200 Subject: [PATCH 1/3] unixodbcDrivers.mariadb: 3.2.6 -> 3.2.9 changelog: https://mariadb.com/docs/release-notes/connectors/odbc/3.2/3.2.9 diff: https://github.com/mariadb-corporation/mariadb-connector-odbc/compare/3.2.6...3.2.9 --- .../libraries/unixODBCDrivers/default.nix | 19 +-------- .../mariadb-connector-odbc-musl.patch | 41 ------------------- .../mariadb-connector-odbc-unistd.patch | 12 ------ 3 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-musl.patch delete mode 100644 pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-unistd.patch diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index 5b1c363f26ea..1c283249f061 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -47,33 +47,18 @@ mariadb = stdenv.mkDerivation rec { pname = "mariadb-connector-odbc"; - version = "3.2.6"; + version = "3.2.9"; src = fetchFromGitHub { owner = "mariadb-corporation"; repo = "mariadb-connector-odbc"; rev = version; - hash = "sha256-FdnA3/xDxnk2910LCMPWQTcUUSYfUsnnZ3Hqj0uey5s="; + hash = "sha256-VPpQa17dj544G+kx8b93rErvRZxghvAbZN3povPKYrw="; # this driver only seems to build correctly when built against the mariadb-connect-c subrepo # (see https://github.com/NixOS/nixpkgs/issues/73258) fetchSubmodules = true; }; - patches = [ - # Fix `call to undeclared function 'sleep'` with clang 16 - ./mariadb-connector-odbc-unistd.patch - - ./mariadb-connector-odbc-musl.patch - - # Fix build with gcc15 - # https://github.com/mariadb-corporation/mariadb-connector-odbc/pull/63 - (fetchpatch { - name = "mariadb-connector-odbc-add-include-cstdint-gcc15.patch"; - url = "https://github.com/mariadb-corporation/mariadb-connector-odbc/commit/a3ced654db2ef93de0a818f2d66171f6084e5f2d.patch"; - hash = "sha256-GZITSryfRdAgNxZehasoBModGNZo575Dd5aokwNWzpY="; - }) - ]; - nativeBuildInputs = [ cmake ]; buildInputs = [ unixodbc diff --git a/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-musl.patch b/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-musl.patch deleted file mode 100644 index 67445813fb86..000000000000 --- a/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-musl.patch +++ /dev/null @@ -1,41 +0,0 @@ -From fe6e6412ac0fb155843585647c045a1fba2ee3f2 Mon Sep 17 00:00:00 2001 -From: Alyssa Ross -Date: Sat, 20 Sep 2025 14:11:13 +0200 -Subject: [PATCH] Add missing includes - -These files use types from without including it. Without -the includes, the build fails for musl. ---- -Link: https://github.com/mariadb-corporation/mariadb-connector-odbc/pull/65 - - driver/interface/Exception.h | 1 + - driver/template/CArray.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/driver/interface/Exception.h b/driver/interface/Exception.h -index 1b2eb847..82f06273 100644 ---- a/driver/interface/Exception.h -+++ b/driver/interface/Exception.h -@@ -21,6 +21,7 @@ - #ifndef _EXCEPTION_H_ - #define _EXCEPTION_H_ - -+#include - #include - #include "class/SQLString.h" - -diff --git a/driver/template/CArray.h b/driver/template/CArray.h -index 2c4be514..bd0e9912 100644 ---- a/driver/template/CArray.h -+++ b/driver/template/CArray.h -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - #include - --- -2.51.0 - diff --git a/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-unistd.patch b/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-unistd.patch deleted file mode 100644 index 8c976885eb62..000000000000 --- a/pkgs/development/libraries/unixODBCDrivers/mariadb-connector-odbc-unistd.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur a/test/use_result.c b/test/use_result.c ---- a/test/use_result.c 1969-12-31 19:00:01.000000000 -0500 -+++ b/test/use_result.c 2023-09-05 00:08:12.979889343 -0400 -@@ -23,6 +23,8 @@ - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -+#include -+ - #include "tap.h" - - SQLINTEGER my_max_rows= 100; From d0c819d62ce3dcc71701ebb343d9d367b7a015ab Mon Sep 17 00:00:00 2001 From: Hythera <87016780+Hythera@users.noreply.github.com> Date: Sat, 8 Aug 2026 14:54:32 +0200 Subject: [PATCH 2/3] unixodbcDrivers.mariadb: modernize --- .../libraries/unixODBCDrivers/default.nix | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index 1c283249f061..3e2bda487a73 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -45,14 +45,14 @@ duckdb = duckdb-odbc; - mariadb = stdenv.mkDerivation rec { + mariadb = stdenv.mkDerivation (finalAttrs: { pname = "mariadb-connector-odbc"; version = "3.2.9"; src = fetchFromGitHub { owner = "mariadb-corporation"; repo = "mariadb-connector-odbc"; - rev = version; + tag = finalAttrs.version; hash = "sha256-VPpQa17dj544G+kx8b93rErvRZxghvAbZN3povPKYrw="; # this driver only seems to build correctly when built against the mariadb-connect-c subrepo # (see https://github.com/NixOS/nixpkgs/issues/73258) @@ -60,6 +60,7 @@ }; nativeBuildInputs = [ cmake ]; + buildInputs = [ unixodbc openssl @@ -69,20 +70,16 @@ ++ lib.optionals stdenv.hostPlatform.isDarwin [ libkrb5 ]; cmakeFlags = [ - "-DWITH_EXTERNAL_ZLIB=ON" - "-DODBC_LIB_DIR=${lib.getLib unixodbc}/lib" - "-DODBC_INCLUDE_DIR=${lib.getDev unixodbc}/include" - "-DWITH_OPENSSL=ON" - # on darwin this defaults to ON but we want to build against unixodbc - "-DWITH_IODBC=OFF" + # On darwin this defaults to ON but we want to build against unixodbc + (lib.cmakeBool "WITH_IODBC" false) + (lib.cmakeBool "WITH_OPENSSL" true) + (lib.cmakeBool "WITH_EXTERNAL_ZLIB" true) + (lib.cmakeFeature "ODBC_LIB_DIR" "${lib.getLib unixodbc}/lib") + (lib.cmakeFeature "ODBC_INCLUDE_DIR" "${lib.getDev unixodbc}/include") ]; buildFlags = if stdenv.hostPlatform.isDarwin then [ "maodbc" ] else null; - env = lib.optionalAttrs stdenv.cc.isGNU { - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - }; - installTargets = if stdenv.hostPlatform.isDarwin then [ "install/fast" ] else null; # see the top of the file for an explanation @@ -97,7 +94,7 @@ license = lib.licenses.gpl2; platforms = lib.platforms.linux ++ lib.platforms.darwin; }; - }; + }); sqlite = stdenv.mkDerivation rec { pname = "sqlite-connector-odbc"; From 11737cb0a4307728a7d8ca4c40798020bef8415b Mon Sep 17 00:00:00 2001 From: Hythera <87016780+Hythera@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:04:34 +0200 Subject: [PATCH 3/3] unixodbcDrivers.mariadb: add hythera as maintainer --- pkgs/development/libraries/unixODBCDrivers/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index 3e2bda487a73..80ce13b7d5fa 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -92,6 +92,7 @@ description = "MariaDB ODBC database driver"; homepage = "https://downloads.mariadb.org/connector-odbc/"; license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ hythera ]; platforms = lib.platforms.linux ++ lib.platforms.darwin; }; });