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