diff --git a/pkgs/servers/nosql/mongodb/5.0.nix b/pkgs/servers/nosql/mongodb/5.0.nix index 2a26cb94eb1685..2e03037b9fcc93 100644 --- a/pkgs/servers/nosql/mongodb/5.0.nix +++ b/pkgs/servers/nosql/mongodb/5.0.nix @@ -1,4 +1,4 @@ -{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools }: +{ stdenv, callPackage, lib, sasl, boost, Security, CoreFoundation, cctools, avxSupport ? true }: let buildMongoDB = callPackage ./mongodb.nix { @@ -18,6 +18,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 b17c4191692808..91405d087dc61d 100644 --- a/pkgs/servers/nosql/mongodb/6.0.nix +++ b/pkgs/servers/nosql/mongodb/6.0.nix @@ -1,4 +1,4 @@ -{ stdenv, callPackage, lib, fetchpatch, sasl, boost, Security, CoreFoundation, cctools }: +{ stdenv, callPackage, lib, fetchpatch, sasl, boost, Security, CoreFoundation, cctools, avxSupport ? true }: let buildMongoDB = callPackage ./mongodb.nix { @@ -6,6 +6,7 @@ let }; in buildMongoDB { + inherit avxSupport; version = "6.0.13"; sha256 = "sha256-BD3XrTdv4sCa3h37o1A2s3/R0R8zHiR59a4pY0RxLGU="; patches = [ diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 801ee28303f079..7b84b643c2628a 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -29,6 +29,7 @@ with lib; { version, sha256, patches ? [] , license ? lib.licenses.sspl +, avxSupport ? true }: let @@ -112,6 +113,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