2022-09-14 18:05:37 +00:00
|
|
|
{ lib
|
2023-11-16 04:20:00 +00:00
|
|
|
, stdenv
|
2022-09-14 18:05:37 +00:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, installShellFiles
|
2022-09-14 18:05:37 +00:00
|
|
|
, testers
|
|
|
|
, tbls
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "tbls";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "1.78.0";
|
2022-09-14 18:05:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "k1LoW";
|
|
|
|
repo = "tbls";
|
|
|
|
rev = "v${version}";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-vqt4IlVvqlUjDqvcdiRctt/VuEkZ5YzCXYHvHfc87Ew=";
|
2022-09-14 18:05:37 +00:00
|
|
|
};
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
vendorHash = "sha256-cnACY+NIjsVe6BU7AjTO+yLDn0f1HO1gHnw5SgqKuy4=";
|
2022-09-14 18:05:37 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
2022-09-14 18:05:37 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
CGO_CFLAGS = [ "-Wno-format-security" ];
|
2022-09-14 18:05:37 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Remove tests that require additional services.
|
|
|
|
rm -f \
|
2023-11-16 04:20:00 +00:00
|
|
|
datasource/*_test.go \
|
2022-09-14 18:05:37 +00:00
|
|
|
drivers/*/*_test.go
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = tbls;
|
|
|
|
command = "tbls version";
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit version;
|
2022-09-14 18:05:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool to generate documentation based on a database structure";
|
2022-09-14 18:05:37 +00:00
|
|
|
homepage = "https://github.com/k1LoW/tbls";
|
|
|
|
changelog = "https://github.com/k1LoW/tbls/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ azahi ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "tbls";
|
2022-09-14 18:05:37 +00:00
|
|
|
};
|
|
|
|
}
|