From 91b2fd86f34997c8842fa8fa1bf1251100292a34 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 16 Sep 2025 20:21:59 +0300 Subject: [PATCH] unixODBCDrivers.sqlite: fix build with gcc15 - add patch from fedora fixing incompatible-pointer-types errors. Fixes build failure with gcc15: ``` sqlite3odbc.c:4521:24: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(char **)' [-Wincompatible-pointer-types] 4521 | s->rowfree = freerows; | ^ sqlite3odbc.c:2185:1: note: 'freerows' declared here 2185 | freerows(char **rowp) | ^~~~~~~~ sqlite3odbc.c: In function 'drvtableprivileges': sqlite3odbc.c:6173:24: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(char **)' [-Wincompatible-pointer-types] 6173 | s->rowfree = sqlite3_free_table; | ^ In file included from sqlite3odbc.h:49, from sqlite3odbc.c:25: /nix/store/w3ibvzff0yrpg8abrl8n2fxn0d9fpfpc-sqlite-3.50.2-dev/include/sqlite3.h:3144:17: note: 'sqlite3_free_table' declared here 3144 | SQLITE_API void sqlite3_free_table(char **result); | ^~~~~~~~~~~~~~~~~~ sqlite3odbc.c: In function 'drvprimarykeys': sqlite3odbc.c:6593:16: error: assignment to 'void (*)(void)' from incompatible pointer type 'void (*)(char **)' [-Wincompatible-pointer-types] 6593 | s->rowfree = freerows; | ^ ``` --- pkgs/development/libraries/unixODBCDrivers/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index fbef1b9ce460..9c6b657d0ee2 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -1,5 +1,6 @@ { config, + fetchpatch, fetchurl, stdenv, unixODBC, @@ -111,6 +112,15 @@ sha256 = "0dgsj28sc7f7aprmdd0n5a1rmcx6pv7170c8dfjl0x1qsjxim6hs"; }; + patches = [ + # Fix build with gcc15 + (fetchpatch { + name = "sqlite-connector-odbc-fix-incompatible-pointer-compilation-error.patch"; + url = "https://src.fedoraproject.org/rpms/sqliteodbc/raw/e3d93f5909c884fd8846b36b71ba67a3ad65da2a/f/sqliteodbc-0.99991-Fix-incompatible-pointer-compilation-error.patch"; + hash = "sha256-IAZDujEkAyU40sKa4GC+upURNt7vplCDAx91Eeny+bU="; + }) + ]; + buildInputs = [ unixODBC sqlite