lmdb: add recipe
PATCH 1/2 lmdb: add recipe
lmdb provides a high-performance embedded transactional database in the form of a key-value store.
--- meta-oe/recipes-dbs/lmdb/files/run-ptest | 25 +++++++++++++++ meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb | 39 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 meta-oe/recipes-dbs/lmdb/files/run-ptest create mode 100644 meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb
meta-oe/recipes-dbs/lmdb/files/run-ptest new file +25 -0
@@ -0,0 +1,25 @@ +#!/bin/sh + +cd tests + +retval=0 +for t in mtest* +do + mkdir testdb + ./$t > /dev/null && ./mdb_stat testdb > /dev/null + if [ $? -ne 0 ]; then + echo "FAIL: $t" + retval=$(( ${retval} + 1)) + else + echo "PASS: $t" + fi + rm -rf testdb +done + +if [ $retval -eq 0 ] ; then + echo "PASS: lmdb" +else + echo "FAIL: lmdb" +fi + +exit $retval
meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb new file +39 -0
@@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2017-2019 Volker Krause <[email protected]> +# SPDX-FileCopyrightText: 2019 Hannah Kiekens <[email protected]> +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Lightning Memory-Mapped Database (LMDB)" +HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/" +LICENSE = "OLDAP-2.8" +LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972" + +SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1 \ + file://run-ptest \ +" + +SRCREV = "LMDB_${PV}" + +inherit base ptest + +S = "${WORKDIR}/git/libraries/liblmdb" + +LDFLAGS += "-Wl,-soname,lib${PN}.so.${PV}" + +do_compile() { + oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" +} + +do_install() { + oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" install + cd ${D}/${libdir} + ln -s liblmdb.so.${PV} liblmdb.so + rm liblmdb.a +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do + install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests + done +}
Signature · 1 line
2.25.1
PATCH 2/2 lmdb: use libprefix in Makefile to install libraries
Makefile used libdir which had hardcoded "$(exec_prefix)/lib" directory to install libraries. This is a problem for MULTILIB builds as libraries are installed in "lib64" directory. Hence use libprefix which contains the correct path for installing libraries.
--- ...file-use-libprefix-instead-of-libdir.patch | 33 +++++++++++++++++++ meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb | 5 +-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 meta-oe/recipes-dbs/lmdb/files/0001-Makefile-use-libprefix-instead-of-libdir.patch
meta-oe/recipes-dbs/lmdb/files/0001-Makefile-use-libprefix-instead-of-libdir.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 4a11d4d03ef66729d302cc122fa0c693299a7776 Mon Sep 17 00:00:00 2001 +From: Sakib Sajal <[email protected]> +Date: Wed, 18 Aug 2021 10:49:38 -0400 +Subject: [PATCH] Makefile: use libprefix instead of libdir + +libdir expands to "$(exec_prefix)/lib" where "lib" is hardcoded. +This is a problem for builds that enable MULTILIB since libraries +are to be installed in "lib64" directory. Hence allow the directory +to be configurable. + +Signed-off-by: Sakib Sajal <[email protected]> +--- + libraries/liblmdb/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index f254511..1ec74e6 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,11 +46,11 @@ all: $(ILIBS) $(PROGS) + + install: $(ILIBS) $(IPROGS) $(IHDRS) + mkdir -p $(DESTDIR)$(bindir) +- mkdir -p $(DESTDIR)$(libdir) ++ mkdir -p $(DESTDIR)$(libprefix) + mkdir -p $(DESTDIR)$(includedir) + mkdir -p $(DESTDIR)$(mandir)/man1 + for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done +- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done ++ for f in $(ILIBS); do cp $$f $(DESTDIR)$(libprefix); done + for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done + for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done +
meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb +3 -2
@@ -10,7 +10,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972" SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1 \ file://run-ptest \ -" + file://0001-Makefile-use-libprefix-instead-of-libdir.patch \ + " SRCREV = "LMDB_${PV}"
@@ -26,7 +27,7 @@ do_compile() { do_install() { oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" install - cd ${D}/${libdir} + cd ${D}${libdir} ln -s liblmdb.so.${PV} liblmdb.so rm liblmdb.a }
Signature · 1 line
2.25.1
Quoted 2 lines · Sakib Sajal
lmdb provides a high-performance embedded transactional database in the form of a key-value store.
Thanks for the patch but adding a new packages is outside the scope of stable branch maintenance.
- armin
Quoted 92 lines
Signed-off-by Sakib Sajal <[email protected]>Signed-off-by Khem Raj <[email protected]>(cherry picked from commit f658a3b40ba0491aab2da3bd9b0d2ae7123a6f90)Signed-off-by Sakib Sajal <[email protected]>--- meta-oe/recipes-dbs/lmdb/files/run-ptest | 25 +++++++++++++++ meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb | 39 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 meta-oe/recipes-dbs/lmdb/files/run-ptest create mode 100644 meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bbmeta-oe/recipes-dbs/lmdb/files/run-ptest new file +25
-0@@ -0,0 +1,25 @@ +#!/bin/sh + +cd tests + +retval=0 +for t in mtest* +do + mkdir testdb + ./$t > /dev/null && ./mdb_stat testdb > /dev/null + if [ $? -ne 0 ]; then + echo "FAIL: $t" + retval=$(( ${retval} + 1)) + else + echo "PASS: $t" + fi + rm -rf testdb +done + +if [ $retval -eq 0 ] ; then + echo "PASS: lmdb" +else + echo "FAIL: lmdb" +fi + +exit $retvalmeta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb new file +39
-0@@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2017-2019 Volker Krause <[email protected]> +# SPDX-FileCopyrightText: 2019 Hannah Kiekens <[email protected]> +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Lightning Memory-Mapped Database (LMDB)" +HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/" +LICENSE = "OLDAP-2.8" +LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972" + +SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1 \ + file://run-ptest \ +" + +SRCREV = "LMDB_${PV}" + +inherit base ptest + +S = "${WORKDIR}/git/libraries/liblmdb" + +LDFLAGS += "-Wl,-soname,lib${PN}.so.${PV}" + +do_compile() { + oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" +} + +do_install() { + oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" install + cd ${D}/${libdir} + ln -s liblmdb.so.${PV} liblmdb.so + rm liblmdb.a +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do + install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests + done +}
Quoted 9 lines · On 2021-09-13 5:50 p.m., akuster808 wrote:
[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 2 lines · Sakib Sajal
lmdb provides a high-performance embedded transactional database in the form of a key-value store.
Thanks for the patch but adding a new packages is outside the scope of stable branch maintenance.
- armin
Thanks for the information. Will try to keep in mind next time!
Sakib
Quoted 92 lines
Quoted 92 lines
Signed-off-by Sakib Sajal <[email protected]>Signed-off-by Khem Raj <[email protected]>(cherry picked from commit f658a3b40ba0491aab2da3bd9b0d2ae7123a6f90)Signed-off-by Sakib Sajal <[email protected]>--- meta-oe/recipes-dbs/lmdb/files/run-ptest | 25 +++++++++++++++ meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb | 39 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+)create mode 100644 meta-oe/recipes-dbs/lmdb/files/run-ptest create mode 100644 meta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb
meta-oe/recipes-dbs/lmdb/files/run-ptest new file +25
-0@@ -0,0 +1,25 @@ +#!/bin/sh + +cd tests + +retval=0 +for t in mtest* +do + mkdir testdb + ./$t > /dev/null && ./mdb_stat testdb > /dev/null + if [ $? -ne 0 ]; then + echo "FAIL: $t" + retval=$(( ${retval} + 1)) + else + echo "PASS: $t" + fi + rm -rf testdb +done + +if [ $retval -eq 0 ] ; then + echo "PASS: lmdb" +else + echo "FAIL: lmdb" +fi + +exit $retvalmeta-oe/recipes-dbs/lmdb/lmdb_0.9.29.bb new file +39
-0@@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2017-2019 Volker Krause <[email protected]> +# SPDX-FileCopyrightText: 2019 Hannah Kiekens <[email protected]> +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Lightning Memory-Mapped Database (LMDB)" +HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/" +LICENSE = "OLDAP-2.8" +LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972" + +SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1 \ + file://run-ptest \ +" + +SRCREV = "LMDB_${PV}" + +inherit base ptest + +S = "${WORKDIR}/git/libraries/liblmdb" + +LDFLAGS += "-Wl,-soname,lib${PN}.so.${PV}" + +do_compile() { + oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" +} + +do_install() { + oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" install + cd ${D}/${libdir} + ln -s liblmdb.so.${PV} liblmdb.so + rm liblmdb.a +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do + install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests + done +}