blob: 77be61e8ab5838b8f8462e0a8ebf873588cfb37a (
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
62
63
64
65
66
|
# Maintainer: Adrian Lopez <zeioth@hotmail.com>
# Maintainer: txtsd <aur.archlinux@ihavea.quest>
pkgname=linux-command-gpt-git
_pkgname=linux-command-gpt
pkgver=0.2.1.r1.g7a40d8d
pkgrel=2
pkgdesc='Get Linux commands in natural language with the power of ChatGPT'
arch=(x86_64 aarch64)
url='https://github.com/asrul10/linux-command-gpt'
license=('MIT')
depends=(glibc)
makedepends=(git go)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("git+${url}")
sha256sums=('SKIP')
pkgver() {
cd "${_pkgname}"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${_pkgname}"
export GOPATH="${srcdir}"
export GOFLAGS="-modcacherw"
go mod download
}
build() {
cd "${_pkgname}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOPATH="${srcdir}"
export GOFLAGS="\
-buildmode=pie \
-mod=readonly \
-modcacherw \
-trimpath \
"
local _ld_flags=" \
-compressdwarf=false \
-linkmode=external \
"
go build \
-ldflags "${_ldflags}" \
-o lcg
}
check() {
cd "${_pkgname}"
go test ./...
}
package() {
cd "${_pkgname}"
install -Dm755 "lcg" "${pkgdir}/usr/bin/lcg"
install -Dm755 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|