Browse Source

libzdb: update to 3.2

Removed most patches. The last was upstreamed and the others can be worked
around using Makefile.

Removed inactive maintainer.

Added PKG_BUILD_PARALLEL for faster compilation.

Fixed license information.

Massive reorganization of Makefile for consistency between packages.

Removed --with-sql options. These are totally broken when cross compiling.
Leaving them out works just as well.

Added cpp patch as the test needs a header.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
lilik-openwrt-22.03
Rosen Penev 5 years ago
parent
commit
496ee7f91b
No known key found for this signature in database GPG Key ID: 36D31CFA845F0E3B
5 changed files with 43 additions and 245 deletions
  1. +25
    -28
      libs/libzdb/Makefile
  2. +0
    -186
      libs/libzdb/patches/010-cross-compile-fixes.patch
  3. +7
    -0
      libs/libzdb/patches/010-missing-header.patch
  4. +11
    -20
      libs/libzdb/patches/020-filterh-use-host-built-version.patch
  5. +0
    -11
      libs/libzdb/patches/030-openssl-1.1.patch

+ 25
- 28
libs/libzdb/Makefile View File

@ -8,29 +8,32 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libzdb
PKG_VERSION:=3.1
PKG_RELEASE:=6
PKG_LICENSE:=GPL-3.0
PKG_VERSION:=3.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tildeslash.com/libzdb/dist/
PKG_HASH:=0f01abb1b01d1a1f4ab9b55ad3ba445d203fc3b4757abdf53e1d85e2b7b42695
PKG_SOURCE_URL:=https://www.tildeslash.com/libzdb/dist/
PKG_HASH:=005ddf4b29c6db622e16303298c2f914dfd82590111cea7cfd09b4acf46cf4f2
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=libzdb/host
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
# libzdb needs to find iconv when linking to libmariadb
include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/host-build.mk
define Package/libzdb
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A thread-safe multi database connection pool library
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://www.tildeslash.com/libzdb/
URL:=https://www.tildeslash.com/libzdb/
DEPENDS:=+libsqlite3 +libpq +libmysqlclient +zlib +libpthread +libopenssl
endef
@ -42,17 +45,16 @@ define Package/libzdb/description
NOTE: This package does not include Oracle support.
endef
CONFIGURE_ARGS += --disable-profiling \
--enable-optimized \
--with-mysql \
--with-postgresql \
--with-sqlite \
--enable-sqliteunlock \
--enable-openssl
CONFIGURE_ARGS += \
--disable-profiling \
--enable-optimized \
--enable-protected \
--enable-sqliteunlock \
--enable-openssl
TARGET_CPPFLAGS += -std=c99
include $(INCLUDE_DIR)/host-build.mk
CONFIGURE_VARS += \
libzdb_cv_setjmp_available=yes \
libzdb_cv_vsnprintf_c11_conformant=yes
define Hooks/HostConfigure/Pre
endef
@ -66,21 +68,15 @@ endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
$(CP) $(HOST_BUILD_DIR)/tools/bin/filterh $(STAGING_DIR_HOSTPKG)/bin/
endef
$(eval $(call HostBuild))
define Build/Compile
$(call Build/Compile/Default)
$(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/bin/filterh $(STAGING_DIR_HOSTPKG)/bin/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/zdb
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/include/zdb/ $(1)/usr/include/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/zdb/* $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libzdb* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zdb.pc $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zdb.pc $(1)/usr/lib/pkgconfig
endef
define Package/libzdb/install
@ -88,4 +84,5 @@ define Package/libzdb/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libzdb.so* $(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libzdb))

+ 0
- 186
libs/libzdb/patches/010-cross-compile-fixes.patch View File

@ -1,186 +0,0 @@
diff -rupN libzdb-3.1.orig/configure.ac libzdb-3.1/configure.ac
--- libzdb-3.1.orig/configure.ac 2015-08-31 14:46:02.000000000 +0200
+++ libzdb-3.1/configure.ac 2016-04-18 19:43:13.836937134 +0200
@@ -196,15 +196,6 @@ AC_SEARCH_LIBS([pthread_create], [pthrea
# Database Libraries
mysql="yes"
-check_mysql_config()
-{
- AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [no], [$PATH:/usr/local/bin:/usr/local/mysql/bin])
- if test "x$MYSQLCONFIG" = "xno"
- then
- AC_MSG_WARN([mysql_config is required to build libzdb with mysql])
- mysql="no"
- fi
-}
AC_MSG_CHECKING(for mysql)
AC_ARG_WITH([mysql],
AS_HELP_STRING([--with-mysql(=<path>)],
@@ -216,22 +207,20 @@ AC_ARG_WITH([mysql],
mysql="no"
else
AC_MSG_RESULT([yes])
- AC_CHECK_FILE([$with_mysql], [MYSQLCONFIG=$with_mysql], [check_mysql_config])
fi
],
[
AC_MSG_RESULT([yes])
- check_mysql_config
])
if test "xyes" = "x$mysql"; then
svd_CPPFLAGS=$CPPFLAGS
svd_LDFLAGS=$LDFLAGS
- CPPFLAGS="`$MYSQLCONFIG --include` $CPPFLAGS"
- LDFLAGS="`$MYSQLCONFIG --libs` $LDFLAGS"
+ CPPFLAGS="-I$STAGING_DIR/usr/include/mysql $CPPFLAGS"
+ LDFLAGS="-L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib $LDFLAGS"
AC_CHECK_HEADERS([mysql.h], [], [mysql="no"])
if test "xyes" = "x$mysql"; then
- DBCPPFLAGS="$DBCPPFLAGS `$MYSQLCONFIG --include`"
- DBLDFLAGS="$DBLDFLAGS `$MYSQLCONFIG --libs`"
+ DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/mysql"
+ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib -lmysqlclient -liconv -lz -lcrypt -lm"
AC_DEFINE([HAVE_LIBMYSQLCLIENT], 1, [Define to 1 to enable mysql])
else
CPPFLAGS=$svd_CPPFLAGS
@@ -241,15 +230,6 @@ fi
AM_CONDITIONAL([WITH_MYSQL], test "xyes" = "x$mysql")
postgresql="yes"
-check_postgres_config()
-{
- AC_PATH_PROG([PGCONFIG], [pg_config], [no], [$PATH:/usr/local/bin:/usr/local/pgsql/bin])
- if test "x$PGCONFIG" = "xno"
- then
- AC_MSG_WARN([pg_config is required to build libzdb with postgresql])
- postgresql="no"
- fi
-}
AC_MSG_CHECKING(for postgresql)
AC_ARG_WITH([postgresql],
AS_HELP_STRING([--with-postgresql(=<path>)],
@@ -261,22 +241,20 @@ AC_ARG_WITH([postgresql],
postgresql="no"
else
AC_MSG_RESULT([yes])
- AC_CHECK_FILE([$with_postgresql], [PGCONFIG=$with_postgresql],[check_postgres_config])
fi
],
[
AC_MSG_RESULT([yes])
- check_postgres_config
])
if test "xyes" = "x$postgresql"; then
svd_CPPFLAGS=$CPPFLAGS
svd_LDFLAGS=$LDFLAGS
- CPPFLAGS="-I`$PGCONFIG --includedir` $CPPFLAGS"
- LDFLAGS="-L`$PGCONFIG --libdir` $LDFLAGS"
+ CPPFLAGS="-I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include $CPPFLAGS"
+ LDFLAGS="-L$STAGING_DIR/usr/lib $LDFLAGS"
AC_CHECK_HEADERS([libpq-fe.h], [], [postgresql="no"])
if test "xyes" = "x$postgresql"; then
- DBCPPFLAGS="$DBCPPFLAGS -I`$PGCONFIG --includedir`"
- DBLDFLAGS="$DBLDFLAGS -L`$PGCONFIG --libdir` -lpq"
+ DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/postgresql -I$STAGING_DIR/usr/include"
+ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib -lpq"
AC_DEFINE([HAVE_LIBPQ], 1, [Define to 1 to enable postgresql])
else
CPPFLAGS=$svd_CPPFLAGS
@@ -298,22 +276,7 @@ AC_ARG_WITH([sqlite],
sqlite="no"
else
AC_MSG_RESULT([yes])
- AC_CHECK_FILE([$with_sqlite],
- [
- svd_LDFLAGS=$LDFLAGS
- svd_CPPFLAGS=$CPPFLAGS
- LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
- CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
- AC_SEARCH_LIBS([sqlite3_open], [sqlite3],
- [
- DBCPPFLAGS="$DBCPPFLAGS -I$with_sqlite/include"
- DBLDFLAGS="$DBLDFLAGS -L$with_sqlite/lib/ -lsqlite3"
- ],[sqlite="no"],[-ldl])
- LDFLAGS=$svd_LDFLAGS
- CPPFLAGS=$svd_CPPFLAGS
-
- ],
- AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"], [-ldl]))
+ AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"])
fi
],
[
@@ -328,20 +291,8 @@ if test "xyes" = "x$sqlite"; then
fi
AM_CONDITIONAL([WITH_SQLITE], test "xyes" = "x$sqlite")
-oracle="yes"
-AC_MSG_CHECKING(for oracle)
-AX_LIB_ORACLE_OCI
-if test -n "$ORACLE_OCI_CFLAGS" -a -n "$ORACLE_OCI_LDFLAGS"; then
- DBCPPFLAGS="$DBCPPFLAGS $ORACLE_OCI_CFLAGS"
- DBLDFLAGS="$DBLDFLAGS $ORACLE_OCI_LDFLAGS"
- AC_DEFINE([HAVE_ORACLE], 1, [Define to 1 to enable oracle])
-else
- oracle="no"
-fi
-AM_CONDITIONAL([WITH_ORACLE], test "xyes" = "x$oracle")
-
# Test if any database system was found
-if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite" -a "xno" = "x$oracle"; then
+if test "xno" = "x$postgresql" -a "xno" = "x$mysql" -a "xno" = "x$sqlite"; then
AC_MSG_ERROR([No available database found or selected. Try configure --help])
fi
@@ -358,23 +309,6 @@ AC_HEADER_STDC
# Functions
# ------------------------------------------------------------------------
-# Require a working setjmp
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <setjmp.h>
- ]],
- [[jmp_buf env; setjmp(env);]])],
- [], [AC_MSG_FAILURE([setjmp is required])]
-)
-
-# Require that we have vsnprintf that conforms to c99. I.e. does bounds check
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <stdarg.h>
- #include <stdio.h>
- ]],
- [[char t[1]; va_list ap; int n = vsnprintf(t, 1, "hello", ap); if(n == 5) return 0;return 1;]])],
- [], [AC_MSG_FAILURE([vsnprintf does not conform to c99])]
-)
-
AC_CHECK_FUNCS([timegm])
@@ -516,11 +450,6 @@ echo "| PostgreSQL:
else
echo "| PostgreSQL: DISABLED |"
fi
-if test "xyes" = "x$oracle"; then
-echo "| Oracle: ENABLED |"
-else
-echo "| Oracle: DISABLED |"
-fi
echo "+------------------------------------------------------------+"
diff -rupN libzdb-3.1.orig/Makefile.am libzdb-3.1/Makefile.am
--- libzdb-3.1.orig/Makefile.am 2015-08-31 14:55:18.000000000 +0200
+++ libzdb-3.1/Makefile.am 2016-04-18 19:43:42.215769551 +0200
@@ -45,11 +45,6 @@ libzdb_la_SOURCES += src/db/sqlite/SQLit
src/db/sqlite/SQLiteResultSet.c \
src/db/sqlite/SQLitePreparedStatement.c
endif
-if WITH_ORACLE
-libzdb_la_SOURCES += src/db/oracle/OracleConnection.c \
- src/db/oracle/OracleResultSet.c \
- src/db/oracle/OraclePreparedStatement.c
-endif
API_INTERFACES = src/zdb.h src/db/ConnectionPool.h src/db/Connection.h \
src/db/ResultSet.h src/net/URL.h src/db/PreparedStatement.h \

+ 7
- 0
libs/libzdb/patches/010-missing-header.patch View File

@ -0,0 +1,7 @@
--- a/test/zdbpp.cpp
+++ b/test/zdbpp.cpp
@@ -1,3 +1,4 @@
+#include <cassert>
#include <iostream>
#include <string>
#include <map>

+ 11
- 20
libs/libzdb/patches/020-filterh-use-host-built-version.patch View File

@ -1,20 +1,11 @@
diff -rupN libzdb-3.0.orig/Makefile.am libzdb-3.0/Makefile.am
--- libzdb-3.0.orig/Makefile.am 2014-01-06 22:34:08.000000000 +0100
+++ libzdb-3.0/Makefile.am 2014-11-19 20:26:20.588547729 +0100
@@ -1,5 +1,7 @@
# Copyright (C) Tildeslash Ltd. All rights reserved.
+include $(TOPDIR)/rules.mk
+
AUTOMAKE_OPTIONS = foreign no-dependencies subdir-objects
ACLOCAL_AMFLAGS = -I m4
@@ -12,7 +14,7 @@ LIBRARY_NAME = zdb
RE2C = @RE2C@
RE2CFLAGS = -b
-FILTERH = ./tools/bin/filterh
+FILTERH = $(STAGING_DIR_HOSTPKG)/bin/filterh
AM_CPPFLAGS = $(CPPFLAGS) $(DBCPPFLAGS)
AM_CPPFLAGS += -Isrc -Isrc/util -Isrc/net -Isrc/db -Isrc/exceptions
--- a/Makefile.in
+++ b/Makefile.in
@@ -476,7 +476,7 @@ DIST_SUBDIRS = . test
EXTRA_DIST = README AUTHORS CHANGES COPYING bootstrap doc test src tools config
LIBRARY_NAME = zdb
RE2CFLAGS = -b
-FILTERH = ./tools/bin/filterh
+FILTERH = $(STAGING_DIR_HOSTPKG)/bin/filterh
AM_CPPFLAGS = $(CPPFLAGS) $(DBCPPFLAGS) -Isrc -Isrc/util -Isrc/net \
-Isrc/db -Isrc/db/oracle -Isrc/exceptions
pkgconfigdir = $(libdir)/pkgconfig

+ 0
- 11
libs/libzdb/patches/030-openssl-1.1.patch View File

@ -1,11 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -141,7 +141,7 @@ AC_ARG_ENABLE([openssl],
else
openssl="true"
if test "x$enableval" = "xyes"; then
- AC_CHECK_LIB([ssl], [SSL_library_init], [], [AC_MSG_ERROR([libssl not found])])
+ AC_CHECK_LIB([ssl], [SSL_CTX_new], [], [AC_MSG_ERROR([libssl not found])])
AC_CHECK_LIB([crypto], [SHA1_Init], [], [AC_MSG_ERROR([libcrypto not found])])
else
AC_MSG_CHECKING([for openssl in $enableval])

Loading…
Cancel
Save