depot/third_party/nixpkgs/pkgs/tools/misc/tbls/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

52 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, testers
, tbls
}:
buildGoModule rec {
pname = "tbls";
version = "1.61.0";
src = fetchFromGitHub {
owner = "k1LoW";
repo = "tbls";
rev = "v${version}";
hash = "sha256-yXD/LILWaXtjd3etdWINglZtvIYE6i6qmCSR3FUUQeM=";
};
vendorHash = "sha256-AeaTAjo1wRl7Ymg/fyoijaa9UXf9SiNR447WJtZeN5o=";
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 ];
};
}