Files
guru/dev-db/sqlcmd/sqlcmd-1.11.0.ebuild
T

43 lines
1.0 KiB
Bash
Raw Normal View History

2026-11-29 06:18:27 +01:00
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module shell-completion
DESCRIPTION="The MSSQL SQLCMD CLI tool"
HOMEPAGE="https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility"
SRC_URI="https://github.com/microsoft/go-${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
DEPS_URI="https://github.com/gentoo-golang-dist/go-${PN}/releases/download/v${PV}/go-${P}-vendor.tar.xz"
SRC_URI+=" ${DEPS_URI}"
S="${WORKDIR}/go-${P}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
BDEPEND=">=dev-lang/go-1.26.0"
src_compile() {
ego build -o "${PN}" -ldflags="-X main.version=${PV}" ./cmd/modern
}
src_install() {
dobin "${PN}"
mkdir "completions" || die
./sqlcmd completion bash > "completions/${PN}" || die
./sqlcmd completion fish > "completions/${PN}.fish" || die
./sqlcmd completion zsh > "completions/_${PN}" || die
dobashcomp "completions/${PN}"
dofishcomp "completions/${PN}.fish"
dozshcomp "completions/_${PN}"
local DOCS=(
"README.md"
"SECURITY.md"
)
einstalldocs
}