guru/dev-db/libpg_query/libpg_query-17.6.0.0.ebuild
Julien Roy 2f531224f5
dev-db/libpg_query: add 17.6.0.0
Signed-off-by: Julien Roy <julien@jroy.ca>
2024-11-19 09:00:50 -05:00

47 lines
1014 B
Bash

# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PV="${PV/\./-}"
DESCRIPTION="C library for accessing the PostgreSQL parser outside of the server environment"
HOMEPAGE="https://github.com/pganalyze/libpg_query"
SRC_URI="https://github.com/pganalyze/libpg_query/archive/${MY_PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-${MY_PV}"
LICENSE="BSD"
SLOT="0/16"
KEYWORDS="~amd64"
IUSE="examples static-libs"
BDEPEND="
dev-libs/protobuf-c
dev-libs/xxhash
"
src_prepare() {
default
if ! use static-libs; then
sed -i -e "s/^install: \$(ARLIB) \$(SOLIB)$/install: \$(SOLIB)/" "${S}"/Makefile || die
sed -i -e "/^ \$(INSTALL) -m 644 \$(ARLIB) \"\$(DESTDIR)\"\$(libdir)\/\$(ARLIB)$/d" "${S}"/Makefile || die
fi
}
src_compile() {
emake build_shared
use static-libs && emake build
use examples && emake examples
}
src_test() {
emake test
}
src_install() {
emake \
prefix="${ED}"/usr \
libdir="${ED}/usr/$(get_libdir)" \
install
}