diff options
author | adisbladis <adisbladis@gmail.com> | 2019-09-05 22:27:09 +0100 |
---|---|---|
committer | adisbladis <adisbladis@gmail.com> | 2019-09-11 14:33:13 +0100 |
commit | a26a274a681dd32927926365f316a2d06d599ccf (patch) | |
tree | 82b92fb2dd02cfeb08b13cdbbdfee8aa91fdc424 /pkgs/tools/misc | |
parent | b0326145da9697821bc16bf0d8c758f2699ad66a (diff) |
mongodb-tools: 3.7.2 -> 4.2.0
Fix build with latest Go
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r-- | pkgs/tools/misc/mongodb-tools/default.nix | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/pkgs/tools/misc/mongodb-tools/default.nix b/pkgs/tools/misc/mongodb-tools/default.nix index dc7a64bdcf7e..fd95faa40e15 100644 --- a/pkgs/tools/misc/mongodb-tools/default.nix +++ b/pkgs/tools/misc/mongodb-tools/default.nix @@ -1,27 +1,38 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, openssl_1_0_2, pkgconfig, libpcap }: +{ stdenv +, lib +, buildGoPackage +, fetchFromGitHub +, openssl_1_0_2 +, pkgconfig +, libpcap +}: let tools = [ - "bsondump" "mongodump" "mongoexport" "mongofiles" "mongoimport" - "mongoreplay" "mongorestore" "mongostat" "mongotop" + "bsondump" + "mongoimport" + "mongoexport" + "mongodump" + "mongorestore" + "mongostat" + "mongofiles" + "mongotop" + "mongoreplay" ]; -in + version = "4.2.0"; -with stdenv.lib; - -buildGoPackage rec { +in buildGoPackage { pname = "mongo-tools"; - version = "3.7.2"; - rev = "r${version}"; + inherit version; goPackagePath = "github.com/mongodb/mongo-tools"; - subPackages = map (t: t + "/main") tools; + subPackages = tools; src = fetchFromGitHub { - inherit rev; + rev = "r${version}"; owner = "mongodb"; repo = "mongo-tools"; - sha256 = "1y5hd4qw7422sqkj8vmy4agscvin3ck54r515bjrzn69iw73nhfl"; + sha256 = "0mjwvx0cxvb6zam6jyr3753xjnwcygxcjzqhhlsq0b3xnwws9yh7"; }; nativeBuildInputs = [ pkgconfig ]; @@ -31,18 +42,18 @@ buildGoPackage rec { # Let's work around this with our own installer buildPhase = '' # move vendored codes so nixpkgs go builder could find it - mv go/src/github.com/mongodb/mongo-tools/vendor/src/* go/src/github.com/mongodb/mongo-tools/vendor/ - runHook preBuild + ${stdenv.lib.concatMapStrings (t: '' go build -o "$bin/bin/${t}" -tags ssl -ldflags "-s -w" $goPackagePath/${t}/main '') tools} + runHook postBuild ''; meta = { homepage = https://github.com/mongodb/mongo-tools; description = "Tools for the MongoDB"; - license = licenses.asl20; + license = lib.licenses.asl20; }; } |