ff1a94e523
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, lib
|
|
, sqlcmd
|
|
, testers
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "sqlcmd";
|
|
version = "1.6.0";
|
|
|
|
src = fetchFromGitHub {
|
|
repo = "go-sqlcmd";
|
|
owner = "microsoft";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-LLRNaY6ArUNoKSWSauCh2RKEGO5+G1OnoCAqMaAfOkY=";
|
|
};
|
|
|
|
vendorHash = "sha256-G6Patjrafg9VXXbisBDs/JVvy0SA6moTquKj66z9lzw=";
|
|
proxyVendor = true;
|
|
|
|
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
|
|
|
subPackages = [ "cmd/modern" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
postInstall = ''
|
|
mv $out/bin/modern $out/bin/sqlcmd
|
|
|
|
installShellCompletion --cmd sqlcmd \
|
|
--bash <($out/bin/sqlcmd completion bash) \
|
|
--fish <($out/bin/sqlcmd completion fish) \
|
|
--zsh <($out/bin/sqlcmd completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = sqlcmd;
|
|
command = "sqlcmd --version";
|
|
inherit version;
|
|
};
|
|
|
|
meta = {
|
|
description = "A command line tool for working with Microsoft SQL Server, Azure SQL Database, and Azure Synapse";
|
|
mainProgram = "sqlcmd";
|
|
homepage = "https://github.com/microsoft/go-sqlcmd";
|
|
changelog = "https://github.com/microsoft/go-sqlcmd/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = [ lib.maintainers.ratsclub ];
|
|
};
|
|
}
|