mongodb: add 4.4

+4
nixos/tests/mongodb.nix
···
mongodb-3_6
mongodb-4_0
mongodb-4_2
];
};
};
···
+ runMongoDBTest pkgs.mongodb-3_6
+ runMongoDBTest pkgs.mongodb-4_0
+ runMongoDBTest pkgs.mongodb-4_2
+ ''
node.shutdown()
'';
···
mongodb-3_6
mongodb-4_0
mongodb-4_2
+
mongodb-4_4
+
mongodb-5_0
];
};
};
···
+ runMongoDBTest pkgs.mongodb-3_6
+ runMongoDBTest pkgs.mongodb-4_0
+ runMongoDBTest pkgs.mongodb-4_2
+
+ runMongoDBTest pkgs.mongodb-4_4
+
+ runMongoDBTest pkgs.mongodb-5_0
+ ''
node.shutdown()
'';
+14
pkgs/servers/nosql/mongodb/4.4.nix
···
···
+
{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
+
+
let
+
buildMongoDB = callPackage ./mongodb.nix {
+
inherit sasl boost Security CoreFoundation cctools;
+
};
+
in
+
buildMongoDB {
+
version = "4.4.10";
+
sha256 = "1rn9w3wwb2kbixqx39zb7cczzw5qjbh7d9yhlbivrs0f9bywl8nx";
+
patches = [
+
./forget-build-dependencies-4-4.patch
+
] ++ lib.optionals stdenv.isDarwin [ ./asio-no-experimental-string-view-4-4.patch ];
+
}
+23
pkgs/servers/nosql/mongodb/asio-no-experimental-string-view-4-4.patch
···
···
+
--- a/src/third_party/asio-master/asio/include/asio/detail/config.hpp
+
--- b/src/third_party/asio-master/asio/include/asio/detail/config.hpp
+
@@ -831,20 +831,8 @@
+
# endif // (__cplusplus >= 201402)
+
# endif // (_LIBCPP_VERSION < 7000)
+
# else // defined(ASIO_HAS_CLANG_LIBCXX)
+
-# if (__cplusplus >= 201402)
+
-# if __has_include(<experimental/string_view>)
+
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
+
-# endif // __has_include(<experimental/string_view>)
+
-# endif // (__cplusplus >= 201402)
+
# endif // // defined(ASIO_HAS_CLANG_LIBCXX)
+
# endif // defined(__clang__)
+
-# if defined(__GNUC__)
+
-# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
+
-# if (__cplusplus >= 201402)
+
-# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
+
-# endif // (__cplusplus >= 201402)
+
-# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
+
-# endif // defined(__GNUC__)
+
# endif // !defined(ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
+
#endif // !defined(ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+
+33
pkgs/servers/nosql/mongodb/forget-build-dependencies-4-4.patch
···
···
+
--- a/site_scons/mongo/generators.py
+
+++ b/site_scons/mongo/generators.py
+
@@ -34,30 +34,12 @@ def default_buildinfo_environment_data():
+
False,
+
),
+
(
+
- 'ccflags',
+
- '$CCFLAGS',
+
- True,
+
- False,
+
- ),
+
- (
+
'cxx',
+
'$CXX_VERSION',
+
True,
+
False,
+
),
+
(
+
- 'cxxflags',
+
- '$CXXFLAGS',
+
- True,
+
- False,
+
- ),
+
- (
+
- 'linkflags',
+
- '$LINKFLAGS',
+
- True,
+
- False,
+
- ),
+
- (
+
'target_arch',
+
'$TARGET_ARCH',
+
True,
+11 -7
pkgs/servers/nosql/mongodb/mongodb.nix
···
{ lib, stdenv, fetchurl, sconsPackages, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp
-
, sasl, openssl, libpcap, curl, Security, CoreFoundation, cctools }:
# Note:
# The command line tools are written in Go as part of a different package (mongodb-tools)
···
{ version, sha256, patches ? []
, license ? lib.licenses.sspl
-
}@args:
let
variants = if versionAtLeast version "4.2"
then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 psutil setuptools ]);
-
scons = sconsPackages.scons_latest;
mozjsVersion = "60";
mozjsReplace = "defined(HAVE___SINCOS)";
}
···
inherit sha256;
};
-
nativeBuildInputs = [ variants.scons ];
buildInputs = [
boost
curl
···
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0
-
substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2cap.cc --replace drem remainder
···
"--use-sasl-client"
"--disable-warnings-as-errors"
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
-
] ++ map (lib: "--use-system-${lib}") system-libraries;
preBuild = ''
sconsFlags+=" CC=$CC"
···
runHook postInstallCheck
'';
-
prefixKey = "--prefix=";
enableParallelBuilding = true;
···
{ lib, stdenv, fetchurl, sconsPackages, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp
+
, sasl, openssl, libpcap, python3, curl, Security, CoreFoundation, cctools, xz }:
# Note:
# The command line tools are written in Go as part of a different package (mongodb-tools)
···
{ version, sha256, patches ? []
, license ? lib.licenses.sspl
+
}:
let
variants = if versionAtLeast version "4.2"
then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 psutil setuptools ]);
+
scons = sconsPackages.scons_3_1_2.override { python = python3; }; # 4.2 < mongodb <= 5.0.x needs scons 3.x built with python3
mozjsVersion = "60";
mozjsReplace = "defined(HAVE___SINCOS)";
}
···
inherit sha256;
};
+
nativeBuildInputs = [ variants.scons ]
+
++ lib.optionals (versionAtLeast version "4.4") [ xz ];
+
buildInputs = [
boost
curl
···
--replace "env = Environment(" "env = Environment(ENV = os.environ,"
'' + lib.optionalString stdenv.isDarwin ''
substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0
substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder
substituteInPlace src/third_party/s2/s2cap.cc --replace drem remainder
···
"--use-sasl-client"
"--disable-warnings-as-errors"
"VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
+
] ++ lib.optionals (versionAtLeast version "4.4") [ "--link-model=static" ]
+
++ map (lib: "--use-system-${lib}") system-libraries;
preBuild = ''
sconsFlags+=" CC=$CC"
···
runHook postInstallCheck
'';
+
installTargets = if (versionAtLeast version "4.4") then "install-core" else "install";
+
+
prefixKey = if (versionAtLeast version "4.4") then "DESTDIR=" else "--prefix=";
enableParallelBuilding = true;
+7
pkgs/top-level/all-packages.nix
···
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
};
nginx-sso = callPackage ../servers/nginx-sso { };
percona-server56 = callPackage ../servers/sql/percona/5.6.x.nix { };
···
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
};
+
mongodb-4_4 = callPackage ../servers/nosql/mongodb/4.4.nix {
+
sasl = cyrus_sasl;
+
boost = boost17x.override { enableShared = false; };
+
inherit (darwin) cctools;
+
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
+
};
+
nginx-sso = callPackage ../servers/nginx-sso { };
percona-server56 = callPackage ../servers/sql/percona/5.6.x.nix { };