diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2019-11-24 09:34:22 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-11-24 07:18:11 -0800 |
commit | 661d7dea5aa4a8e4463649e6b66ca8c5f0fdff9d (patch) | |
tree | d3b930596ff753b1f832894447c63961e38c361b /meta-oe | |
parent | de76cf5d52fe09f88f135c3a16ef4c60e6f98983 (diff) | |
download | meta-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')
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 @@ | |||
1 | From c85978e77725ef233543370d24e23f853f449170 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 21 Sep 2017 17:47:02 -0700 | ||
4 | Subject: [PATCH] Makefile: Fix parallel build | ||
5 | |||
6 | Sometimes mkdir $(SHARED_OUTDIR)/db races with compiler which is | ||
7 | creating .o file in the same directory $(SHARED_OUTDIR)/db/db_bench.o | ||
8 | |||
9 | Fixes 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 | |||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | Upstream-Status: Submitted | ||
19 | |||
20 | Makefile | 4 ++-- | ||
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/Makefile b/Makefile | ||
24 | index 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 @@ | |||
1 | From 5fd0918df2bb30e8f3edb2ee895d178edbf26f40 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 4 Sep 2017 22:38:03 -0700 | ||
4 | Subject: [PATCH 1/2] build_detect_platform: Check for __SSE4_2__ | ||
5 | |||
6 | just using -msse4.2 is not enough, especially with clang | ||
7 | where it may accept -msse4.2 even during cross compiling | ||
8 | for say arm, however the difference is that builtin defines | ||
9 | wont be defined. | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | Upstream-Status: Pending | ||
14 | |||
15 | build_detect_platform | 4 ++-- | ||
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | Index: 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 @@ | |||
1 | From 1ed8cec1fcf666904bb3ebd29fc85e235b72d122 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 4 Sep 2017 22:40:49 -0700 | ||
4 | Subject: [PATCH 2/2] makefile: build SHARED_MEMENVLIB | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | --- | ||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Makefile | 6 +++--- | ||
11 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile b/Makefile | ||
14 | index 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 | -- | ||
42 | 2.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 | |||
3 | for test in *_test; do | ||
4 | if ./${test}; then | ||
5 | echo "PASS: ${test}" | ||
6 | else | ||
7 | echo "FAIL: ${test}" | ||
8 | fi | ||
9 | done | ||
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 @@ | |||
1 | SUMMARY = "LevelDB is a fast key-value storage library" | ||
2 | DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values" | ||
3 | HOMEPAGE = "https://github.com/google/leveldb" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d" | ||
6 | |||
7 | SRC_URI = "git://github.com/google/${BPN}.git \ | ||
8 | file://run-ptest" | ||
9 | |||
10 | SRCREV = "78b39d68c15ba020c0d60a3906fb66dbf1697595" | ||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | inherit cmake ptest | ||
14 | |||
15 | PACKAGECONFIG ??= "" | ||
16 | PACKAGECONFIG[benchmarks] = "-DLEVELDB_BUILD_BENCHMARKS=ON,-DLEVELDB_BUILD_BENCHMARKS=OFF,sqlite" | ||
17 | PACKAGECONFIG[snappy] = ",,snappy" | ||
18 | PACKAGECONFIG[tcmalloc] = ",,gperftools" | ||
19 | |||
20 | EXTRA_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 | |||
23 | do_install_append() { | ||
24 | install -D -m 0755 ${B}/leveldbutil ${D}${bindir}/leveldbutil | ||
25 | } | ||
26 | |||
27 | do_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 | # | ||
33 | COMPATIBLE_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 @@ | |||
1 | SUMMARY = "LevelDB is a fast key-value storage library" | ||
2 | DESCRIPTION = "LevelDB is a fast key-value storage library that provides an ordered mapping from string keys to string values" | ||
3 | HOMEPAGE = "http://leveldb.googlecode.com" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d" | ||
6 | |||
7 | SRCREV = "a53934a3ae1244679f812d998a4f16f2c7f309a6" | ||
8 | PV = "1.20+git${SRCPV}" | ||
9 | |||
10 | SRC_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 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | inherit utils | ||
19 | |||
20 | do_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 | |||
26 | do_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 | |||
36 | PACKAGES =+ "${PN}-ptest" | ||
37 | FILES_${PN}-ptest = "${bindir}" | ||
38 | |||
39 | # Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb. | ||
40 | # | ||
41 | COMPATIBLE_HOST_mipsarcho32_pn-lib32-leveldb = "null" | ||