blob: 2822beafce0a7f00aa2181a10b30cb4cc516bdc0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=usql
pkgver=0.12.0
pkgrel=1
pkgdesc="Universal command-line interface for SQL databases"
url="https://github.com/xo/usql"
arch="all"
license="MIT"
makedepends="go unixodbc-dev icu-dev"
source="
$pkgname-$pkgver.tar.gz::https://github.com/xo/usql/archive/refs/tags/v$pkgver.tar.gz
maxuint32-to-maxint32-pebble.patch.noauto::https://github.com/cockroachdb/pebble/commit/fcba2dcd95208a9681107aa15384d3489b17b0fa.diff
"
export CGO_ENABLED=1 # needed for godror and odbc drivers
export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="$srcdir/go-cache"
export GOTMPDIR="$srcdir"
export GOMODCACHE="$srcdir/go"
export _GOTAGS="all sqlite_app_armor sqlite_fts5 sqlite_introspect sqlite_json1 sqlite_stat4 sqlite_userauth sqlite_vtable sqlite_icu"
# netezza driver fails to build on 32-bit
# https://github.com/IBM/nzgo/issues/38
case "$CARCH" in
x86 | armhf | armv7) export _GOTAGS="$_GOTAGS no_netezza";;
esac
prepare() {
default_prepare
go mod download
chmod -R +w "$GOMODCACHE"
patch -p1 \
-d "$GOMODCACHE/github.com/cockroachdb/pebble@v0.0.0-20220802234154-04f9100f89f0" \
-i "$srcdir"/maxuint32-to-maxint32-pebble.patch.noauto
}
build() {
local _goldflags="
-X github.com/xo/usql/text.CommandName=$pkgname
-X github.com/xo/usql/text.CommandVersion=$pkgver
"
go build -v -ldflags "$_goldflags" -tags "$_GOTAGS" -o $pkgname
}
check() {
# Tests for specific drivers require docker
go test $(go list ./... | grep -v /drivers)
}
package() {
install -Dm755 $pkgname -t "$pkgdir"/usr/bin
}
sha512sums="
c4f0ccd299e428e9e563b489e2d3c59ef07b22377bea462faf0e2495345354291e701592ccd0d308daa6606bcc1cff67b7f2751756b13b6c4c95b682c7c8707d usql-0.12.0.tar.gz
ea629cc5da5eb414318f688c29f92833e2469794261eb697264fce2c48c8943a47bafedacb075996f35f46c8fd5dcaf0b2bc686d882c463e2e07e481eeedfd0a maxuint32-to-maxint32-pebble.patch.noauto
"
|