dbtpl: init at 1.1.0

+67
+67
pkgs/by-name/db/dbtpl/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + buildGoModule, 5 + fetchFromGitHub, 6 + installShellFiles, 7 + buildPackages, 8 + versionCheckHook, 9 + nix-update-script, 10 + }: 11 + buildGoModule (finalAttrs: { 12 + pname = "dbtpl"; 13 + version = "1.1.0"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "xo"; 17 + repo = "dbtpl"; 18 + tag = "v${finalAttrs.version}"; 19 + hash = "sha256-r0QIgfDSt7HWnIDnJWGbwkqkXWYWGXoF5H/+zS6gEtE="; 20 + }; 21 + 22 + vendorHash = "sha256-scJRJaaccQovxhzC+/OHuPR4NRaE8+u57S1JY40bif8="; 23 + 24 + nativeBuildInputs = [ 25 + installShellFiles 26 + ]; 27 + 28 + modPostBuild = '' 29 + substituteInPlace vendor/github.com/xo/ox/ox.go \ 30 + --replace-warn "ver := \"(devel)\"" "ver := \"${finalAttrs.version}\"" 31 + ''; 32 + 33 + postInstall = 34 + let 35 + exe = 36 + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then 37 + "$out/bin/dbtpl" 38 + else 39 + lib.getExe buildPackages.dbtpl; 40 + in 41 + '' 42 + installShellCompletion --cmd dbtpl \ 43 + --bash <(${exe} completion bash) \ 44 + --fish <(${exe} completion fish) \ 45 + --zsh <(${exe} completion zsh) 46 + ''; 47 + 48 + nativeInstallCheckInputs = [ 49 + versionCheckHook 50 + ]; 51 + versionCheckProgramArg = "version"; 52 + doInstallCheck = true; 53 + 54 + passthru.updateScript = nix-update-script { }; 55 + 56 + meta = { 57 + description = "Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server"; 58 + homepage = "https://github.com/xo/dbtpl"; 59 + changelog = "https://github.com/xo/dbtpl/releases/tag/v${finalAttrs.version}"; 60 + license = lib.licenses.mit; 61 + maintainers = with lib.maintainers; [ 62 + xiaoxiangmoe 63 + shellhazard 64 + ]; 65 + mainProgram = "dbtpl"; 66 + }; 67 + })