blob: 4aee21687e7aa35026afda74e015eae1670a6154 (
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
|
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module
EGIT_COMMIT=0607aa5
DESCRIPTION="Pure Go implementation of jq with yaml support"
HOMEPAGE="https://github.com/itchyny/gojq"
SRC_URI="https://github.com/itchyny/gojq/archive/refs/tags/v${PV}.tar.gz -> ${P/-go/}.tar.gz
https://dev.gentoo.org/~zmedico/dist/${P/-go/}-deps.tar.xz"
LICENSE="MIT"
LICENSE+=" Apache-2.0 BSD"
SLOT="0"
KEYWORDS="~amd64"
DOCS=(README.md)
src_prepare() {
default
local -a sed_args=(
-e "s/^VERSION := .*/VERSION := ${PV}/"
-e "s/^CURRENT_REVISION = .*/CURRENT_REVISION = ${EGIT_COMMIT}/"
)
# -buildmode=pie not supported when -race is enabled
[[ ${GOFLAGS} == *buildmode=pie* ]] && sed_args+=(
-e 's/ -race / /'
)
sed "${sed_args[@]}" -i Makefile || die
}
src_compile() {
emake build
}
src_install() {
einstalldocs
dobin "${PN}"
}
src_test() {
emake test
}
|