mongodb-tools: 3.0.12 -> 3.5.13 (#29884)

* Upgrade mongodb-tools to 3.5.13 with ssl

* mongodb-tools: fix go references
This commit is contained in:
amorsillo
2017-09-28 11:42:00 +01:00
committed by Jörg Thalheim
parent 8e4586d077
commit b46b0468ca
2 changed files with 166 additions and 21 deletions
+21 -11
View File
@@ -1,4 +1,4 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoPackage, fetchFromGitHub, openssl_1_0_2, pkgconfig, libpcap }:
let
tools = [
@@ -6,9 +6,12 @@ let
"mongooplog" "mongorestore" "mongostat" "mongotop"
];
in
with stdenv.lib;
buildGoPackage rec {
name = "mongo-tools-${version}";
version = "3.0.12";
version = "3.5.13";
rev = "r${version}";
goPackagePath = "github.com/mongodb/mongo-tools";
@@ -18,20 +21,27 @@ buildGoPackage rec {
inherit rev;
owner = "mongodb";
repo = "mongo-tools";
sha256 = "142vxgniri1mfy2xmfgxhbdp6k6h8c5milv454krv1b51v43hsbm";
sha256 = "00klm4pyx5k39nn4pmfrpnkqxdhbzm7lprgwxszpirzrarh2g164";
};
goDeps = ./deps.nix;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ openssl_1_0_2 libpcap ];
# Mongodb incorrectly names all of their binaries main
# Let's work around this with our own installer
preInstall = ''
mkdir -p $bin/bin
'' + toString (map (t: ''
go install $goPackagePath/${t}/main
mv go/bin/main $bin/bin/${t}
''
) tools) + ''
rm -r go/bin
buildPhase = ''
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;
};
}