From f016bedd7b2babbcc6d6da3e34dea516535edcdc Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 9 Sep 2022 21:13:25 +0200 Subject: [PATCH 1/4] mongodb: wrap overly long lines --- pkgs/servers/nosql/mongodb/mongodb.nix | 60 ++++++++++++++++++++------ 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 82837e87d1a6..883d65bec7bd 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,5 +1,23 @@ -{ lib, stdenv, fetchurl, sconsPackages, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp -, sasl, openssl, libpcap, python3, curl, Security, CoreFoundation, cctools, xz }: +{ 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) @@ -11,17 +29,33 @@ with lib; }: 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)"; - } - else rec { python = scons.python.withPackages (ps: with ps; [ pyyaml typing cheetah ]); - scons = sconsPackages.scons_3_1_2; - mozjsVersion = "45"; - mozjsReplace = "defined(HAVE_SINCOS)"; - }; + variants = + if versionAtLeast version "4.2" then rec { + python = scons.python.withPackages (ps: with ps; [ + pyyaml + cheetah3 + psutil + setuptools + ]); + + # 4.2 < mongodb <= 5.0.x needs scons 3.x built with python3 + scons = sconsPackages.scons_3_1_2.override { python = python3; }; + + mozjsVersion = "60"; + mozjsReplace = "defined(HAVE___SINCOS)"; + + } else rec { + python = scons.python.withPackages (ps: with ps; [ + pyyaml + typing + cheetah + ]); + + scons = sconsPackages.scons_3_1_2; + mozjsVersion = "45"; + mozjsReplace = "defined(HAVE_SINCOS)"; + }; + system-libraries = [ "boost" "pcre" From f2de05f59b5871e2702d3d18ded34de966d15ab2 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 9 Sep 2022 21:16:16 +0200 Subject: [PATCH 2/4] mongodb: add note about mongosh The `mongo` shell has been deprecated. The official replacement is `mongosh` from pkgs.mongosh. --- pkgs/servers/nosql/mongodb/mongodb.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 883d65bec7bd..532ecce2402e 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -20,7 +20,8 @@ }: # Note: -# The command line tools are written in Go as part of a different package (mongodb-tools) +# The command line administrative tools are part of other packages: +# see pkgs.mongodb-tools and pkgs.mongosh. with lib; From 9f392269783b544b9b1755d9c2deb349e1a7ad86 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 9 Sep 2022 21:30:08 +0200 Subject: [PATCH 3/4] mongodb-6_0: init at 6.0.1 GitHub: closes #190297 --- pkgs/servers/nosql/mongodb/6.0.nix | 12 ++++++++++++ pkgs/servers/nosql/mongodb/mongodb.nix | 23 +++++++++++++++++++++-- pkgs/top-level/all-packages.nix | 7 +++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 pkgs/servers/nosql/mongodb/6.0.nix diff --git a/pkgs/servers/nosql/mongodb/6.0.nix b/pkgs/servers/nosql/mongodb/6.0.nix new file mode 100644 index 000000000000..ef3aa77278ca --- /dev/null +++ b/pkgs/servers/nosql/mongodb/6.0.nix @@ -0,0 +1,12 @@ +{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: + +let + buildMongoDB = callPackage ./mongodb.nix { + inherit sasl boost Security CoreFoundation cctools; + }; +in +buildMongoDB { + version = "6.0.1"; + sha256 = "sha256-3LdyPHj2t7JskCJh6flCYl6qjfAbRXHsi+19L+0O2Zs="; + patches = [ ]; +} diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 532ecce2402e..8d3f8f9c25ca 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -31,7 +31,23 @@ with lib; let variants = - if versionAtLeast version "4.2" then rec { + if versionAtLeast version "6.0" then rec { + python = scons.python.withPackages (ps: with ps; [ + pyyaml + cheetah3 + psutil + setuptools + packaging + pymongo + ]); + + # 4.2 < mongodb <= 6.0.x needs scons 3.x built with python3 + scons = sconsPackages.scons_3_1_2.override { python = python3; }; + + mozjsVersion = "60"; + mozjsReplace = "defined(HAVE___SINCOS)"; + + } else if versionAtLeast version "4.2" then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 @@ -164,7 +180,10 @@ in stdenv.mkDerivation rec { runHook postInstallCheck ''; - installTargets = if (versionAtLeast version "4.4") then "install-core" else "install"; + installTargets = + if (versionAtLeast version "6.0") then "install-devcore" + else if (versionAtLeast version "4.4") then "install-core" + else "install"; prefixKey = if (versionAtLeast version "4.4") then "DESTDIR=" else "--prefix="; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f631f49d77b3..121a151d98f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23287,6 +23287,13 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; }; + mongodb-6_0 = callPackage ../servers/nosql/mongodb/6.0.nix { + sasl = cyrus_sasl; + boost = boost178.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 { stdenv = gcc10StdenvCompat; }; From 9201d1163ed9e3624fb7bb1860e3838b7b88d78b Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 10 Sep 2022 23:35:20 +0200 Subject: [PATCH 4/4] mongodb-6_0: restrict platform to linux --- pkgs/servers/nosql/mongodb/mongodb.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 8d3f8f9c25ca..88dcfdcb7080 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -197,6 +197,9 @@ in stdenv.mkDerivation rec { inherit license; maintainers = with maintainers; [ bluescreen303 offline cstrahan ]; - platforms = subtractLists systems.doubles.i686 systems.doubles.unix; + platforms = subtractLists systems.doubles.i686 ( + if (versionAtLeast version "6.0") then systems.doubles.linux + else systems.doubles.unix + ); }; }