From a26a274a681dd32927926365f316a2d06d599ccf Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 5 Sep 2019 22:27:09 +0100 Subject: mongodb-tools: 3.7.2 -> 4.2.0 Fix build with latest Go --- pkgs/tools/misc/mongodb-tools/default.nix | 41 ++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'pkgs/tools/misc/mongodb-tools') diff --git a/pkgs/tools/misc/mongodb-tools/default.nix b/pkgs/tools/misc/mongodb-tools/default.nix index dc7a64bdcf7..fd95faa40e1 100644 --- a/pkgs/tools/misc/mongodb-tools/default.nix +++ b/pkgs/tools/misc/mongodb-tools/default.nix @@ -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; }; } -- cgit 1.4.1