Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "mongodb" |
| 2 | LICENSE = "SSPL-1 & Apache-2.0 & Zlib" |
| 3 | LIC_FILES_CHKSUM = "file://LICENSE-Community.txt;md5=3a865f27f11f43ecbe542d9ea387dcf1 \ |
| 4 | file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 5 | |
| 6 | DEPENDS = "openssl libpcap zlib boost curl python3 \ |
| 7 | python3-setuptools-native \ |
| 8 | python3-pyyaml-native python3-cheetah-native \ |
| 9 | python3-psutil-native python3-regex-native \ |
| 10 | " |
| 11 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 12 | inherit scons dos2unix siteinfo python3native systemd useradd |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 14 | PV = "4.4.7" |
| 15 | #v4.4.7 |
| 16 | SRCREV = "abb6b9c2bf675e9e2aeaecba05f0f8359d99e203" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 17 | SRC_URI = "git://github.com/mongodb/mongo.git;branch=v4.4 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | file://0001-Tell-scons-to-use-build-settings-from-environment-va.patch \ |
| 19 | file://0001-Use-long-long-instead-of-int64_t.patch \ |
| 20 | file://0001-Use-__GLIBC__-to-control-use-of-gnu_get_libc_version.patch \ |
| 21 | file://0002-Add-a-definition-for-the-macro-__ELF_NATIVE_CLASS.patch \ |
| 22 | file://arm64-support.patch \ |
| 23 | file://0001-IntelRDFPMathLib20U1-Check-for-__DEFINED_wchar_t.patch \ |
| 24 | file://0001-Support-deprecated-resolver-functions.patch \ |
| 25 | file://0003-Fix-unknown-prefix-env.patch \ |
| 26 | file://1296.patch \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 27 | file://0001-Fix-compilation-with-fno-common.patch \ |
| 28 | file://0001-stacktrace-Define-ARCH_BITS-for-x86.patch \ |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 29 | file://0001-include-needed-c-header.patch \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 30 | file://disable_runtime_check.patch \ |
| 31 | file://ppc64_ARCH_BITS.patch \ |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 32 | file://0001-Do-not-use-MINSIGSTKSZ.patch \ |
| 33 | file://0001-Use-explicit-typecast-to-size_t.patch \ |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 34 | file://PTHREAD_STACK_MIN.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 36 | SRC_URI:append:libc-musl ="\ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 37 | file://0001-Mark-one-of-strerror_r-implementation-glibc-specific.patch \ |
| 38 | file://0002-Fix-default-stack-size-to-256K.patch \ |
| 39 | file://0004-wiredtiger-Disable-strtouq-on-musl.patch \ |
| 40 | " |
| 41 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 42 | SRC_URI:append:toolchain-clang = "\ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | file://0001-asio-Dont-use-experimental-with-clang.patch \ |
| 44 | " |
| 45 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 46 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 47 | S = "${WORKDIR}/git" |
| 48 | |
| 49 | COMPATIBLE_HOST ?= '(x86_64|i.86|powerpc64|arm|aarch64).*-linux' |
| 50 | |
| 51 | PACKAGECONFIG ??= "tcmalloc system-pcre" |
| 52 | # gperftools compilation fails for arm below v7 because of missing support of |
| 53 | # dmb operation. So we use system-allocator instead of tcmalloc |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 54 | PACKAGECONFIG:remove:armv6 = "tcmalloc" |
| 55 | PACKAGECONFIG:remove:libc-musl = "tcmalloc" |
| 56 | PACKAGECONFIG:remove:riscv64 = "tcmalloc" |
| 57 | PACKAGECONFIG:remove:riscv32 = "tcmalloc" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 58 | |
| 59 | PACKAGECONFIG[tcmalloc] = "--use-system-tcmalloc,--allocator=system,gperftools," |
| 60 | PACKAGECONFIG[shell] = ",--js-engine=none,," |
| 61 | PACKAGECONFIG[system-pcre] = "--use-system-pcre,,libpcre," |
| 62 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 63 | MONGO_ARCH ?= "${HOST_ARCH}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 64 | MONGO_ARCH:powerpc64le = "ppc64le" |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 65 | WIREDTIGER ?= "off" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 66 | WIREDTIGER:x86-64 = "on" |
| 67 | WIREDTIGER:aarch64 = "on" |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 68 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 69 | EXTRA_OESCONS = "PREFIX=${prefix} \ |
| 70 | DESTDIR=${D} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 71 | LIBPATH=${STAGING_LIBDIR} \ |
| 72 | LINKFLAGS='${LDFLAGS}' \ |
| 73 | CXXFLAGS='${CXXFLAGS}' \ |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 74 | TARGET_ARCH=${MONGO_ARCH} \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 75 | MONGO_VERSION=${PV} \ |
| 76 | OBJCOPY=${OBJCOPY} \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 77 | --ssl \ |
| 78 | --disable-warnings-as-errors \ |
| 79 | --use-system-zlib \ |
| 80 | --nostrip \ |
| 81 | --endian=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 82 | --wiredtiger='${WIREDTIGER}' \ |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 83 | --separate-debug \ |
| 84 | ${PACKAGECONFIG_CONFARGS}" |
| 85 | |
| 86 | |
| 87 | USERADD_PACKAGES = "${PN}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 88 | USERADD_PARAM:${PN} = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 89 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 90 | |
| 91 | scons_do_compile() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 92 | ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} install-core || \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 93 | die "scons build execution failed." |
| 94 | } |
| 95 | |
| 96 | scons_do_install() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 97 | # install binaries |
| 98 | install -d ${D}${bindir} |
| 99 | for i in mongod mongos mongo |
| 100 | do |
| 101 | if [ -f ${B}/build/opt/mongo/${i} ] |
| 102 | then |
| 103 | install -m 0755 ${B}/build/opt/mongo/${i} ${D}${bindir}/${i} |
| 104 | else |
| 105 | bbnote "${i} does not exist" |
| 106 | fi |
| 107 | done |
| 108 | |
| 109 | # install config |
| 110 | install -d ${D}${sysconfdir} |
| 111 | install -m 0644 ${S}/debian/mongod.conf ${D}${sysconfdir}/ |
| 112 | |
| 113 | # install systemd service |
| 114 | install -d ${D}${systemd_system_unitdir} |
| 115 | install -m 0644 ${S}/debian/mongod.service ${D}${systemd_system_unitdir} |
| 116 | |
| 117 | # install mongo data folder |
| 118 | install -m 755 -d ${D}${localstatedir}/lib/${BPN} |
| 119 | chown ${PN}:${PN} ${D}${localstatedir}/lib/${BPN} |
| 120 | |
| 121 | # Log files |
| 122 | install -m 755 -d ${D}${localstatedir}/log/${BPN} |
| 123 | chown ${PN}:${PN} ${D}${localstatedir}/log/${BPN} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 124 | } |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 125 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 126 | CONFFILES:${PN} = "${sysconfdir}/mongod.conf" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 127 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 128 | SYSTEMD_SERVICE:${PN} = "mongod.service" |