summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2019-11-24 09:34:22 +0000
committerKhem Raj <raj.khem@gmail.com>2019-11-24 07:18:11 -0800
commit661d7dea5aa4a8e4463649e6b66ca8c5f0fdff9d (patch)
treed3b930596ff753b1f832894447c63961e38c361b /meta-oe
parentde76cf5d52fe09f88f135c3a16ef4c60e6f98983 (diff)
downloadmeta-openembedded-661d7dea5aa4a8e4463649e6b66ca8c5f0fdff9d.tar.gz
leveldb: Upgrade 1.20 -> 1.22
Upstream has moved to cmake, so drop the build patches which are no longer relevant. Add run-ptest and PACKAGECONFIG support. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch34
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch37
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch43
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb/run-ptest10
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb_1.22.bb33
-rw-r--r--meta-oe/recipes-dbs/leveldb/leveldb_git.bb41
6 files changed, 43 insertions, 155 deletions
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch b/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch
deleted file mode 100644
index 3135d4d5a..000000000
--- a/meta-oe/recipes-dbs/leveldb/leveldb/0001-Makefile-Fix-parallel-build.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From c85978e77725ef233543370d24e23f853f449170 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 21 Sep 2017 17:47:02 -0700
4Subject: [PATCH] Makefile: Fix parallel build
5
6Sometimes mkdir $(SHARED_OUTDIR)/db races with compiler which is
7creating .o file in the same directory $(SHARED_OUTDIR)/db/db_bench.o
8
9Fixes error like
10
11| mkdir out-static
12| mkdir out-shared/db
13| Assembler messages:
14| Fatal error: can't create out-shared/db/db_bench.o: No such file or directory
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18Upstream-Status: Submitted
19
20 Makefile | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/Makefile b/Makefile
24index f7cc7d7..51a0bcd 100644
25--- a/Makefile
26+++ b/Makefile
27@@ -386,6 +386,7 @@ $(STATIC_OUTDIR)/write_batch_test:db/write_batch_test.cc $(STATIC_LIBOBJECTS) $(
28 $(STATIC_OUTDIR)/memenv_test:$(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS)
29 $(XCRUN) $(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) -o $@ $(LIBS)
30
31+$(SHARED_OUTDIR)/db/db_bench.o: | $(SHARED_OUTDIR)/db
32 $(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL)
33 $(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_OUTDIR)/db/db_bench.o $(TESTUTIL) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS)
34
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch b/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch
deleted file mode 100644
index 8f93cb325..000000000
--- a/meta-oe/recipes-dbs/leveldb/leveldb/0001-build_detect_platform-Check-for-__SSE4_2__.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 5fd0918df2bb30e8f3edb2ee895d178edbf26f40 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 4 Sep 2017 22:38:03 -0700
4Subject: [PATCH 1/2] build_detect_platform: Check for __SSE4_2__
5
6just using -msse4.2 is not enough, especially with clang
7where it may accept -msse4.2 even during cross compiling
8for say arm, however the difference is that builtin defines
9wont be defined.
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13Upstream-Status: Pending
14
15 build_detect_platform | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18Index: git/build_detect_platform
19===================================================================
20--- git.orig/build_detect_platform
21+++ git/build_detect_platform
22@@ -224,13 +224,13 @@ EOF
23 rm -f $CXXOUTPUT 2>/dev/null
24
25 # Test if gcc SSE 4.2 is supported
26- $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -msse4.2 2>/dev/null <<EOF
27+ $CXX $CXXFLAGS -Werror -x c++ - -o $CXXOUTPUT -msse4.2 -dD -E 2>/dev/null <<EOF
28 int main() {}
29 EOF
30+ eval fgrep __SSE4_2__ $CXXOUTPUT >/dev/null 2>&1
31 if [ "$?" = 0 ]; then
32 PLATFORM_SSEFLAGS="-msse4.2"
33 fi
34-
35 rm -f $CXXOUTPUT 2>/dev/null
36 fi
37
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch b/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch
deleted file mode 100644
index fc708b23a..000000000
--- a/meta-oe/recipes-dbs/leveldb/leveldb/0002-makefile-build-SHARED_MEMENVLIB.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 1ed8cec1fcf666904bb3ebd29fc85e235b72d122 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 4 Sep 2017 22:40:49 -0700
4Subject: [PATCH 2/2] makefile: build SHARED_MEMENVLIB
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8Upstream-Status: Pending
9
10 Makefile | 6 +++---
11 1 file changed, 3 insertions(+), 3 deletions(-)
12
13diff --git a/Makefile b/Makefile
14index f7cc7d7..cb42278 100644
15--- a/Makefile
16+++ b/Makefile
17@@ -126,12 +126,12 @@ SHARED_VERSION_MINOR = 20
18 SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)
19 SHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR)
20 SHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)
21-SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3)
22+SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3) $(SHARED_MEMENVLIB)
23 $(SHARED_OUTDIR)/$(SHARED_LIB1): $(SHARED_OUTDIR)/$(SHARED_LIB3)
24 ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1)
25 $(SHARED_OUTDIR)/$(SHARED_LIB2): $(SHARED_OUTDIR)/$(SHARED_LIB3)
26 ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB2)
27-SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a
28+SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.$(PLATFORM_SHARED_EXT).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)
29 endif
30
31 $(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS)
32@@ -294,7 +294,7 @@ endif
33
34 $(SHARED_MEMENVLIB):$(SHARED_MEMENVOBJECTS)
35 rm -f $@
36- $(AR) -rs $@ $(SHARED_MEMENVOBJECTS)
37+ $(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(basename $(notdir $(SHARED_MEMENVLIB))) $(SHARED_MEMENVOBJECTS) -o $(SHARED_MEMENVLIB) $(LIBS)
38
39 $(STATIC_OUTDIR)/db_bench:db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)
40 $(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ $(LIBS)
41--
422.14.1
43
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb/run-ptest b/meta-oe/recipes-dbs/leveldb/leveldb/run-ptest
new file mode 100644
index 000000000..9ae70c128
--- /dev/null
+++ b/meta-oe/recipes-dbs/leveldb/leveldb/run-ptest
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3for test in *_test; do
4 if ./${test}; then
5 echo "PASS: ${test}"
6 else
7 echo "FAIL: ${test}"
8 fi
9done
10
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb_1.22.bb b/meta-oe/recipes-dbs/leveldb/leveldb_1.22.bb
new file mode 100644
index 000000000..b597ef1ea
--- /dev/null
+++ b/meta-oe/recipes-dbs/leveldb/leveldb_1.22.bb
@@ -0,0 +1,33 @@
1SUMMARY = "LevelDB is a fast key-value storage library"
2DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values"
3HOMEPAGE = "https://github.com/google/leveldb"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
6
7SRC_URI = "git://github.com/google/${BPN}.git \
8 file://run-ptest"
9
10SRCREV = "78b39d68c15ba020c0d60a3906fb66dbf1697595"
11S = "${WORKDIR}/git"
12
13inherit cmake ptest
14
15PACKAGECONFIG ??= ""
16PACKAGECONFIG[benchmarks] = "-DLEVELDB_BUILD_BENCHMARKS=ON,-DLEVELDB_BUILD_BENCHMARKS=OFF,sqlite"
17PACKAGECONFIG[snappy] = ",,snappy"
18PACKAGECONFIG[tcmalloc] = ",,gperftools"
19
20EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH=ON \
21 -DLEVELDB_BUILD_TESTS=${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'ON', 'OFF', d)}"
22
23do_install_append() {
24 install -D -m 0755 ${B}/leveldbutil ${D}${bindir}/leveldbutil
25}
26
27do_install_ptest() {
28 install -m 0755 ${B}/*_test ${D}${PTEST_PATH}
29}
30
31# Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb.
32#
33COMPATIBLE_HOST_mipsarcho32_pn-lib32-leveldb = "null"
diff --git a/meta-oe/recipes-dbs/leveldb/leveldb_git.bb b/meta-oe/recipes-dbs/leveldb/leveldb_git.bb
deleted file mode 100644
index 908ad3e6b..000000000
--- a/meta-oe/recipes-dbs/leveldb/leveldb_git.bb
+++ /dev/null
@@ -1,41 +0,0 @@
1SUMMARY = "LevelDB is a fast key-value storage library"
2DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values"
3HOMEPAGE = "http://leveldb.googlecode.com"
4LICENSE = "BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
6
7SRCREV = "a53934a3ae1244679f812d998a4f16f2c7f309a6"
8PV = "1.20+git${SRCPV}"
9
10SRC_URI = "git://github.com/google/${BPN}.git \
11 file://0001-build_detect_platform-Check-for-__SSE4_2__.patch \
12 file://0002-makefile-build-SHARED_MEMENVLIB.patch \
13 file://0001-Makefile-Fix-parallel-build.patch \
14 "
15
16S = "${WORKDIR}/git"
17
18inherit utils
19
20do_compile() {
21 # do not use oe_runmake. oe_runmake pass to make compilation arguments and override
22 # leveldb makefile variable CFLAGS and broke leveldb build.
23 CFLAGS="${CFLAGS}" make ${PARALLEL_MAKE}|| die
24}
25
26do_install() {
27 install -d ${D}${libdir} ${D}${bindir} ${D}${includedir}/leveldb
28 oe_libinstall -C ${B}/out-shared libleveldb ${D}${libdir}
29 oe_libinstall -C ${S}/out-static libleveldb ${D}${libdir}
30 oe_libinstall -C ${S}/out-static libmemenv ${D}${libdir}
31 install -m 0755 ${B}/out-shared/db_bench ${D}${bindir}
32 install -m 0755 ${B}/out-static/*_test ${D}${bindir}
33 install -m 644 ${S}/include/leveldb/*.h ${D}${includedir}/leveldb/
34}
35
36PACKAGES =+ "${PN}-ptest"
37FILES_${PN}-ptest = "${bindir}"
38
39# Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb.
40#
41COMPATIBLE_HOST_mipsarcho32_pn-lib32-leveldb = "null"