mongodb-tools: 3.7.2 -> 4.2.0
Fix build with latest Go
This commit is contained in:
parent
b0326145da
commit
a26a274a68
@ -1,27 +1,38 @@
|
|||||||
{ stdenv, buildGoPackage, fetchFromGitHub, openssl_1_0_2, pkgconfig, libpcap }:
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, buildGoPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, openssl_1_0_2
|
||||||
|
, pkgconfig
|
||||||
|
, libpcap
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
tools = [
|
tools = [
|
||||||
"bsondump" "mongodump" "mongoexport" "mongofiles" "mongoimport"
|
"bsondump"
|
||||||
"mongoreplay" "mongorestore" "mongostat" "mongotop"
|
"mongoimport"
|
||||||
|
"mongoexport"
|
||||||
|
"mongodump"
|
||||||
|
"mongorestore"
|
||||||
|
"mongostat"
|
||||||
|
"mongofiles"
|
||||||
|
"mongotop"
|
||||||
|
"mongoreplay"
|
||||||
];
|
];
|
||||||
in
|
version = "4.2.0";
|
||||||
|
|
||||||
with stdenv.lib;
|
in buildGoPackage {
|
||||||
|
|
||||||
buildGoPackage rec {
|
|
||||||
pname = "mongo-tools";
|
pname = "mongo-tools";
|
||||||
version = "3.7.2";
|
inherit version;
|
||||||
rev = "r${version}";
|
|
||||||
|
|
||||||
goPackagePath = "github.com/mongodb/mongo-tools";
|
goPackagePath = "github.com/mongodb/mongo-tools";
|
||||||
subPackages = map (t: t + "/main") tools;
|
subPackages = tools;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
inherit rev;
|
rev = "r${version}";
|
||||||
owner = "mongodb";
|
owner = "mongodb";
|
||||||
repo = "mongo-tools";
|
repo = "mongo-tools";
|
||||||
sha256 = "1y5hd4qw7422sqkj8vmy4agscvin3ck54r515bjrzn69iw73nhfl";
|
sha256 = "0mjwvx0cxvb6zam6jyr3753xjnwcygxcjzqhhlsq0b3xnwws9yh7";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
@ -31,18 +42,18 @@ buildGoPackage rec {
|
|||||||
# Let's work around this with our own installer
|
# Let's work around this with our own installer
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
# move vendored codes so nixpkgs go builder could find it
|
# 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
|
runHook preBuild
|
||||||
|
|
||||||
${stdenv.lib.concatMapStrings (t: ''
|
${stdenv.lib.concatMapStrings (t: ''
|
||||||
go build -o "$bin/bin/${t}" -tags ssl -ldflags "-s -w" $goPackagePath/${t}/main
|
go build -o "$bin/bin/${t}" -tags ssl -ldflags "-s -w" $goPackagePath/${t}/main
|
||||||
'') tools}
|
'') tools}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = https://github.com/mongodb/mongo-tools;
|
homepage = https://github.com/mongodb/mongo-tools;
|
||||||
description = "Tools for the MongoDB";
|
description = "Tools for the MongoDB";
|
||||||
license = licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1993,11 +1993,7 @@ in
|
|||||||
|
|
||||||
mongodb-compass = callPackage ../tools/misc/mongodb-compass { };
|
mongodb-compass = callPackage ../tools/misc/mongodb-compass { };
|
||||||
|
|
||||||
mongodb-tools = callPackage ../tools/misc/mongodb-tools {
|
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
moosefs = callPackage ../tools/filesystems/moosefs { };
|
moosefs = callPackage ../tools/filesystems/moosefs { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user