diff options
author | George Rawlinson | 2022-01-12 03:20:18 +0000 |
---|---|---|
committer | George Rawlinson | 2022-01-12 03:20:18 +0000 |
commit | 0974642befefc6c1d47c284414518d058bedc2cd (patch) | |
tree | 91c50f634215daab67da0593605991becbf083ad | |
download | aur-0974642befefc6c1d47c284414518d058bedc2cd.tar.gz |
addpkg: octosql 0.4.2-1
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 75 |
2 files changed, 90 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5813c825f39d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = octosql + pkgdesc = A CLI tool which lets you query a plethora of databases and file formats using SQL + pkgver = 0.4.2 + pkgrel = 1 + url = https://github.com/cube2222/octosql + arch = x86_64 + license = MPL2 + makedepends = git + makedepends = go + depends = glibc + options = !lto + source = octosql::git+https://github.com/cube2222/octosql.git#commit=f2f6b4d056c1d735e26f4de810b1061bda64d381 + md5sums = SKIP + +pkgname = octosql diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..39d249dcd582 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,75 @@ +# Maintainer: Your Name <youremail@domain.com> + +pkgname=octosql +pkgver=0.4.2 +pkgrel=1 +pkgdesc="A CLI tool which lets you query a plethora of databases and file formats using SQL" +arch=('x86_64') +url="https://github.com/cube2222/octosql" +license=('MPL2') +depends=('glibc') +makedepends=('git' 'go') +options=('!lto') +_commit='f2f6b4d056c1d735e26f4de810b1061bda64d381' +source=("$pkgname::git+$url.git#commit=$_commit") +md5sums=('SKIP') + +pkgver() { + cd "$pkgname" + git describe --tags | sed "s/^v//" +} + +prepare() { + cd "$pkgname" + + # create directory for build output + mkdir build + + # download dependencies + go mod download +} + +build() { + cd "$pkgname" + + # set Go flags + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + # binary + go build -v \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-linkmode external -extldflags ${LDFLAGS} \ + -X github.com/cube2222/octosql/cmd.VERSION=$pkgver" \ + -o build \ + . + + # generate shell completions + for shell in bash fish zsh; do + ./build/octosql completion "$shell" > "build/$shell.completion" + done +} + +check() { + cd "$pkgname" + go test -v ./... +} + +package() { + cd "$pkgname" + + # binary + install -vDm755 -t "$pkgdir/usr/bin" build/octosql + + # documentation + install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md + + # shell completions + install -vDm644 build/bash.completion "$pkgdir/usr/share/bash-completion/completions/$pkgname" + install -vDm644 build/fish.completion "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish" + install -vDm644 build/zsh.completion "$pkgdir/usr/share/zsh/site-functions/_$pkgname" +} |