[packages/libdbi-drivers] - fix building with freetds 1.0 - fix building with Firebird 3+ - rel 2

baggins baggins at pld-linux.org
Tue Feb 21 23:26:28 CET 2017


commit a8405ffd38ae0913ad43a38f293e0179ee10ba68
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Feb 21 23:25:43 2017 +0100

    - fix building with freetds 1.0
    - fix building with Firebird 3+
    - rel 2

 firebird3.patch     | 15 +++++++++++++++
 freetds-1.0.patch   | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 libdbi-drivers.spec |  6 +++++-
 3 files changed, 71 insertions(+), 1 deletion(-)
---
diff --git a/libdbi-drivers.spec b/libdbi-drivers.spec
index 76c4b00..0a1b8a6 100644
--- a/libdbi-drivers.spec
+++ b/libdbi-drivers.spec
@@ -16,12 +16,14 @@ Summary:	Database Independent Abstraction Layer for C
 Summary(pl.UTF-8):	Warstwa DBI dla C
 Name:		libdbi-drivers
 Version:	0.9.0
-Release:	1
+Release:	2
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/libdbi-drivers/%{name}-%{version}.tar.gz
 # Source0-md5:	9f47b960e225eede2cdeaabf7d22f59f
 Patch0:		%{name}-sqlite3_libs.patch
+Patch1:		freetds-1.0.patch
+Patch2:		firebird3.patch
 URL:		http://libdbi-drivers.sourceforge.net/
 %{?with_firebird:BuildRequires:	Firebird-devel}
 BuildRequires:	autoconf >= 2.13
@@ -194,6 +196,8 @@ zmiany źródeł programu.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
diff --git a/firebird3.patch b/firebird3.patch
new file mode 100644
index 0000000..88ae011
--- /dev/null
+++ b/firebird3.patch
@@ -0,0 +1,15 @@
+--- libdbi-drivers-0.9.0/acinclude.m4.orig	2011-02-20 00:02:39.000000000 +0100
++++ libdbi-drivers-0.9.0/acinclude.m4	2017-02-21 23:19:16.251952066 +0100
+@@ -483,10 +483,10 @@
+ 		FIREBIRD_INCLUDE=-I$ac_firebird_incdir
+ 	fi
+ 	if test "$ac_firebird_libdir" = "no"; then
+-		AC_SEARCH_LIBS_VAR(isc_dsql_fetch, fbembed, , , , FIREBIRD_LIBS)
++		AC_SEARCH_LIBS_VAR(isc_dsql_fetch, fbclient, , , , FIREBIRD_LIBS)
+ 		FIREBIRD_LDFLAGS=""
+ 	else
+-		FIREBIRD_LIBS=-lfbembed
++		FIREBIRD_LIBS=-lfbclient
+ 		FIREBIRD_LDFLAGS=-L$ac_firebird_libdir
+ 	fi
+ 
diff --git a/freetds-1.0.patch b/freetds-1.0.patch
new file mode 100644
index 0000000..18790ce
--- /dev/null
+++ b/freetds-1.0.patch
@@ -0,0 +1,51 @@
+commit 3bf3e4a856604703c4070bdebbe42fe0068f540a
+Author: Jan Engelhardt <jengelh at inai.de>
+Date:   Fri Jan 27 09:55:41 2017 +0100
+
+    freetds: resolve compile error with 1.0
+    
+    dbd_freetds.c: In function "dbd_connect":
+    dbd_freetds.c:232:12: error: "CS_TDS_80" undeclared (first use in this function)
+          num = CS_TDS_80;
+    
+    freetds 1.0 has dropped the CS_TDS_80 identifier. In 0.95, it defined
+    CS_TDS_80=CS_TDS_71, while 0.91 has no CS_TDS_71, which is why a full
+    autoconf check is needed.
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 45db616..85eec28 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -562,6 +562,19 @@ if test "$ac_freetds" = "yes"; then
+ 	AC_SUBST(FREETDS_LIBS)
+ 	AC_SUBST(FREETDS_INCLUDE)
+ 	AC_SUBST(FREETDS_LDFLAGS)
++
++	AH_TEMPLATE([DBI_CS_TDS_80], [])
++	AC_MSG_CHECKING([CS_TDS_80])
++	AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++		#include <ctpublic.h>
++		int x = CS_TDS_80;
++	])], [
++		AC_DEFINE([DBI_CS_TDS_80], [CS_TDS_80])
++		AC_MSG_RESULT([CS_TDS_80])
++	], [
++		AC_DEFINE([DBI_CS_TDS_80], [CS_TDS_71])
++		AC_MSG_RESULT([CS_TDS_71])
++	])
+ else
+ 	AC_MSG_RESULT(no)
+ fi
+diff --git a/drivers/freetds/dbd_freetds.c b/drivers/freetds/dbd_freetds.c
+index 22fddfd..d01f13b 100644
+--- a/drivers/freetds/dbd_freetds.c
++++ b/drivers/freetds/dbd_freetds.c
+@@ -229,7 +229,7 @@ int dbd_connect(dbi_conn_t * conn)
+ 	switch (str[0]) {
+ //      We can use it if "CS_TDS_80" will be add to ct_con_props() by CS_SET action
+ 	case '8':
+-	    num = CS_TDS_80;
++	    num = DBI_CS_TDS_80;
+ 	    break;
+ 	case '7':
+ 	    num = CS_TDS_70;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libdbi-drivers.git/commitdiff/a8405ffd38ae0913ad43a38f293e0179ee10ba68



More information about the pld-cvs-commit mailing list