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:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user