diff options
| author | Khem Raj <raj.khem@gmail.com> | 2015-03-13 03:07:14 +0000 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-03-21 16:42:23 +0100 |
| commit | 9f92d9d3fed93b2052d4e2a1a4e5e73f34f2f44a (patch) | |
| tree | 9800b6d0d7c22f1572175ca36ad99322fca32baf | |
| parent | ccd12ac24cf41d483738a01dc4accae4bca7cddd (diff) | |
| download | meta-openembedded-9f92d9d3fed93b2052d4e2a1a4e5e73f34f2f44a.tar.gz | |
soci: Add recipe
Define PACKAGECONFIG to enable a given backend of choice
by default its 'empty'
Change-Id: Ie1123af658ca94d2fe22a3ca1a32dfb47d58979e
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/soci/soci/soci_libdir.patch | 28 | ||||
| -rw-r--r-- | meta-oe/recipes-support/soci/soci_3.2.2.bb | 48 |
2 files changed, 76 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/soci/soci/soci_libdir.patch b/meta-oe/recipes-support/soci/soci/soci_libdir.patch new file mode 100644 index 0000000000..00a1a5c862 --- /dev/null +++ b/meta-oe/recipes-support/soci/soci/soci_libdir.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | Define SOCI_LIBDIR only if its not passed via environemnt. In OE we | ||
| 2 | want to set it per our choice since we use 'lib' for 64bit unless we | ||
| 3 | are using multilib | ||
| 4 | |||
| 5 | -Khem | ||
| 6 | |||
| 7 | Index: soci-3.2.2/CMakeLists.txt | ||
| 8 | =================================================================== | ||
| 9 | --- soci-3.2.2.orig/CMakeLists.txt | ||
| 10 | +++ soci-3.2.2/CMakeLists.txt | ||
| 11 | @@ -69,11 +69,12 @@ include(SociDependencies) | ||
| 12 | ############################################################################### | ||
| 13 | # Installation | ||
| 14 | ############################################################################### | ||
| 15 | - | ||
| 16 | -if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| 17 | - set(SOCI_LIBDIR "lib") | ||
| 18 | -else() | ||
| 19 | - set(SOCI_LIBDIR "lib64") | ||
| 20 | +if(NOT DEFINED SOCI_LIBDIR) | ||
| 21 | + if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| 22 | + set(SOCI_LIBDIR "lib") | ||
| 23 | + else() | ||
| 24 | + set(SOCI_LIBDIR "lib") | ||
| 25 | + endif() | ||
| 26 | endif() | ||
| 27 | |||
| 28 | set(BINDIR "bin" CACHE PATH "The directory to install binaries into.") | ||
diff --git a/meta-oe/recipes-support/soci/soci_3.2.2.bb b/meta-oe/recipes-support/soci/soci_3.2.2.bb new file mode 100644 index 0000000000..887f5a2b2b --- /dev/null +++ b/meta-oe/recipes-support/soci/soci_3.2.2.bb | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # Copyright (C) 2015 Khem Raj <raj.khem@gmail.com> | ||
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
| 3 | |||
| 4 | DESCRIPTION = "The C++ Database Access Library" | ||
| 5 | HOMEPAGE = "http://soci.sourceforge.net" | ||
| 6 | LICENSE = "BSL-1.0" | ||
| 7 | LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c" | ||
| 8 | SECTION = "libs" | ||
| 9 | DEPENDS = "boost" | ||
| 10 | |||
| 11 | |||
| 12 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${P}/${P}.tar.gz \ | ||
| 13 | file://soci_libdir.patch \ | ||
| 14 | " | ||
| 15 | SRC_URI[md5sum] = "bc3c35f6cd3f80a1be19fe30b3c111bf" | ||
| 16 | SRC_URI[sha256sum] = "30ea2f4d26639ef5b5cdc24fb300b3896746243dbb77b743582de2ff443ccb1c" | ||
| 17 | |||
| 18 | TESTCONFIG = '-DSOCI_TEST_EMPTY_CONNSTR="dummy" -DSOCI_TEST_SQLITE3_CONNSTR="test.db" \ | ||
| 19 | -DSOCI_TEST_POSTGRESQL_CONNSTR:STRING="dbname=soci_test" \ | ||
| 20 | -DSOCI_TEST_MYSQL_CONNSTR:STRING="db=soci_test user=oe password=oe"' | ||
| 21 | |||
| 22 | OBASEDIR ?= "/opt/oracle" | ||
| 23 | OINCDIR = "rdbms/public" | ||
| 24 | OLIBDIR = "lib" | ||
| 25 | |||
| 26 | PACKAGECONFIG[sqlite3] = "-DSOCI_SQLITE3=ON,-DSOCI_SQLITE3=OFF,sqlite3," | ||
| 27 | PACKAGECONFIG[mysql] = "-DSOCI_MYSQL=ON,-DSOCI_MYSQL=OFF,mariadb," | ||
| 28 | PACKAGECONFIG[postgresql] = "-DSOCI_POSTGRESQL=ON,-DSOCI_POSTGRESQL=OFF,postgresql," | ||
| 29 | PACKAGECONFIG[odbc] = "-DSOCI_ODBC=ON,-DSOCI_ODBC=OFF,," | ||
| 30 | PACKAGECONFIG[empty] = "-DSOCI_EMPTY=ON,-DSOCI_EMPTY=OFF,," | ||
| 31 | PACKAGECONFIG[oracle] = "-DWITH_ORACLE=ON --with-oracle-include=${OINCDIR} --with-oracle-lib=${OLIBDIR},-DWITH_ORACLE=OFF,," | ||
| 32 | PACKAGECONFIG[ptest] = "${TESTCONFIG},,," | ||
| 33 | |||
| 34 | # enable your backend by default we enable 'empty' | ||
| 35 | PACKAGECONFIG ??= "empty" | ||
| 36 | |||
| 37 | # Take the flags added by PACKAGECONFIG and pass them to cmake. | ||
| 38 | EXTRA_OECMAKE = "${EXTRA_OECONF} -DSOCI_LIBDIR=${libdir}" | ||
| 39 | |||
| 40 | inherit cmake | ||
| 41 | |||
| 42 | PACKAGES += "${PN}-sqlite3 ${PN}-mysql ${PN}-postgresql ${PN}-odbc ${PN}-oracle" | ||
| 43 | |||
| 44 | FILES_${PN}-sqlite3 = "${libdir}/lib${BPN}_sqlite3.so.*" | ||
| 45 | FILES_${PN}-mysql = "${libdir}/lib${BPN}_mysql.so.*" | ||
| 46 | FILES_${PN}-postgresql = "${libdir}/lib${BPN}_postgresql.so.*" | ||
| 47 | FILES_${PN}-odbc = "${libdir}/lib${BPN}_odbc.so.*" | ||
| 48 | FILES_${PN}-oracle = "${libdir}/lib${BPN}_oracle.so.*" | ||
