about summary refs log tree commit diff
path: root/pkgs/servers/nosql/mongodb
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/nosql/mongodb')
-rw-r--r--pkgs/servers/nosql/mongodb/5.0.nix10
-rw-r--r--pkgs/servers/nosql/mongodb/6.0.nix10
-rw-r--r--pkgs/servers/nosql/mongodb/mongodb.nix15
3 files changed, 25 insertions, 10 deletions
diff --git a/pkgs/servers/nosql/mongodb/5.0.nix b/pkgs/servers/nosql/mongodb/5.0.nix
index 2a26cb94eb168..d74bf1e2f3d49 100644
--- a/pkgs/servers/nosql/mongodb/5.0.nix
+++ b/pkgs/servers/nosql/mongodb/5.0.nix
@@ -1,4 +1,7 @@
-{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }:
+{ stdenv, callPackage, lib, sasl, boost
+, Security, CoreFoundation, cctools
+, avxSupport ? stdenv.hostPlatform.avxSupport
+}:
 
 let
   buildMongoDB = callPackage ./mongodb.nix {
@@ -6,8 +9,8 @@ let
   };
   variants = if stdenv.isLinux then
     {
-      version = "5.0.24";
-      sha256 = "sha256-6CVQOHN3yFTq6OyVkZMYEjIKfFbQZ6M5KAa3k7qv4Gc=";
+      version = "5.0.27";
+      sha256 = "sha256-++Qv3H6iVN8p0Jq3vx44DZCNh90vY5fAWKgP402bLlw=";
       patches = [ ./fix-build-with-boost-1.79-5_0-linux.patch ];
     }
   else lib.optionalAttrs stdenv.isDarwin
@@ -18,6 +21,7 @@ let
     };
 in
 buildMongoDB {
+  inherit avxSupport;
   version = variants.version;
   sha256 = variants.sha256;
   patches = [
diff --git a/pkgs/servers/nosql/mongodb/6.0.nix b/pkgs/servers/nosql/mongodb/6.0.nix
index b17c419169280..64be3b1f5f90b 100644
--- a/pkgs/servers/nosql/mongodb/6.0.nix
+++ b/pkgs/servers/nosql/mongodb/6.0.nix
@@ -1,4 +1,7 @@
-{ stdenv, callPackage, lib, fetchpatch, sasl, boost, Security, CoreFoundation, cctools }:
+{ stdenv, callPackage, lib, fetchpatch
+, sasl, boost, Security, CoreFoundation, cctools
+, avxSupport ? stdenv.hostPlatform.avxSupport
+}:
 
 let
   buildMongoDB = callPackage ./mongodb.nix {
@@ -6,8 +9,9 @@ let
   };
 in
 buildMongoDB {
-  version = "6.0.13";
-  sha256 = "sha256-BD3XrTdv4sCa3h37o1A2s3/R0R8zHiR59a4pY0RxLGU=";
+  inherit avxSupport;
+  version = "6.0.15";
+  sha256 = "sha256-DX1wbrDx1/JrEHbzNaXC4Hqq7MrLqz+JZgG98beyVds=";
   patches = [
     # Patches a bug that it couldn't build MongoDB 6.0 on gcc 13 because a include in ctype.h was missing
     ./fix-gcc-13-ctype-6_0.patch
diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix
index 801ee28303f07..2b304aa212eef 100644
--- a/pkgs/servers/nosql/mongodb/mongodb.nix
+++ b/pkgs/servers/nosql/mongodb/mongodb.nix
@@ -1,6 +1,6 @@
 { lib
 , stdenv
-, fetchurl
+, fetchFromGitHub
 , buildPackages
 , boost
 , gperftools
@@ -29,6 +29,7 @@ with lib;
 
 { version, sha256, patches ? []
 , license ? lib.licenses.sspl
+, avxSupport ? stdenv.hostPlatform.avxSupport
 }:
 
 let
@@ -63,8 +64,10 @@ in stdenv.mkDerivation rec {
   inherit version;
   pname = "mongodb";
 
-  src = fetchurl {
-    url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz";
+  src = fetchFromGitHub {
+    owner = "mongodb";
+    repo = "mongo";
+    rev = "r${version}";
     inherit sha256;
   };
 
@@ -112,6 +115,9 @@ in stdenv.mkDerivation rec {
     # don't fail by default on i686
     substituteInPlace src/mongo/db/storage/storage_options.h \
       --replace 'engine("wiredTiger")' 'engine("mmapv1")'
+  '' + lib.optionalString (!avxSupport) ''
+    substituteInPlace SConstruct \
+      --replace-fail "default=['+sandybridge']," 'default=[],'
   '';
 
   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
@@ -127,6 +133,7 @@ in 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}"
   ]
   ++ map (lib: "--use-system-${lib}") system-libraries;
 
@@ -168,7 +175,7 @@ in stdenv.mkDerivation rec {
   hardeningEnable = [ "pie" ];
 
   meta = {
-    description = "A scalable, high-performance, open source NoSQL database";
+    description = "Scalable, high-performance, open source NoSQL database";
     homepage = "http://www.mongodb.org";
     inherit license;