mongodb-tools: 3.7.2 -> 4.2.0

Fix build with latest Go
This commit is contained in:
adisbladis 2019-09-05 22:27:09 +01:00
parent b0326145da
commit a26a274a68
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
2 changed files with 27 additions and 20 deletions

View file

@ -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;
};
}

View file

@ -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 { };