mongodb-7_0: modernize, 7.0.26 -> 7.0.28 (#471239)

This commit is contained in:
Michael Daniels
2025-12-27 15:55:29 +00:00
committed by GitHub
2 changed files with 17 additions and 18 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ let
in
buildMongoDB {
inherit avxSupport;
version = "7.0.26";
sha256 = "sha256-731rmMz5C2cmOVKRWmT439uiRUW3kWQCz2/l/Ffk9zI=";
version = "7.0.28";
hash = "sha256-28IouDQ+uzRoUm+PvESFkX1oz0dbFURd7JMsI7orYsc=";
patches = [
# ModuleNotFoundError: No module named 'mongo_tooling_metrics':
# NameError: name 'SConsToolingMetrics' is not defined:
+15 -16
View File
@@ -16,6 +16,7 @@
curl,
cctools,
xz,
versionCheckHook,
}:
# Note:
@@ -24,7 +25,7 @@
{
version,
sha256,
hash,
patches ? [ ],
license ? lib.licenses.sspl,
avxSupport ? stdenv.hostPlatform.avxSupport,
@@ -60,15 +61,15 @@ let
inherit (lib) systems subtractLists;
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
inherit version passthru;
pname = "mongodb";
src = fetchFromGitHub {
owner = "mongodb";
repo = "mongo";
rev = "r${version}";
inherit sha256;
tag = "r${finalAttrs.version}";
inherit hash;
};
nativeBuildInputs = [
@@ -87,13 +88,13 @@ stdenv.mkDerivation rec {
openldap
sasl
snappy
xz
zlib
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
]
++ lib.optional stdenv.hostPlatform.isLinux net-snmp
++ [ xz ];
++ lib.optional stdenv.hostPlatform.isLinux net-snmp;
# MongoDB keeps track of its build parameters, which tricks nix into
# keeping dependencies to build inputs in the final output.
@@ -103,14 +104,14 @@ stdenv.mkDerivation rec {
postPatch = ''
# fix environment variable reading
substituteInPlace SConstruct \
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
--replace-fail "env = Environment(" "env = Environment(ENV = os.environ,"
''
+ ''
# Fix debug gcc 11 and clang 12 builds on Fedora
# https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0.patch
substituteInPlace src/mongo/db/query/plan_summary_stats.h --replace '#include <string>' '#include <optional>
substituteInPlace src/mongo/db/query/plan_summary_stats.h --replace-fail '#include <string>' '#include <optional>
#include <string>'
substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include <string>' '#include <optional>
substituteInPlace src/mongo/db/exec/plan_stats.h --replace-fail '#include <string>' '#include <optional>
#include <string>'
''
+ lib.optionalString (!avxSupport) ''
@@ -130,7 +131,7 @@ stdenv.mkDerivation rec {
"--disable-warnings-as-errors"
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
"--link-model=static"
"MONGO_VERSION=${version}"
"MONGO_VERSION=${finalAttrs.version}"
]
++ map (lib: "--use-system-${lib}") system-libraries;
@@ -157,11 +158,9 @@ stdenv.mkDerivation rec {
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
"$out/bin/mongo" --version
runHook postInstallCheck
'';
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/mongo";
versionCheckProgramArg = "--version";
installTargets = "install-devcore";
@@ -179,4 +178,4 @@ stdenv.mkDerivation rec {
];
platforms = subtractLists systems.doubles.i686 systems.doubles.unix;
};
}
})