Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 56 lines 1.4 kB view raw
1{ buildGoModule 2, fetchFromGitHub 3, installShellFiles 4, lib 5, sqlcmd 6, testers 7}: 8 9buildGoModule rec { 10 pname = "sqlcmd"; 11 version = "1.8.0"; 12 13 src = fetchFromGitHub { 14 repo = "go-sqlcmd"; 15 owner = "microsoft"; 16 rev = "v${version}"; 17 sha256 = "sha256-QW8cDGXaj/10Y9UsU3WLalnFkf1+2ZBrFpf0Y5eTPUQ="; 18 }; 19 20 vendorHash = "sha256-DgIn01nUIX1+JigC1Jr5ZqG3tAYiOPUm6md/TdcD2U4="; 21 proxyVendor = true; 22 23 ldflags = [ "-s" "-w" "-X main.version=${version}" ]; 24 25 subPackages = [ "cmd/modern" ]; 26 27 nativeBuildInputs = [ installShellFiles ]; 28 29 preCheck = '' 30 export HOME=$(mktemp -d) 31 ''; 32 33 postInstall = '' 34 mv $out/bin/modern $out/bin/sqlcmd 35 36 installShellCompletion --cmd sqlcmd \ 37 --bash <($out/bin/sqlcmd completion bash) \ 38 --fish <($out/bin/sqlcmd completion fish) \ 39 --zsh <($out/bin/sqlcmd completion zsh) 40 ''; 41 42 passthru.tests.version = testers.testVersion { 43 package = sqlcmd; 44 command = "sqlcmd --version"; 45 inherit version; 46 }; 47 48 meta = { 49 description = "Command line tool for working with Microsoft SQL Server, Azure SQL Database, and Azure Synapse"; 50 mainProgram = "sqlcmd"; 51 homepage = "https://github.com/microsoft/go-sqlcmd"; 52 changelog = "https://github.com/microsoft/go-sqlcmd/releases/tag/v${version}"; 53 license = lib.licenses.mit; 54 maintainers = [ lib.maintainers.ratsclub ]; 55 }; 56}