summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mongodb
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2014-02-04 13:52:50 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2014-02-18 09:22:39 +0100
commit433c76d221dc77151f15b3427f30ca4f857347e6 (patch)
tree0bc1fb4fd82f277f7865de7f94c00969b18df8ef /meta-oe/recipes-support/mongodb
parent6d7b3097b4084d5ffdfac0cee2fba2c825a7a827 (diff)
downloadmeta-openembedded-433c76d221dc77151f15b3427f30ca4f857347e6.tar.gz
mongodb: add git version
This builds the server and the sharding helper, but not the CLI. The CLI will need a libv8 recipe since fixing the built-in copy to cross build is too much work. Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/mongodb')
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch49
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch50
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch25
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch64
-rw-r--r--meta-oe/recipes-support/mongodb/mongodb_git.bb38
5 files changed, 226 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch
new file mode 100644
index 000000000..311ac6cad
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0001-Make-it-possible-to-disable-the-use-of-v8.patch
@@ -0,0 +1,49 @@
1From bffde38f3b3d6285019e38a30c4573326e1dd2ea Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Fri, 20 Dec 2013 11:10:43 +1300
4Subject: [PATCH 1/3] Make it possible to disable the use of v8.
5
6Currently v8 is always built in, no matter what you pass to scons.
7
8This removes the (useless) --usev8 flag for scons and replaces it with a
9--disable-scripting option instead.
10---
11 SConstruct | 8 +++++---
12 1 file changed, 5 insertions(+), 3 deletions(-)
13
14diff --git a/SConstruct b/SConstruct
15index fd92fe4..1f14083 100644
16--- a/SConstruct
17+++ b/SConstruct
18@@ -222,7 +222,7 @@ add_option( "asio" , "Use Asynchronous IO (NOT READY YET)" , 0 , True )
19 add_option( "ssl" , "Enable SSL" , 0 , True )
20
21 # library choices
22-add_option( "usev8" , "use v8 for javascript" , 0 , True )
23+add_option( "disable-scripting" , "do not build support for javascript" , 0 , True )
24 add_option( "libc++", "use libc++ (experimental, requires clang)", 0, True )
25
26 # mongo feature options
27@@ -439,7 +439,7 @@ static = has_option( "static" )
28
29 noshell = has_option( "noshell" )
30
31-usev8 = has_option( "usev8" )
32+disable_scripting = has_option( "disable-scripting" )
33
34 asio = has_option( "asio" )
35
36@@ -599,7 +599,9 @@ if has_option( "durableDefaultOn" ):
37 if has_option( "durableDefaultOff" ):
38 env.Append( CPPDEFINES=[ "_DURABLEDEFAULTOFF" ] )
39
40-if ( not ( usev8 or justClientLib) ):
41+if disable_scripting or justClientLib:
42+ usev8 = False
43+else:
44 usev8 = True
45
46 extraLibPlaces = []
47--
481.8.4.2
49
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch b/meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch
new file mode 100644
index 000000000..547c3bd48
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch
@@ -0,0 +1,50 @@
1From ef482650fb6d990e4953104d7141d9a0fa4c872f Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Tue, 4 Feb 2014 10:56:35 +0100
4Subject: [PATCH] replace os.uname with os.getenv(OE_TARGET_ARCH)
5
6This fixes crosscompilation
7
8Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
9Upstream-Status: Inappropiate [OE specific]
10---
11 SConstruct | 8 ++++----
12 1 file changed, 4 insertions(+), 4 deletions(-)
13
14diff --git a/SConstruct b/SConstruct
15index 4f26be7..a353323 100644
16--- a/SConstruct
17+++ b/SConstruct
18@@ -265,9 +265,9 @@ add_option( "pch" , "use precompiled headers to speed up the build (experimental
19 add_option( "distcc" , "use distcc for distributing builds" , 0 , False )
20
21 # debugging/profiling help
22-if os.sys.platform.startswith("linux") and (os.uname()[-1] == 'x86_64'):
23+if os.sys.platform.startswith("linux") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'):
24 defaultAllocator = 'tcmalloc'
25-elif (os.sys.platform == "darwin") and (os.uname()[-1] == 'x86_64'):
26+elif (os.sys.platform == "darwin") and (os.getenv("OE_TARGET_ARCH") == 'x86_64'):
27 defaultAllocator = 'tcmalloc'
28 else:
29 defaultAllocator = 'system'
30@@ -673,7 +673,7 @@ if has_option( "full" ):
31 # ---- other build setup -----
32
33 if "uname" in dir(os):
34- processor = os.uname()[4]
35+ processor = os.getenv("OE_TARGET_ARCH")
36 else:
37 processor = "i386"
38
39@@ -702,7 +702,7 @@ elif linux:
40
41 env.Append( LIBS=['m'] )
42
43- if os.uname()[4] == "x86_64" and not force32:
44+ if os.getenv("OE_TARGET_ARCH") == "x86_64" and not force32:
45 linux64 = True
46 nixLibPrefix = "lib64"
47 env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] )
48--
491.8.4.2
50
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch
new file mode 100644
index 000000000..d8d5a3bf7
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0002-Fix-linking-when-scripting-is-disabled.patch
@@ -0,0 +1,25 @@
1From 52d68642205626cad3bac3a53e269c765ccff676 Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Fri, 20 Dec 2013 12:28:27 +1300
4Subject: [PATCH 2/3] Fix linking when scripting is disabled.
5
6---
7 src/mongo/scripting/engine_none.cpp | 4 ++++
8 1 file changed, 4 insertions(+)
9
10diff --git a/src/mongo/scripting/engine_none.cpp b/src/mongo/scripting/engine_none.cpp
11index f5c7109..9ae9d57 100644
12--- a/src/mongo/scripting/engine_none.cpp
13+++ b/src/mongo/scripting/engine_none.cpp
14@@ -33,4 +33,8 @@ namespace mongo {
15 void ScriptEngine::setup() {
16 // noop
17 }
18+
19+ std::string ScriptEngine::getInterpreterVersionString() {
20+ return "none";
21+ }
22 }
23--
241.8.4.2
25
diff --git a/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch
new file mode 100644
index 000000000..5c314b189
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb/0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch
@@ -0,0 +1,64 @@
1From 1f8e10747af3988e8ddee609bea990f622dd746a Mon Sep 17 00:00:00 2001
2From: Michael Hudson-Doyle <michael.hudson@linaro.org>
3Date: Wed, 22 Jan 2014 13:53:10 +1300
4Subject: [PATCH 3/3] * Do not build 'mongo' binary when scripting is disabled
5 * Do not build the jstests when scripting is disabled
6
7---
8 SConstruct | 8 ++++++--
9 src/mongo/SConscript | 4 +++-
10 2 files changed, 9 insertions(+), 3 deletions(-)
11
12diff --git a/SConstruct b/SConstruct
13index 1f14083..a69cf0a 100644
14--- a/SConstruct
15+++ b/SConstruct
16@@ -437,10 +437,13 @@ else:
17
18 static = has_option( "static" )
19
20-noshell = has_option( "noshell" )
21-
22 disable_scripting = has_option( "disable-scripting" )
23
24+if not disable_scripting:
25+ noshell = has_option( "noshell" )
26+else:
27+ noshell = True
28+
29 asio = has_option( "asio" )
30
31 usePCH = has_option( "usePCH" )
32@@ -1671,6 +1674,7 @@ Export("get_option")
33 Export("has_option use_system_version_of_library")
34 Export("installSetup mongoCodeVersion")
35 Export("usev8")
36+Export("disable_scripting")
37 Export("darwin windows solaris linux freebsd nix")
38 Export('module_sconscripts')
39 Export("debugBuild optBuild")
40diff --git a/src/mongo/SConscript b/src/mongo/SConscript
41index d84267e..dc0ca3a 100644
42--- a/src/mongo/SConscript
43+++ b/src/mongo/SConscript
44@@ -6,6 +6,7 @@ import os
45 import itertools
46 from buildscripts import utils
47
48+Import("disable_scripting")
49 Import("env")
50 Import("shellEnv")
51 Import("testEnv")
52@@ -1022,7 +1023,8 @@ test = testEnv.Install(
53 [ f for f in Glob("dbtests/*.cpp")
54 if not str(f).endswith('framework.cpp') and
55 not str(f).endswith('framework_options.cpp') and
56- not str(f).endswith('framework_options_init.cpp') ],
57+ not str(f).endswith('framework_options_init.cpp') and
58+ not (str(f).endswith('jstests.cpp') and disable_scripting)],
59 LIBDEPS = [
60 "mutable_bson_test_utils",
61 "mongocommon",
62--
631.8.4.2
64
diff --git a/meta-oe/recipes-support/mongodb/mongodb_git.bb b/meta-oe/recipes-support/mongodb/mongodb_git.bb
new file mode 100644
index 000000000..f0fe2402f
--- /dev/null
+++ b/meta-oe/recipes-support/mongodb/mongodb_git.bb
@@ -0,0 +1,38 @@
1SUMMARY = "mongodb"
2LICENSE = "AGPLv3 & Apache-2.0"
3LIC_FILES_CHKSUM = "file://GNU-AGPL-3.0.txt;md5=73f1eb20517c55bf9493b7dd6e480788 \
4 file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
5
6DEPENDS = "openssl libpcre boost"
7# Mongo uses tcmalloc on x86_64, which is provided by gperftools
8DEPENDS_append_x86-64 = " gperftools"
9
10inherit scons
11
12PV = "2.5.5+git${SRCPV}"
13SRCREV = "588dc81b0822ebb46f80e152b94527a882e6ea5e"
14SRC_URI = "git://github.com/mongodb/mongo.git \
15 file://0001-Make-it-possible-to-disable-the-use-of-v8.patch \
16 file://0002-Fix-linking-when-scripting-is-disabled.patch \
17 file://0003-Do-not-build-mongo-binary-when-scripting-is-disabled.patch \
18 file://0001-replace-os.uname-with-os.getenv-TARGET_ARCH.patch \
19 "
20
21S = "${WORKDIR}/git"
22
23export OE_TARGET_ARCH="${TARGET_ARCH}"
24
25EXTRA_OESCONS = "--prefix=${D}${prefix} \
26 --propagate-shell-environment \
27 --cc-use-shell-environment \
28 --cxx-use-shell-environment \
29 --ld='${TARGET_PREFIX}g++' \
30 --ssl \
31 --use-system-pcre \
32 --use-system-boost \
33 --use-system-tcmalloc \
34 --disable-scripting \
35 --nostrip \
36 mongod mongos"
37
38