summary refs log tree commit diff
path: root/pkgs/tools/misc/tbls/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/tbls/default.nix')
-rw-r--r--pkgs/tools/misc/tbls/default.nix34
1 files changed, 19 insertions, 15 deletions
diff --git a/pkgs/tools/misc/tbls/default.nix b/pkgs/tools/misc/tbls/default.nix
index 5b2d1609716..f9f334fb103 100644
--- a/pkgs/tools/misc/tbls/default.nix
+++ b/pkgs/tools/misc/tbls/default.nix
@@ -1,49 +1,53 @@
 { lib
+, stdenv
 , buildGoModule
 , fetchFromGitHub
+, installShellFiles
 , testers
 , tbls
 }:
 
 buildGoModule rec {
   pname = "tbls";
-  version = "1.68.2";
+  version = "1.71.0";
 
   src = fetchFromGitHub {
     owner = "k1LoW";
     repo = "tbls";
     rev = "v${version}";
-    hash = "sha256-yDWAKkzRb487iZ+5tmIH1qfuHj0TldOT+tTQwtVyX7s=";
+    hash = "sha256-cV5t4gNhPODGzJoLZdft6/9gBBVio50BJKYEI24a8qg=";
   };
 
-  vendorHash = "sha256-V6TF7Q+9XxBeSVXlotu8tUrNCWDr80BZsQcVSBGikl8=";
+  vendorHash = "sha256-1w1pQyHTuEJ1w01lJIZhXuEArFigjoFKGvi0cpFd8m0=";
 
-  CGO_CFLAGS = [ "-Wno-format-security" ];
+  nativeBuildInputs = [ installShellFiles ];
+
+  ldflags = [ "-s" "-w" ];
 
-  ldflags = [
-    "-s"
-    "-w"
-    "-X github.com/k1LoW/tbls.commit=unspecified"
-    "-X github.com/k1LoW/tbls.date=unspecified"
-    "-X github.com/k1LoW/tbls.version=${src.rev}"
-    "-X github.com/k1LoW/tbls/version.Version=${src.rev}"
-  ];
+  CGO_CFLAGS = [ "-Wno-format-security" ];
 
   preCheck = ''
     # Remove tests that require additional services.
     rm -f \
-       datasource/datasource_test.go \
+       datasource/*_test.go \
        drivers/*/*_test.go
   '';
 
+  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
+    installShellCompletion --cmd tbls \
+      --bash <($out/bin/tbls completion bash) \
+      --fish <($out/bin/tbls completion fish) \
+      --zsh <($out/bin/tbls completion zsh)
+  '';
+
   passthru.tests.version = testers.testVersion {
     package = tbls;
     command = "tbls version";
-    version = src.rev;
+    inherit version;
   };
 
   meta = with lib; {
-    description = "A tool to generate documentation based on a database";
+    description = "A tool to generate documentation based on a database structure";
     homepage = "https://github.com/k1LoW/tbls";
     changelog = "https://github.com/k1LoW/tbls/blob/${src.rev}/CHANGELOG.md";
     license = licenses.mit;