git.iko.soy/typeable/nixpkgs
on master help sign in
mongodb: split packages to expose 3.4, 3.6 and 4.0
commit97c4dff1583b871605964c165056074f0a502d0b authorNathan Smyth <nathan.smyth@mongodb.com> dateFri 31 May 2019, 22:14 (7 years ago) parente9bec1a
6 files changed+114−36
pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patch+17 pkgs/servers/nosql/mongodb/default.nix → pkgs/servers/nosql/mongodb/mongodb.nix+46−35 pkgs/servers/nosql/mongodb/v3_4.nix+12 pkgs/servers/nosql/mongodb/v3_6.nix+12 pkgs/servers/nosql/mongodb/v4_0.nix+12 pkgs/top-level/all-packages.nix+15−1
pkgs/servers/nosql/mongodb/forget-build-dependencies-3-4.patchnew file+17
@@ -0,0 +1,17 @@
1+--- a/site_scons/mongo_scons_utils.py
2++++ b/site_scons/mongo_scons_utils.py
3+@@ -84,14 +84,11 @@
4+ def default_buildinfo_environment_data():
5+ return (
6+ ('distmod', '$MONGO_DISTMOD', True, True,),
7+ ('distarch', '$MONGO_DISTARCH', True, True,),
8+ ('cc', '$CC_VERSION', True, False,),
9+- ('ccflags', '$CCFLAGS', True, False,),
10+ ('cxx', '$CXX_VERSION', True, False,),
11+- ('cxxflags', '$CXXFLAGS', True, False,),
12+- ('linkflags', '$LINKFLAGS', True, False,),
13+ ('target_arch', '$TARGET_ARCH', True, True,),
14+ ('target_os', '$TARGET_OS', True, False,),
15+ )
16+
17+ # If you want buildInfo and --version to be relatively empty, set
pkgs/servers/nosql/mongodb/default.nix → pkgs/servers/nosql/mongodb/mongodb.nixrenamed+46−35
@@ -1,49 +1,59 @@
1−{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib,
2− libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool, curl
3−}:
1+{ stdenv, fetchurl, fetchpatch, scons, boost, gperftools, pcre-cpp, snappy, zlib
2+, libyamlcpp, sasl, openssl, libpcap, wiredtiger, Security, python27, libtool
3+, curl }:
44
55# Note:
66# The command line tools are written in Go as part of a different package (mongodb-tools)
77
88with stdenv.lib;
99
10−let version = "4.0.4";
11− python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]);
12− system-libraries = [
13− "pcre"
14− #"asio" -- XXX use package?
15− #"wiredtiger"
16− "boost"
17− "snappy"
18− "zlib"
19− #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
20− #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
21− "yaml"
22− ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
23− inherit (stdenv.lib) systems subtractLists;
24−
25−in stdenv.mkDerivation {
26− pname = "mongodb";
10+{ version, sha256, patches ? [ ] }@args:
11+
12+let
13+ python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]);
14+ system-libraries = [
15+ "pcre"
16+ #"asio" -- XXX use package?
17+ #"wiredtiger"
18+ "boost"
19+ "snappy"
20+ "zlib"
21+ #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source.
22+ #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs).
23+ "yaml"
24+ ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
25+ inherit (stdenv.lib) systems subtractLists;
26+
27+in stdenv.mkDerivation rec {
2728 inherit version;
29+ name = "mongodb-${version}";
2830
2931 src = fetchurl {
3032 url = "https://fastdl.mongodb.org/src/mongodb-src-r${version}.tar.gz";
31− sha256 = "1qycwr9f99b5cy4nf54yv2y724xis3lwd2h6iv2pfp36qnhsvfh2";
33+ inherit sha256;
3234 };
3335
3436 nativeBuildInputs = [ scons ];
3537 buildInputs = [
36− sasl boost gperftools pcre-cpp snappy
37− zlib libyamlcpp sasl openssl.dev openssl.out libpcap python curl
38+ sasl
39+ boost
40+ gperftools
41+ pcre-cpp
42+ snappy
43+ zlib
44+ libyamlcpp
45+ sasl
46+ openssl.dev
47+ openssl.out
48+ libpcap
49+ python
50+ curl
3851 ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libtool ];
3952
40− patches =
41− [
42− # MongoDB keeps track of its build parameters, which tricks nix into
43− # keeping dependencies to build inputs in the final output.
44− # We remove the build flags from buildInfo data.
45− ./forget-build-dependencies.patch
46− ];
53+ # MongoDB keeps track of its build parameters, which tricks nix into
54+ # keeping dependencies to build inputs in the final output.
55+ # We remove the build flags from buildInfo data.
56+ inherit patches;
4757
4858 postPatch = ''
4959 # fix environment variable reading
@@ -63,7 +73,8 @@ in stdenv.mkDerivation {
6373 --replace 'engine("wiredTiger")' 'engine("mmapv1")'
6474 '';
6575
66− NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
76+ NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
77+ "-Wno-unused-command-line-argument";
6778
6879 sconsFlags = [
6980 "--release"
@@ -84,11 +95,11 @@ in stdenv.mkDerivation {
8495 '';
8596
8697 preInstall = ''
87− mkdir -p $out/lib
98+ mkdir -p "$out/lib"
8899 '';
89100
90101 postInstall = ''
91− rm $out/bin/install_compass
102+ rm -f "$out/bin/install_compass" || true
92103 '';
93104
94105 prefixKey = "--prefix=";
@@ -99,9 +110,9 @@ in stdenv.mkDerivation {
99110
100111 meta = {
101112 description = "A scalable, high-performance, open source NoSQL database";
102− homepage = http://www.mongodb.org;
113+ homepage = "http://www.mongodb.org";
103114 license = licenses.sspl;
104− broken = stdenv.hostPlatform.isAarch64; #g++ has internal compiler errors
115+ broken = stdenv.hostPlatform.isAarch64; # g++ has internal compiler errors
105116
106117 maintainers = with maintainers; [ bluescreen303 offline cstrahan ];
107118 platforms = subtractLists systems.doubles.i686 systems.doubles.unix;
pkgs/servers/nosql/mongodb/v3_4.nixnew file+12
@@ -0,0 +1,12 @@
1+{ stdenv, callPackage, lib, sasl, boost, Security }:
2+
3+let
4+ buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; };
5+in
6+ buildMongoDB {
7+ version = "3.4.20";
8+ sha256 = "15avrhakbspz0q1w5n7dqzjjfkxi7md64a9axl97gfxi4ln7mhz0";
9+ patches = [
10+ ./forget-build-dependencies-3-4.patch
11+ ];
12+ }
pkgs/servers/nosql/mongodb/v3_6.nixnew file+12
@@ -0,0 +1,12 @@
1+{ stdenv, callPackage, lib, sasl, boost, Security }:
2+
3+let
4+ buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; };
5+in
6+ buildMongoDB {
7+ version = "3.6.12";
8+ sha256 = "1fi1ccid4rnfjg6yn3183qrhjqc8hz7jfgdpwp1dy6piw6z85n3l";
9+ patches = [
10+ ./forget-build-dependencies.patch
11+ ];
12+ }
pkgs/servers/nosql/mongodb/v4_0.nixnew file+12
@@ -0,0 +1,12 @@
1+{ stdenv, callPackage, lib, sasl, boost, Security }:
2+
3+let
4+ buildMongoDB = callPackage ./mongodb.nix { inherit sasl; inherit boost; inherit Security; };
5+in
6+ buildMongoDB {
7+ version = "4.0.9";
8+ sha256 = "0klm6dl1pr9wq4ghm2jjn3wzs1zpj1aabqjqjfddanxq2an7scph";
9+ patches = [
10+ ./forget-build-dependencies.patch
11+ ];
12+ }
pkgs/top-level/all-packages.nix+15−1
@@ -15894,7 +15894,21 @@ in
1589415894 };
1589515895 mysql = mariadb; # TODO: move to aliases.nix
1589615896
15897− mongodb = callPackage ../servers/nosql/mongodb {
15897+ mongodb = hiPrio mongodb-3_4;
15898+
15899+ mongodb-3_4 = callPackage ../servers/nosql/mongodb/v3_4.nix {
15900+ sasl = cyrus_sasl;
15901+ boost = boost160;
15902+ inherit (darwin.apple_sdk.frameworks) Security;
15903+ };
15904+
15905+ mongodb-3_6 = callPackage ../servers/nosql/mongodb/v3_6.nix {
15906+ sasl = cyrus_sasl;
15907+ boost = boost160;
15908+ inherit (darwin.apple_sdk.frameworks) Security;
15909+ };
15910+
15911+ mongodb-4_0 = callPackage ../servers/nosql/mongodb/v4_0.nix {
1589815912 sasl = cyrus_sasl;
1589915913 boost = boost160;
1590015914 openssl = openssl_1_0_2;