File system-libs.patch of Package mongodb

diff --git a/SConstruct b/SConstruct
index f4a01cc..8dfd3e6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -203,7 +203,7 @@ add_option('wiredtiger',
     type='choice',
 )
 
-js_engine_choices = ['mozjs', 'none']
+js_engine_choices = ['mozjs', 'none', 'mozjs-45']
 add_option('js-engine',
     choices=js_engine_choices,
     default=js_engine_choices[0],
@@ -369,6 +369,11 @@ add_option('use-system-icu',
     nargs=0,
 )
 
+add_option('use-system-mozjs',
+    help="use system version of mozjs",
+    nargs=0,
+)
+
 add_option('use-system-intel_decimal128',
     help='use system version of intel decimal128',
     nargs=0,
@@ -2706,11 +2711,21 @@ def doConfigure(myenv):
         conf.env['LIBDEPS_ICUI18N_SYSLIBDEP'] = 'icui18n'
         conf.env['LIBDEPS_ICUUC_SYSLIBDEP'] = 'icuuc'
 
+    if use_system_version_of_library("mozjs"):
+        conf.FindSysLibDep("mozjs", [jsEngine])
+
+    if use_system_version_of_library("icu"):
+        conf.FindSysLibDep("icui18n", ["icui18n"])
+        conf.FindSysLibDep("icuuc", ["icuuc"])
+
     if wiredtiger and use_system_version_of_library("wiredtiger"):
         if not conf.CheckCXXHeader( "wiredtiger.h" ):
             myenv.ConfError("Cannot find wiredtiger headers")
         conf.FindSysLibDep("wiredtiger", ["wiredtiger"])
 
+    if use_system_version_of_library("asio"):
+        conf.CheckCXXHeader("asio.hpp")
+
     conf.env.Append(
         CPPDEFINES=[
             ("BOOST_THREAD_VERSION", "4"),
@@ -2938,7 +2953,7 @@ Export("env")
 Export("get_option")
 Export("has_option use_system_version_of_library")
 Export("serverJs")
-Export("usemozjs")
+Export("usemozjs jsEngine")
 Export('module_sconscripts')
 Export("debugBuild optBuild")
 Export("wiredtiger")
diff --git a/src/mongo/db/query/collation/collator_interface_icu.h b/src/mongo/db/query/collation/collator_interface_icu.h
index 9bb8382..7607462 100644
--- a/src/mongo/db/query/collation/collator_interface_icu.h
+++ b/src/mongo/db/query/collation/collator_interface_icu.h
@@ -31,10 +31,7 @@
 #include "mongo/db/query/collation/collator_interface.h"
 
 #include <memory>
-
-namespace icu {
-class Collator;
-}  // namespace icu
+#include <unicode/coll.h>
 
 namespace mongo {
 
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 3a82039..fded563 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -1,6 +1,6 @@
 # -*- mode: python -*-
 
-Import("env use_system_version_of_library usemozjs get_option")
+Import("env use_system_version_of_library usemozjs jsEngine get_option")
 Import("wiredtiger")
 
 boostSuffix = "-1.60.0"
@@ -45,13 +45,15 @@ if not use_system_version_of_library('zlib'):
 # TODO: figure out if we want to offer system versions of mozjs.  Mozilla
 # hasn't offered a source tarball since 24, but in theory they could.
 #
-#if not use_system_version_of_library('mozjs'):
-if True:
+if not use_system_version_of_library('mozjs'):
     thirdPartyIncludePathList.append(
         ('mozjs', ['#/src/third_party/mozjs' + mozjsSuffix + '/include',
                    '#/src/third_party/mozjs' + mozjsSuffix + '/mongo_sources',
                    '#/src/third_party/mozjs' + mozjsSuffix + '/platform/' + env["TARGET_ARCH"] + "/" + env["TARGET_OS"] + "/include",
         ]))
+else:
+    thirdPartyIncludePathList.append(
+        ('mozjs', ['#/src/third_party/mozjs' + mozjsSuffix + '/mongo_sources', '/usr/include/'+jsEngine, ]))
 
 if not use_system_version_of_library('stemmer'):
     thirdPartyIncludePathList.append(
@@ -210,13 +212,20 @@ zlibEnv.Library(
     ])
 
 if usemozjs:
-    mozjsEnv = env.Clone()
-    mozjsEnv.SConscript('mozjs' + mozjsSuffix + '/SConscript', exports={'env' : mozjsEnv })
-    mozjsEnv = mozjsEnv.Clone(
-        LIBDEPS=[
-            'mozjs' + mozjsSuffix + '/mozjs',
-            'shim_zlib',
-        ])
+    if use_system_version_of_library("mozjs"):
+        env.InjectThirdPartyIncludePaths(libraries=['mozjs'])
+        mozjsEnv = env.Clone(
+            SYSLIBDEPS=[
+                env['LIBDEPS_MOZJS_SYSLIBDEP'],
+            ])
+    else:
+        mozjsEnv = env.Clone()
+        mozjsEnv.SConscript('mozjs' + mozjsSuffix + '/SConscript', exports={'env' : mozjsEnv })
+        mozjsEnv = mozjsEnv.Clone(
+            LIBDEPS=[
+                'mozjs' + mozjsSuffix + '/mozjs',
+                'shim_zlib',
+            ])
 
     mozjsEnv.Library(
         target="shim_mozjs",
openSUSE Build Service is sponsored by