Diff mongodb-4.4.20 with a mongodb-5.0.16-r1

/usr/portage/dev-db/mongodb/mongodb-5.0.16-r1.ebuild 2023-10-09 14:52:29.320368346 +0300
21 21
LICENSE="Apache-2.0 SSPL-1"
22 22
SLOT="0"
23 23
KEYWORDS="amd64 ~arm64 -riscv"
24
IUSE="debug kerberos lto ssl test +tools"
25
RESTRICT="!test? ( test )"
24
CPU_FLAGS="cpu_flags_x86_avx"
25
IUSE="debug kerberos lto mongosh ssl +tools ${CPU_FLAGS}"
26

  
27
# https://github.com/mongodb/mongo/wiki/Test-The-Mongodb-Server
28
# resmoke needs python packages not yet present in Gentoo
29
RESTRICT="test"
26 30

  
27 31
RDEPEND="acct-group/mongodb
28 32
	acct-user/mongodb
......
45 49
	debug? ( dev-util/valgrind )"
46 50
BDEPEND="
47 51
	$(python_gen_any_dep '
48
		test? ( dev-python/pymongo[${PYTHON_USEDEP}] dev-python/requests[${PYTHON_USEDEP}] )
49 52
		>=dev-util/scons-3.1.1[${PYTHON_USEDEP}]
50 53
		dev-python/cheetah3[${PYTHON_USEDEP}]
51 54
		dev-python/psutil[${PYTHON_USEDEP}]
52 55
		dev-python/pyyaml[${PYTHON_USEDEP}]
53 56
	')
54 57
"
55
PDEPEND="tools? ( >=app-admin/mongo-tools-100 )"
58
PDEPEND="
59
	mongosh? ( app-admin/mongosh-bin )
60
	tools? ( >=app-admin/mongo-tools-100 )
61
"
56 62

  
57 63
PATCHES=(
58
	"${FILESDIR}/${PN}-4.4.1-fix-scons.patch"
59
	"${FILESDIR}/${PN}-4.4.8-no-compass.patch"
60 64
	"${FILESDIR}/${PN}-4.4.1-boost.patch"
61 65
	"${FILESDIR}/${PN}-4.4.1-gcc11.patch"
62
	"${FILESDIR}/${PN}-4.4.10-boost-1.79.patch"
63
	"${FILESDIR}/${PN}-4.4.10-no-force-lld.patch"
66
	"${FILESDIR}/${PN}-5.0.2-fix-scons.patch"
67
	"${FILESDIR}/${PN}-5.0.2-no-compass.patch"
68
	"${FILESDIR}/${PN}-5.0.2-skip-no-exceptions.patch"
69
	"${FILESDIR}/${PN}-5.0.2-skip-reqs-check.patch"
70
	"${FILESDIR}/${PN}-5.0.2-boost-1.79.patch"
71
	"${FILESDIR}/${PN}-5.0.5-no-force-lld.patch"
64 72
	"${FILESDIR}/${PN}-4.4.10-boost-1.81.patch"
73
	"${FILESDIR}/${PN}-5.0.5-boost-1.81-extra.patch"
65 74
	"${FILESDIR}/${PN}-4.4.8-gcc-13.patch"
75
	"${FILESDIR}/${PN}-5.0.16-arm64-assert.patch"
66 76
)
67 77

  
68 78
S="${WORKDIR}/${MY_P}"
69 79

  
70 80
python_check_deps() {
71
	if use test; then
72
		python_has_version "dev-python/pymongo[${PYTHON_USEDEP}]" || return 1
73
		python_has_version "dev-python/requests[${PYTHON_USEDEP}]" || return 1
74
	fi
75

  
76 81
	python_has_version ">=dev-util/scons-3.1.1[${PYTHON_USEDEP}]" &&
77 82
	python_has_version "dev-python/cheetah3[${PYTHON_USEDEP}]" &&
78 83
	python_has_version "dev-python/psutil[${PYTHON_USEDEP}]" &&
......
80 85
}
81 86

  
82 87
pkg_pretend() {
88
	# Bug 809692 + 890294
89
	if use amd64 && ! use cpu_flags_x86_avx; then
90
		ewarn "MongoDB 5.0 requires use of the AVX instruction set."
91
		ewarn "This ebuild will use --experimental-optimization=-sandybridge which"
92
	        ewarn "will result in an experimental build of MongoDB as per upstream."
93
		ewarn "https://docs.mongodb.com/v5.0/administration/production-notes/"
94
	fi
95

  
83 96
	if [[ -n ${REPLACING_VERSIONS} ]]; then
84
		if ver_test "$REPLACING_VERSIONS" -lt 4.2; then
85
			ewarn "To upgrade from a version earlier than the 4.2-series, you must"
97
		if ver_test "$REPLACING_VERSIONS" -lt 4.4; then
98
			ewarn "To upgrade from a version earlier than the 4.4-series, you must"
86 99
			ewarn "successively upgrade major releases until you have upgraded"
87
			ewarn "to 4.2-series. Then upgrade to 4.4 series."
100
			ewarn "to 4.4-series. Then upgrade to 5.0 series."
88 101
		else
89
			ewarn "Be sure to set featureCompatibilityVersion to 4.2 before upgrading."
102
			ewarn "Be sure to set featureCompatibilityVersion to 4.4 before upgrading."
90 103
		fi
91 104
	fi
92 105
}
......
95 108
	default
96 109

  
97 110
	# remove bundled libs
98
	rm -r src/third_party/{boost-*,pcre-*,scons-*,snappy-*,yaml-cpp-*,zlib-*} || die
111
	rm -r src/third_party/{boost,pcre-*,snappy-*,yaml-cpp,zlib-*} || die
99 112

  
100 113
	# remove compass
101 114
	rm -r src/mongo/installer/compass || die
......
111 124
		CXX="$(tc-getCXX)"
112 125

  
113 126
		--disable-warnings-as-errors
127
		--force-jobs
128
		--jobs="$(makeopts_jobs)"
114 129
		--use-system-boost
115 130
		--use-system-pcre
116 131
		--use-system-snappy
......
124 139
	use debug && scons_opts+=( --dbg=on )
125 140
	use kerberos && scons_opts+=( --use-sasl-client )
126 141
	use lto && scons_opts+=( --lto=on )
127
	use ssl && scons_opts+=( --ssl )
142
    use amd64 && ! use cpu_flags_x86_avx && scons_opts+=( --experimental-optimization=-sandybridge ) # Bug 890294
143

  
144
	scons_opts+=( --ssl=$(usex ssl on off) )
128 145

  
129 146
	# Needed to avoid forcing FORTIFY_SOURCE
130 147
	# Gentoo's toolchain applies these anyway
......
141 158
}
142 159

  
143 160
src_compile() {
144
	PREFIX="${EPREFIX}/usr" escons "${scons_opts[@]}" --nostrip install-core
145
}
146

  
147
# FEATURES="test -usersandbox" emerge dev-db/mongodb
148
src_test() {
149
	ewarn "Tests may hang with FEATURES=usersandbox"
150
	"${EPYTHON}" ./buildscripts/resmoke.py run --dbpathPrefix=test --suites core --jobs=$(makeopts_jobs) || die "Tests failed with ${EPYTHON}"
161
	PREFIX="${EPREFIX}/usr" ./buildscripts/scons.py "${scons_opts[@]}" install-core || die
151 162
}
152 163

  
153 164
src_install() {
Thank you!