mongodb.mk 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ################################################################################
  2. #
  3. # mongodb
  4. #
  5. ################################################################################
  6. MONGODB_VERSION = 4.2.11
  7. MONGODB_SITE = https://fastdl.mongodb.org/src
  8. MONGODB_SOURCE = mongodb-src-r$(MONGODB_VERSION).tar.gz
  9. MONGODB_LICENSE = Apache-2.0 (drivers), SSPL (database)
  10. MONGODB_LICENSE_FILES = APACHE-2.0.txt LICENSE-Community.txt
  11. MONGODB_CPE_ID_VENDOR = mongodb
  12. MONGODB_SELINUX_MODULES = mongodb
  13. MONGODB_DEPENDENCIES = \
  14. boost \
  15. host-python3-cheetah \
  16. host-python3-psutil \
  17. host-python3-pyyaml \
  18. host-python3-regex \
  19. host-python-requests \
  20. host-scons \
  21. pcre \
  22. snappy \
  23. sqlite \
  24. yaml-cpp \
  25. zlib
  26. MONGODB_SCONS_TARGETS = mongod mongos
  27. MONGODB_SCONS_ENV = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" \
  28. -j"$(PARALLEL_JOBS)"
  29. MONGODB_SCONS_OPTS = \
  30. --disable-minimum-compiler-version-enforcement \
  31. --disable-warnings-as-errors \
  32. --use-system-boost \
  33. --use-system-pcre \
  34. --use-system-snappy \
  35. --use-system-sqlite \
  36. --use-system-yaml \
  37. --use-system-zlib
  38. # need to pass mongo version when not building from git repo
  39. MONGODB_SCONS_OPTS += MONGO_VERSION=$(MONGODB_VERSION)-
  40. # WiredTiger database storage engine only supported on 64 bits
  41. ifeq ($(BR2_ARCH_IS_64),y)
  42. MONGODB_SCONS_OPTS += --wiredtiger=on
  43. else
  44. MONGODB_SCONS_OPTS += --wiredtiger=off
  45. endif
  46. # JavaScript scripting engine and tcmalloc supported only on
  47. # x86/x86-64 systems. Mongo target is a shell interface that
  48. # depends on the javascript engine, so it will also only be
  49. # built on x86/x86-64 systems.
  50. ifeq ($(BR2_i386)$(BR2_x86_64),y)
  51. MONGODB_SCONS_OPTS += --js-engine=mozjs --allocator=tcmalloc
  52. MONGODB_SCONS_TARGETS += mongo
  53. else
  54. MONGODB_SCONS_OPTS += --js-engine=none --allocator=system
  55. endif
  56. ifeq ($(BR2_PACKAGE_LIBCURL),y)
  57. MONGODB_DEPENDENCIES += libcurl
  58. MONGODB_SCONS_OPTS += \
  59. --enable-free-mon=on \
  60. --enable-http-client=on
  61. else
  62. MONGODB_SCONS_OPTS += \
  63. --enable-free-mon=off \
  64. --enable-http-client=off
  65. endif
  66. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  67. MONGODB_DEPENDENCIES += openssl
  68. MONGODB_SCONS_OPTS += \
  69. --ssl=on \
  70. --ssl-provider=openssl
  71. else
  72. MONGODB_SCONS_OPTS += --ssl=off
  73. endif
  74. define MONGODB_BUILD_CMDS
  75. (cd $(@D); \
  76. $(HOST_DIR)/bin/python3 $(SCONS) \
  77. $(MONGODB_SCONS_ENV) \
  78. $(MONGODB_SCONS_OPTS) \
  79. $(MONGODB_SCONS_TARGETS))
  80. endef
  81. define MONGODB_INSTALL_TARGET_CMDS
  82. (cd $(@D); \
  83. $(HOST_DIR)/bin/python3 $(SCONS) \
  84. $(MONGODB_SCONS_ENV) \
  85. $(MONGODB_SCONS_OPTS) \
  86. --prefix=$(TARGET_DIR)/usr \
  87. install)
  88. endef
  89. $(eval $(generic-package))