1# SPDX-FileCopyrightText: 2017-2019 Volker Krause <vkrause@kde.org>
2# SPDX-FileCopyrightText: 2019 Hannah Kiekens <hannahkiekens@gmail.com>
3#
4# SPDX-License-Identifier: MIT
5
6SUMMARY = "Lightning Memory-Mapped Database (LMDB)"
7HOMEPAGE = "https://symas.com/lightning-memory-mapped-database/"
8LICENSE = "OLDAP-2.8"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972"
10
11SRC_URI = "git://github.com/LMDB/lmdb.git;nobranch=1;protocol=https \
12           file://run-ptest \
13           file://0001-Makefile-use-libprefix-instead-of-libdir.patch \
14           file://0001-make-set-soname-on-liblmdb.patch;patchdir=../.. \
15           "
16
17SRCREV = "ce201088de95d26fc0da36ba805bf2ddc2ba74ff"
18
19inherit ptest
20
21S = "${WORKDIR}/git/libraries/liblmdb"
22
23do_compile() {
24    oe_runmake CC="${CC}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}"
25}
26
27do_install() {
28    oe_runmake CC="${CC}" DESTDIR="${D}" prefix="${prefix}" libprefix="${libdir}" manprefix="${mandir}" SOEXT=".so.${PV}" LDFLAGS="${LDFLAGS}" XCFLAGS="${CFLAGS}" install
29    cd ${D}${libdir}
30    ln -s liblmdb.so.${PV} liblmdb.so
31    rm liblmdb.a
32}
33
34do_install_ptest() {
35    install -d ${D}${PTEST_PATH}/tests
36    for test in mtest mtest2 mtest3 mtest4 mtest5 mdb_stat; do
37        install -m 755 ${S}/$test ${D}${PTEST_PATH}/tests
38    done
39}
40