~xdavidwu/apkbuilds

d6b266a75f91bb52966fc8f0d4a7ecbb445f25f5 — xdavidwu 2 years ago f6e2997
mongodb: import from aports/non-free
A mongodb/APKBUILD => mongodb/APKBUILD +56 -0
@@ 0,0 1,56 @@
# Maintainer: Mikael Jenkler <info@jenkler.se>
pkgname=mongodb
pkgver=4.2.9
pkgrel=0
pkgdesc="A high-performance, open source, schema-free document-oriented database"
url="http://www.mongodb.org"
arch="x86_64"
options="!check"
license='SSPL-1.0'
makedepends="asio-dev boost-dev curl-dev cyrus-sasl-dev libpcap-dev openssl-dev pcre-dev
	py3-cheetah py3-psutil py3-setuptools py3-yaml snappy-dev snowball-dev scons yaml-cpp-dev zlib-dev"
source="http://downloads.mongodb.org/src/mongodb-src-r$pkgver.tar.gz
	fix-backtrace.patch
	fix-default-stacksize.patch
	fix-elf-native-class.patch
	fix-kms_request.patch
	fix-mozjs.patch
	fix-processinfo_linux.patch
	fix-resolv.patch
	fix-strerror_r.patch
	fix-wiredtiger.patch
"

builddir="$srcdir"/$pkgname-src-r$pkgver

build() {
	export SCONSFLAGS="$MAKEFLAGS"
	scons --prefix=/usr \
		--allocator=system \
		--disable-warnings-as-errors \
		--ssl \
		--use-sasl-client \
		--use-system-boost \
		--use-system-pcre \
		--use-system-snappy \
		--use-system-stemmer \
		--use-system-yaml \
		--use-system-zlib \
		mongo mongod
}

package() {
	install -Dm755 build/opt/mongo/mongo "$pkgdir/usr/bin/mongo"
	install -Dm755 build/opt/mongo/mongod "$pkgdir/usr/bin/mongod"
}

sha512sums="ce577bb5598619894ef90dd063db51780b4b452c9c9458f247e9188b4f04d6b2f3972900cce4ea977ce656a022d7e7ad964cb3bd67e4e17f6cf08841b6f610ec  mongodb-src-r4.2.9.tar.gz
4d75d452db6a2e175573cda398dfc0709997b0925a50ab202c806dc6ff795f54c7376bf25f2a455344e80c5bba5439bf3bee0af02c54c81039b1a68acbdffb0a  fix-backtrace.patch
23f5b74715f41ff0998f07ad207e773b6fb06e375fe558fb812bc009e01367fbfd8a91391e2d1749d3bd4b9dc430ad3cdcd47163aadb6eb100869d3c9ef4a029  fix-default-stacksize.patch
bb314e320825bc70a77db5a9ae07848fd1cec46edb41e8d94ce1effb0e5e0115636755a484924356c15d60f0e623c4b34197ef759accf9d156bcd2d11dbf5d61  fix-elf-native-class.patch
4f8fd4d3fee9978a9f4598985ddf5c5634676b9fa07070de5d72353c13bcf0f257f8609a8aa78fa065827c4d18c0e8cde11ec2eb625cf513e35cf6fb0e3b490f  fix-kms_request.patch
adb8f5af63ca02194b54106b658acf4543362be29f63a5ec74a7fb717cbfe3e58df3e04617420b2285c821a56b7930d52171b9d5164c2046f63d5c1a39279fed  fix-mozjs.patch
6570ac58293501d7d15e035f1cb11b641ea7aa524aab749e91b70acb2cad44b1516028dadbca090d157156e496bd8266455e5929109bb502e830b22dabf1b518  fix-processinfo_linux.patch
ecee715dc51c485081fd216e1bb8f54d2632519b352781ca5f0a1d715864733fecf17da6603cccf01c3cabbce135051e7931116fc418d5a315dc8f592a31350c  fix-resolv.patch
ef2b0e0e0f46c688dd487075ebfb294caa114af0ad291a31eb30768eab50aa6c93ce9741ee0f60412375ff7ae6db04c40163252270386a12aabe7f9b375e6e0d  fix-strerror_r.patch
ecbe6cb579b33dd4888096712f150772db06fd38219ca2a7679b1dc1ee73b0c3f5ee498af12ecd0265b5231a9fe6b7c12b2c1d606ed04caa6aa00c3ad3fe925a  fix-wiredtiger.patch"

A mongodb/fix-backtrace.patch => mongodb/fix-backtrace.patch +12 -0
@@ 0,0 1,12 @@
--- ./SConstruct.orig
+++ ./SConstruct
@@ -3334,7 +3334,8 @@
     if (conf.CheckCXXHeader( "execinfo.h" ) and
         conf.CheckDeclaration('backtrace', includes='#include <execinfo.h>') and
         conf.CheckDeclaration('backtrace_symbols', includes='#include <execinfo.h>') and
-        conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>')):
+        conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>') and
+        conf.CheckFunc('backtrace')):
 
         conf.env.SetConfigHeaderDefine("MONGO_CONFIG_HAVE_EXECINFO_BACKTRACE")
 

A mongodb/fix-default-stacksize.patch => mongodb/fix-default-stacksize.patch +19 -0
@@ 0,0 1,19 @@
--- ./src/mongo/platform/stack_locator_pthread_getattr_np.cpp.orig
+++ ./src/mongo/platform/stack_locator_pthread_getattr_np.cpp
@@ -36,6 +36,16 @@
 #include "mongo/util/assert_util.h"
 #include "mongo/util/scopeguard.h"
 
+__attribute__((constructor))
+static void set_default_stack_size(void)
+{
+    pthread_attr_t attr;
+    invariant(pthread_attr_init(&attr) == 0);
+    invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
+    pthread_setattr_default_np(&attr);
+    invariant(pthread_attr_destroy(&attr) == 0);
+}
+
 namespace mongo {
 
 StackLocator::StackLocator() {

A mongodb/fix-elf-native-class.patch => mongodb/fix-elf-native-class.patch +12 -0
@@ 0,0 1,12 @@
--- ./src/mongo/util/stacktrace_posix.cpp.orig
+++ ./src/mongo/util/stacktrace_posix.cpp
@@ -283,6 +283,9 @@
 #include <elf.h>
 #include <link.h>
 
+// AlpineTODO: Better option??
+#define __ELF_NATIVE_CLASS 64
+
 namespace mongo {
 namespace {
 

A mongodb/fix-kms_request.patch => mongodb/fix-kms_request.patch +10 -0
@@ 0,0 1,10 @@
--- ./src/third_party/kms-message/src/kms_request_str.h.orig
+++ ./src/third_party/kms-message/src/kms_request_str.h
@@ -18,6 +18,7 @@
 #define KMS_MESSAGE_KMS_REQUEST_STR_H
 
 #include "kms_message/kms_message.h"
+#include <sys/types.h>
 
 #include <stdarg.h>
 #include <stdbool.h>

A mongodb/fix-mozjs.patch => mongodb/fix-mozjs.patch +10 -0
@@ 0,0 1,10 @@
--- ./src/third_party/mozjs-60/platform/x86_64/linux/build/js-confdefs.h.orig
+++ ./src/third_party/mozjs-60/platform/x86_64/linux/build/js-confdefs.h
@@ -38,7 +38,6 @@
 #define HAVE_POSIX_FADVISE 1
 #define HAVE_POSIX_FALLOCATE 1
 #define HAVE_POSIX_MEMALIGN 1
-#define HAVE_PTHREAD_GETNAME_NP 1
 #define HAVE_RES_NINIT 1
 #define HAVE_SINCOS 1
 #define HAVE_SSIZE_T 1

A mongodb/fix-processinfo_linux.patch => mongodb/fix-processinfo_linux.patch +35 -0
@@ 0,0 1,35 @@
--- ./src/mongo/util/processinfo_linux.cpp.orig
+++ ./src/mongo/util/processinfo_linux.cpp
@@ -42,13 +42,7 @@
 #include <sys/time.h>
 #include <sys/utsname.h>
 #include <unistd.h>
-#ifdef __BIONIC__
-#include <android/api-level.h>
-#elif __UCLIBC__
 #include <features.h>
-#else
-#include <gnu/libc-version.h>
-#endif
 
 #include <boost/filesystem.hpp>
 #include <boost/none.hpp>
@@ -608,17 +602,9 @@
 
     BSONObjBuilder bExtra;
     bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
-#ifdef __BIONIC__
     std::stringstream ss;
-    ss << "bionic (android api " << __ANDROID_API__ << ")";
+    ss << "musl-1.2.2";
     bExtra.append("libcVersion", ss.str());
-#elif __UCLIBC__
-    std::stringstream ss;
-    ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
-    bExtra.append("libcVersion", ss.str());
-#else
-    bExtra.append("libcVersion", gnu_get_libc_version());
-#endif
     if (!verSig.empty())
         // optional
         bExtra.append("versionSignature", verSig);

A mongodb/fix-resolv.patch => mongodb/fix-resolv.patch +17 -0
@@ 0,0 1,17 @@
--- ./src/mongo/util/dns_query_posix-impl.h.orig
+++ ./src/mongo/util/dns_query_posix-impl.h
@@ -39,6 +39,14 @@
 #include <resolv.h>
 // clang-format on
 
+// Support deprecated resolver, as in musl libc
+#ifndef res_ninit
+#define res_nclose(arg)
+#define res_ninit(arg)    res_init()
+#define res_nsearch(sta, nam, clas, typ, ans, alen)  res_search(nam, clas, typ, ans, alen)
+#endif
+
+
 #include <stdio.h>
 
 #include <iostream>

A mongodb/fix-strerror_r.patch => mongodb/fix-strerror_r.patch +14 -0
@@ 0,0 1,14 @@
--- ./src/mongo/util/errno_util.cpp.orig
+++ ./src/mongo/util/errno_util.cpp
@@ -61,10 +61,7 @@
     char buf[kBuflen];
     char* msg{nullptr};
 
-#if defined(__GNUC__) && defined(_GNU_SOURCE) && \
-    (!defined(__ANDROID_API__) || !(__ANDROID_API__ <= 22)) && !defined(EMSCRIPTEN)
-    msg = strerror_r(errNumber, buf, kBuflen);
-#elif defined(_WIN32)
+#if defined(_WIN32)
 
     LPWSTR errorText = nullptr;
     FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER |

A mongodb/fix-wiredtiger.patch => mongodb/fix-wiredtiger.patch +11 -0
@@ 0,0 1,11 @@
--- ./src/third_party/wiredtiger/build_linux/wiredtiger_config.h.orig
+++ ./src/third_party/wiredtiger/build_linux/wiredtiger_config.h
@@ -104,7 +104,7 @@
 #define HAVE_STRING_H 1
 
 /* Define to 1 if you have the `strtouq' function. */
-#define HAVE_STRTOUQ 1
+/* #define HAVE_STRTOUQ 1 */
 
 /* Define to 1 if you have the `sync_file_range' function. */
 /* #undef HAVE_SYNC_FILE_RANGE */