Skip to content

Commit

Permalink
mongodb-tools: 3.7.2 -> 4.2.0
Browse files Browse the repository at this point in the history
Fix build with latest Go
  • Loading branch information
adisbladis committed Sep 11, 2019
1 parent b032614 commit a26a274
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
41 changes: 26 additions & 15 deletions pkgs/tools/misc/mongodb-tools/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
Expand All @@ -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;
};
}
6 changes: 1 addition & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1993,11 +1993,7 @@ in

mongodb-compass = callPackage ../tools/misc/mongodb-compass { };

mongodb-tools = callPackage ../tools/misc/mongodb-tools {
# XXX: this is failing with Go 1.12. Error is related to cgo, an
# update to this package might fix it.
buildGoPackage = buildGo111Package;
};
mongodb-tools = callPackage ../tools/misc/mongodb-tools { };

moosefs = callPackage ../tools/filesystems/moosefs { };

Expand Down

0 comments on commit a26a274

Please sign in to comment.