mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-17 12:50:04 +00:00
unixodbcDrivers.mariadb: 3.2.6 -> 3.2.8, adopt (#508355)
This commit is contained in:
@@ -45,36 +45,22 @@
|
||||
|
||||
duckdb = duckdb-odbc;
|
||||
|
||||
mariadb = stdenv.mkDerivation rec {
|
||||
mariadb = stdenv.mkDerivation (finalAttrs: {
|
||||
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=";
|
||||
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)
|
||||
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
|
||||
openssl
|
||||
@@ -84,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
|
||||
@@ -110,9 +92,10 @@
|
||||
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;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
sqlite = stdenv.mkDerivation rec {
|
||||
pname = "sqlite-connector-odbc";
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From fe6e6412ac0fb155843585647c045a1fba2ee3f2 Mon Sep 17 00:00:00 2001
|
||||
From: Alyssa Ross <hi@alyssa.is>
|
||||
Date: Sat, 20 Sep 2025 14:11:13 +0200
|
||||
Subject: [PATCH] Add missing <cstdint> includes
|
||||
|
||||
These files use types from <cstdint> 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 <cstdint>
|
||||
#include <stdexcept>
|
||||
#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 <initializer_list>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
+#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@@ -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 <unistd.h>
|
||||
+
|
||||
#include "tap.h"
|
||||
|
||||
SQLINTEGER my_max_rows= 100;
|
||||
Reference in New Issue
Block a user