summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2022-06-19 08:17:57 +0100
committerGitHub <noreply@github.com>2022-06-19 08:17:57 +0100
commit2ea4d3721775fe0d08e82851e495497988bd7cc9 (patch)
tree578532b4b2ac3ba9f1c192435cbeb217b3b5fdb2
parent9ce903e48e9bda1806ab3276da6e367de274cf16 (diff)
parentfe50514741341007e4f0f2a6699463f95e4284e3 (diff)
downloadnixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar.gz
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar.bz2
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar.lz
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar.xz
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.tar.zst
nixpkgs-2ea4d3721775fe0d08e82851e495497988bd7cc9.zip
Merge pull request #178199 from aaronjheng/mongo-tools
mongodb-tools: use buildGoModule
-rw-r--r--pkgs/tools/misc/mongodb-tools/default.nix66
1 files changed, 29 insertions, 37 deletions
diff --git a/pkgs/tools/misc/mongodb-tools/default.nix b/pkgs/tools/misc/mongodb-tools/default.nix
index 4ede64b83aa..45e9a08a356 100644
--- a/pkgs/tools/misc/mongodb-tools/default.nix
+++ b/pkgs/tools/misc/mongodb-tools/default.nix
@@ -1,58 +1,50 @@
-{ lib
-, buildGoPackage
-, fetchFromGitHub
-, openssl
-, pkg-config
-, libpcap
-}:
-
-let
-  tools = [
-    "bsondump"
-    "mongoimport"
-    "mongoexport"
-    "mongodump"
-    "mongorestore"
-    "mongostat"
-    "mongofiles"
-    "mongotop"
-  ];
-  version = "100.5.3";
+{ lib, buildGoModule, fetchFromGitHub, openssl, pkg-config, libpcap }:
 
-in buildGoPackage {
+buildGoModule rec {
   pname = "mongo-tools";
-  inherit version;
-
-  goPackagePath = "github.com/mongodb/mongo-tools";
-  subPackages = tools;
+  version = "100.5.3";
 
   src = fetchFromGitHub {
-    rev = version;
     owner = "mongodb";
     repo = "mongo-tools";
+    rev = version;
     sha256 = "sha256-8RkpBCFVxKVsu4h2z+rhlwvYfbSDHZUg8erO4+2GRbw=";
   };
 
+  vendorSha256 = null;
+
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ openssl libpcap ];
 
   # Mongodb incorrectly names all of their binaries main
   # Let's work around this with our own installer
-  buildPhase = ''
-    # move vendored codes so nixpkgs go builder could find it
-    runHook preBuild
-
-    ${lib.concatMapStrings (t: ''
-      go build -o "$out/bin/${t}" -tags ssl -ldflags "-s -w" $goPackagePath/${t}/main
-    '') tools}
-
-    runHook postBuild
-  '';
+  buildPhase =
+    let
+      tools = [
+        "bsondump"
+        "mongodump"
+        "mongoexport"
+        "mongofiles"
+        "mongoimport"
+        "mongorestore"
+        "mongostat"
+        "mongotop"
+      ]; in
+    ''
+      # move vendored codes so nixpkgs go builder could find it
+      runHook preBuild
+
+      ${lib.concatMapStrings (t: ''
+        go build -o "$out/bin/${t}" -tags ssl -ldflags "-s -w" ./${t}/main
+      '') tools}
+
+      runHook postBuild
+    '';
 
   meta = {
     homepage = "https://github.com/mongodb/mongo-tools";
     description = "Tools for the MongoDB";
-    maintainers = with lib.maintainers; [ bryanasdev000 ];
     license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ bryanasdev000 ];
   };
 }