about summary refs log tree commit diff
path: root/pkgs/servers/nosql
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2024-02-02 07:31:51 -0500
committerWill Fancher <elvishjerricco@gmail.com>2024-02-10 13:28:36 -0500
commitf6086df42f4d50444871e5683e446ed98a740280 (patch)
tree0c6d7f62be4e6929e2d0352b136943a6bd735804 /pkgs/servers/nosql
parentf29d66a77f6f5de17158037eef7e52b4f555ce77 (diff)
downloadnixlib-f6086df42f4d50444871e5683e446ed98a740280.tar
nixlib-f6086df42f4d50444871e5683e446ed98a740280.tar.gz
nixlib-f6086df42f4d50444871e5683e446ed98a740280.tar.bz2
nixlib-f6086df42f4d50444871e5683e446ed98a740280.tar.lz
nixlib-f6086df42f4d50444871e5683e446ed98a740280.tar.xz
nixlib-f6086df42f4d50444871e5683e446ed98a740280.tar.zst
nixlib-f6086df42f4d50444871e5683e446ed98a740280.zip
mongodb: Eliminate 'variants' redundancy.
Diffstat (limited to 'pkgs/servers/nosql')
-rw-r--r--pkgs/servers/nosql/mongodb/mongodb.nix44
1 files changed, 14 insertions, 30 deletions
diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix
index 2b0c1b1aca14..666e04ccd2be 100644
--- a/pkgs/servers/nosql/mongodb/mongodb.nix
+++ b/pkgs/servers/nosql/mongodb/mongodb.nix
@@ -32,34 +32,18 @@ with lib;
 }:
 
 let
-  variants =
-    if versionAtLeast version "6.0"
-    then rec {
-      python = scons.python.withPackages (ps: with ps; [
-        pyyaml
-        cheetah3
-        psutil
-        setuptools
-        packaging
-        pymongo
-      ]);
-
-      mozjsVersion = "60";
-      mozjsReplace = "defined(HAVE___SINCOS)";
-
-    }
-    else rec {
-      python = scons.python.withPackages (ps: with ps; [
-        pyyaml
-        cheetah3
-        psutil
-        setuptools
-      ]);
-
-      mozjsVersion = "60";
-      mozjsReplace = "defined(HAVE___SINCOS)";
-
-    };
+  python = scons.python.withPackages (ps: with ps; [
+    pyyaml
+    cheetah3
+    psutil
+    setuptools
+  ] ++ lib.optionals (versionAtLeast version "6.0") [
+    packaging
+    pymongo
+  ]);
+
+  mozjsVersion = "60";
+  mozjsReplace = "defined(HAVE___SINCOS)";
 
   system-libraries = [
     "boost"
@@ -95,7 +79,7 @@ in stdenv.mkDerivation rec {
     openssl
     openldap
     pcre-cpp
-    variants.python
+    python
     sasl
     snappy
     zlib
@@ -123,7 +107,7 @@ in stdenv.mkDerivation rec {
     # remove -march overriding, we know better.
     sed -i 's/env.Append.*-march=.*$/pass/' SConstruct
   '' + lib.optionalString (stdenv.isDarwin && versionOlder version "6.0") ''
-    substituteInPlace src/third_party/mozjs-${variants.mozjsVersion}/extract/js/src/jsmath.cpp --replace '${variants.mozjsReplace}' 0
+    substituteInPlace src/third_party/mozjs-${mozjsVersion}/extract/js/src/jsmath.cpp --replace '${mozjsReplace}' 0
   '' + lib.optionalString (stdenv.isDarwin && versionOlder version "3.6") ''
     substituteInPlace src/third_party/s2/s1angle.cc --replace drem remainder
     substituteInPlace src/third_party/s2/s1interval.cc --replace drem remainder