* [Buildroot] [PATCH] cppdb: enable postgresql support
@ 2014-10-17 14:25 Gustavo Zacarias
2014-10-19 14:41 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Zacarias @ 2014-10-17 14:25 UTC (permalink / raw)
To: buildroot
Also:
Fix mysql support.
Add hash file.
Forcibly disable automatic db support when it's not selected.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
package/cppdb/Config.in | 4 ++--
.../cppdb/cppdb-0001-mysql-library-suffix.patch | 23 ++++++++++++++++++++++
package/cppdb/cppdb.hash | 3 +++
package/cppdb/cppdb.mk | 13 +++++++++++-
4 files changed, 40 insertions(+), 3 deletions(-)
create mode 100644 package/cppdb/cppdb-0001-mysql-library-suffix.patch
create mode 100644 package/cppdb/cppdb.hash
diff --git a/package/cppdb/Config.in b/package/cppdb/Config.in
index 120598a..19c9419 100644
--- a/package/cppdb/Config.in
+++ b/package/cppdb/Config.in
@@ -5,7 +5,7 @@ config BR2_PACKAGE_CPPDB
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_HAS_THREADS
# Can be built without them but it's useless
- depends on BR2_PACKAGE_MYSQL || BR2_PACKAGE_SQLITE
+ depends on BR2_PACKAGE_MYSQL || BR2_PACKAGE_POSTGRESQL || BR2_PACKAGE_SQLITE
help
CppDB is an SQL connectivity library that is designed to provide
platform and Database independent connectivity API similarly
@@ -14,6 +14,6 @@ config BR2_PACKAGE_CPPDB
http://cppcms.com/sql/cppdb/
comment "cppdb needs a toolchain w/ C++, threads, dynamic library"
- depends on BR2_PACKAGE_MYSQL || BR2_PACKAGE_SQLITE
+ depends on BR2_PACKAGE_MYSQL || BR2_PACKAGE_POSTGRESQL || BR2_PACKAGE_SQLITE
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
BR2_PREFER_STATIC_LIB
diff --git a/package/cppdb/cppdb-0001-mysql-library-suffix.patch b/package/cppdb/cppdb-0001-mysql-library-suffix.patch
new file mode 100644
index 0000000..e65e3e2
--- /dev/null
+++ b/package/cppdb/cppdb-0001-mysql-library-suffix.patch
@@ -0,0 +1,23 @@
+Add mysql/ to PATH_SUFFIXES for the library search for mysql.
+
+On common distros libmysqlclient* is installed and/or symlinked
+into /usr/lib.
+Since we install the libraries into /usr/lib/mysql alone cppdb
+fails to properly link to it giving runtime errors.
+
+Status: https://sourceforge.net/p/cppcms/bugs/135/
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+diff -Nura cppdb-0.3.1.orig/CMakeLists.txt cppdb-0.3.1/CMakeLists.txt
+--- cppdb-0.3.1.orig/CMakeLists.txt 2014-10-17 11:05:57.875429748 -0300
++++ cppdb-0.3.1/CMakeLists.txt 2014-10-17 11:12:57.486775484 -0300
+@@ -196,7 +196,7 @@
+ endif()
+
+ if(NOT DISABLE_MYSQL)
+- find_library(MYSQL_LIB mysqlclient)
++ find_library(MYSQL_LIB mysqlclient PATH_SUFFIXES mysql)
+ find_path(MYSQL_PATH mysql.h PATH_SUFFIXES mysql)
+ if(MYSQL_LIB AND MYSQL_PATH)
+ include_directories(${MYSQL_PATH})
diff --git a/package/cppdb/cppdb.hash b/package/cppdb/cppdb.hash
new file mode 100644
index 0000000..efc0eac
--- /dev/null
+++ b/package/cppdb/cppdb.hash
@@ -0,0 +1,3 @@
+# From http://sourceforge.net/projects/cppcms/files/cppdb/0.3.1/
+md5 129f1d75f46114b79160b93807d5223f cppdb-0.3.1.tar.bz2
+sha1 c0410dcc482d71696ac9206044b3a3ac03d31f96 cppdb-0.3.1.tar.bz2
diff --git a/package/cppdb/cppdb.mk b/package/cppdb/cppdb.mk
index f7f837e..2c26c90 100644
--- a/package/cppdb/cppdb.mk
+++ b/package/cppdb/cppdb.mk
@@ -14,7 +14,18 @@ CPPDB_LICENSE_FILES = LICENSE_1_0.txt MIT.txt
ifeq ($(BR2_PACKAGE_MYSQL),y)
CPPDB_DEPENDENCIES += mysql
-CPPDB_CONF_OPTS += -DMYSQL_LIB=$(STAGING_DIR)/usr/lib/mysql
+else
+CPPDB_CONF_OPTS += -DDISABLE_MYSQL=ON
+endif
+
+ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
+CPPDB_DEPENDENCIES += postgresql
+else
+CPPDB_CONF_OPTS += -DDISABLE_PQ=ON
+endif
+
+ifeq ($(BR2_PACKAGE_SQLITE),)
+CPPDB_CONF_OPTS += -DDISABLE_SQLITE=ON
endif
$(eval $(cmake-package))
--
2.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] cppdb: enable postgresql support
2014-10-17 14:25 [Buildroot] [PATCH] cppdb: enable postgresql support Gustavo Zacarias
@ 2014-10-19 14:41 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2014-10-19 14:41 UTC (permalink / raw)
To: buildroot
Dear Gustavo Zacarias,
On Fri, 17 Oct 2014 11:25:54 -0300, Gustavo Zacarias wrote:
> Also:
> Fix mysql support.
> Add hash file.
> Forcibly disable automatic db support when it's not selected.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
> package/cppdb/Config.in | 4 ++--
> .../cppdb/cppdb-0001-mysql-library-suffix.patch | 23 ++++++++++++++++++++++
> package/cppdb/cppdb.hash | 3 +++
> package/cppdb/cppdb.mk | 13 +++++++++++-
> 4 files changed, 40 insertions(+), 3 deletions(-)
> create mode 100644 package/cppdb/cppdb-0001-mysql-library-suffix.patch
> create mode 100644 package/cppdb/cppdb.hash
Applied, thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-19 14:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 14:25 [Buildroot] [PATCH] cppdb: enable postgresql support Gustavo Zacarias
2014-10-19 14:41 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox