about summary refs log tree commit diff
path: root/pkgs/tools/misc/tbls
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-09-04 02:23:15 +0300
committerAzat Bahawi <azat@bahawi.net>2022-09-11 11:58:45 +0300
commit2930136b74c428ec9efeedec20930ca8fc8e6c2a (patch)
tree4bc519a028cc11ee30db1475e78f579fb304a227 /pkgs/tools/misc/tbls
parent91e1f0cd62ca3231a82a88209fdf3f66c6d4c310 (diff)
tbls: init at 1.56.2
Fixes: #189640
Diffstat (limited to 'pkgs/tools/misc/tbls')
-rw-r--r--pkgs/tools/misc/tbls/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/tools/misc/tbls/default.nix b/pkgs/tools/misc/tbls/default.nix
new file mode 100644
index 0000000000000..83e689a416f6e
--- /dev/null
+++ b/pkgs/tools/misc/tbls/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, testers
+, tbls
+}:
+
+buildGoModule rec {
+  pname = "tbls";
+  version = "1.56.2";
+
+  src = fetchFromGitHub {
+    owner = "k1LoW";
+    repo = "tbls";
+    rev = "v${version}";
+    sha256 = "sha256-fJbdZlgegC54OIAbygKO5GzNh6UAuT4OZp7KK+XJhvI=";
+  };
+
+  vendorSha256 = "sha256-pmnSeQHZEtsshldfq6D/r5pMYA5ivMWkzjOq2/WseYU=";
+
+  CGO_CFLAGS = [ "-Wno-format-security" ];
+
+  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}"
+  ];
+
+  preCheck = ''
+    # Remove tests that require additional services.
+    rm -f \
+       datasource/datasource_test.go \
+       drivers/*/*_test.go
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = tbls;
+    command = "tbls version";
+    version = src.rev;
+  };
+
+  meta = with lib; {
+    description = "A tool to generate documentation based on a database";
+    homepage = "https://github.com/k1LoW/tbls";
+    changelog = "https://github.com/k1LoW/tbls/blob/${src.rev}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ azahi ];
+  };
+}