Unverified Commit 3d7ef2f0 authored by wxt's avatar wxt
Browse files

libgda: fix mysql

parent ec9f2c23
Loading
Loading
Loading
Loading
+118 −0
Original line number Diff line number Diff line
From 37f30a35bea94a86a37fe22adf8e99c20bc6e18b Mon Sep 17 00:00:00 2001
From: wxt <3264117476@qq.com>
Date: Tue, 21 Jan 2025 12:26:24 +0800
Subject: [PATCH] fix gcc14

---
 m4/bdb.m4        | 1 +
 m4/firebird.m4   | 2 ++
 m4/ldap.m4       | 1 +
 m4/mdbtools.m4   | 1 +
 m4/mysql.m4      | 2 ++
 m4/oracle.m4     | 1 +
 m4/postgresql.m4 | 1 +
 7 files changed, 9 insertions(+)

diff --git a/m4/bdb.m4 b/m4/bdb.m4
index 3f577960a..b7d58b8ea 100644
--- a/m4/bdb.m4
+++ b/m4/bdb.m4
@@ -168,6 +168,7 @@ m4_define([_BDB_CHECK_INTERNAL],
 	                LIBS="$LIBS -L$d/$bdb_loclibdir $db_lib"
    	                AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <${db_hdr}>
+#include <stdio.h>
 int main() {
     printf("%p", db_create);
     return 0;
diff --git a/m4/firebird.m4 b/m4/firebird.m4
index 933962dc8..6d2370a41 100644
--- a/m4/firebird.m4
+++ b/m4/firebird.m4
@@ -154,6 +154,7 @@ m4_define([_FIREBIRD_CHECK_INTERNAL],
 	        LIBS="$LIBS -L$d/$firebird_loclibdir -lfbclient"
    	        AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <ibase.h>
+#include <stdio.h>
 int main() {
     printf("%p", isc_open);
     return 0;
@@ -196,6 +197,7 @@ int main() {
 	        LIBS="$LIBS -L$d/$firebird_loclibdir -lfbembed"
    	        AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <ibase.h>
+#include <stdio.h>
 int main() {
     printf("%p", isc_open);
     return 0;
diff --git a/m4/ldap.m4 b/m4/ldap.m4
index 032533192..77e3b34dd 100644
--- a/m4/ldap.m4
+++ b/m4/ldap.m4
@@ -124,6 +124,7 @@ m4_define([_LDAP_CHECK_INTERNAL],
 #include <ldap.h>
 #include <lber.h>
 #include <ldap_schema.h>
+#include <stdio.h>
 int main() {
     printf("%p,%p", ldap_initialize, ldap_str2attributetype);
     printf("%p", ber_free);
diff --git a/m4/mdbtools.m4 b/m4/mdbtools.m4
index 7ca5b40c5..054498f7b 100644
--- a/m4/mdbtools.m4
+++ b/m4/mdbtools.m4
@@ -141,6 +141,7 @@ m4_define([_MDBTOOLS_CHECK_INTERNAL],
 	            LIBS="$LIBS -L$d/$mdb_loclibdir -lmdb $mdb_glib_libs"
    	            AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <mdbtools.h>
+#include <stdio.h>
 int main() {
     printf("%p", mdb_open);
     return 0;
diff --git a/m4/mysql.m4 b/m4/mysql.m4
index 535a081a9..5bd9e49b3 100644
--- a/m4/mysql.m4
+++ b/m4/mysql.m4
@@ -134,6 +134,7 @@ m4_define([_MYSQL_CHECK_INTERNAL],
    	                AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <winsock.h>
 #include <mysql.h>
+#include <stdio.h>
 int main() {
     printf("%p", mysql_real_connect);
     return 0;
@@ -177,6 +178,7 @@ int main() {
 
             AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <mysql.h>
+#include <stdio.h>
 int main() {
     printf("%p", mysql_real_connect);
     return 0;
diff --git a/m4/oracle.m4 b/m4/oracle.m4
index 2d9003e41..cf5ba8ebd 100644
--- a/m4/oracle.m4
+++ b/m4/oracle.m4
@@ -140,6 +140,7 @@ m4_define([_ORACLE_CHECK_INTERNAL],
 		fi
    	        AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <oci.h>
+#include <stdio.h>
 int main() {
     printf("%p", OCIInitialize);
     return 0;
diff --git a/m4/postgresql.m4 b/m4/postgresql.m4
index 252d9053d..a7e308d1a 100644
--- a/m4/postgresql.m4
+++ b/m4/postgresql.m4
@@ -133,6 +133,7 @@ m4_define([_POSTGRES_CHECK_INTERNAL],
 	                LIBS="$LIBS -L$d/$pg_loclibdir -lpq"
    	                AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <libpq-fe.h>
+#include <stdio.h>
 int main() {
     printf("%p", PQconnectdb);
     return 0;
-- 
2.47.0
+10 −7
Original line number Diff line number Diff line
@@ -29,20 +29,23 @@ stdenv.mkDerivation rec {

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
    sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
    hash = "sha256-b2zfe4BT9VO5B+DIimBk60jPJ1GFLrJDI9zwJ3kjNMg=";
  };

  patches = [
    # fix compile error with mysql
    (fetchpatch {
      url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
      sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
      hash = "sha256-G2PS8LkUXj7deofEn8lgpEMbYg4RLB5injS9VRizGpU=";
    })
    (fetchpatch {
      name = "CVE-2021-39359.patch";
      url = "https://src.fedoraproject.org/rpms/libgda5/raw/72bb769f12e861e27e883dac5fab34f1ba4bd97e/f/bebdffb4de586fb43fd07ac549121f4b22f6812d.patch";
      sha256 = "sha256-hIKuY5NEqOzntdlLb541bA4xZU5ypTRmV1u765K6KbM=";
      hash = "sha256-hIKuY5NEqOzntdlLb541bA4xZU5ypTRmV1u765K6KbM=";
    })

    # Fix configure detection of features with c99.
    ./0001-gcc14-fix.patch
  ];

  nativeBuildInputs = [
@@ -100,16 +103,16 @@ stdenv.mkDerivation rec {
    };
  };

  meta = with lib; {
  meta = {
    description = "Database access library";
    homepage = "https://www.gnome-db.org/";
    license = with licenses; [
    license = with lib.licenses; [
      # library
      lgpl2Plus
      # CLI tools
      gpl2Plus
    ];
    maintainers = teams.gnome.members;
    platforms = platforms.unix;
    maintainers = lib.teams.gnome.members;
    platforms = lib.platforms.unix;
  };
}