You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.0 KiB
51 lines
1.0 KiB
3 years ago
|
# Copyright 2021 Gentoo Authors
|
||
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=7
|
||
|
inherit go-module
|
||
|
|
||
3 years ago
|
MY_PN=jpp
|
||
|
MY_P=${MY_PN}-${PV}
|
||
|
|
||
3 years ago
|
DESCRIPTION="Command line interface to JMESPath"
|
||
3 years ago
|
HOMEPAGE="https://github.com/pipebus/jpp https://github.com/jmespath/jp http://jmespath.org"
|
||
|
SRC_URI="https://github.com/pipebus/jpp/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.tar.gz"
|
||
3 years ago
|
|
||
|
LICENSE="Apache-2.0 MIT"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64"
|
||
3 years ago
|
IUSE="+jp +jpp"
|
||
3 years ago
|
RESTRICT+=" test"
|
||
3 years ago
|
REQUIRED_USE="|| ( jp jpp )"
|
||
|
|
||
|
S=${WORKDIR}/${MY_P}
|
||
3 years ago
|
|
||
|
src_prepare() {
|
||
|
if [[ -e $S/go.mod ]]; then
|
||
|
die "found unexpected $S/go.mod"
|
||
|
fi
|
||
|
cat <<-EOF > "$S/go.mod"
|
||
|
module github.com/jmespath/jp
|
||
|
replace github.com/jmespath/jp => ./
|
||
|
EOF
|
||
|
|
||
|
sed -e 's|except Exception, e|except Exception as e|' -i test/jp-compliance || die
|
||
|
|
||
|
default
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
3 years ago
|
if use jp; then
|
||
|
go build -mod=readonly -o ./jp ./jp.go || die
|
||
|
fi
|
||
|
if use jpp; then
|
||
|
go build -mod=readonly -o ./jpp ./cmd/jpp/main.go || die
|
||
|
fi
|
||
3 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
3 years ago
|
use jp && dobin "./jp"
|
||
|
use jpp && dobin "./jpp"
|
||
3 years ago
|
dodoc README.md
|
||
|
}
|