summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2021-12-14 08:18:58 +0100
committerAlfredo Tupone <tupone@gentoo.org>2021-12-14 08:18:58 +0100
commit6c8d8a66b233b67c58ce94f91175061ee6d9bd70 (patch)
treef738fb5dc38b106e9c8d9dd0dc3d0341a30b7502 /dev-ada/langkit
parentdev-python/bandit: Remove old (diff)
downloadgentoo-6c8d8a66b233b67c58ce94f91175061ee6d9bd70.tar.gz
gentoo-6c8d8a66b233b67c58ce94f91175061ee6d9bd70.tar.bz2
gentoo-6c8d8a66b233b67c58ce94f91175061ee6d9bd70.zip
dev-ada/langkit: add USE static-libs & static-pic
Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'dev-ada/langkit')
-rw-r--r--dev-ada/langkit/langkit-22.0.0-r2.ebuild84
-rw-r--r--dev-ada/langkit/metadata.xml4
2 files changed, 88 insertions, 0 deletions
diff --git a/dev-ada/langkit/langkit-22.0.0-r2.ebuild b/dev-ada/langkit/langkit-22.0.0-r2.ebuild
new file mode 100644
index 000000000000..ac883ef76f9f
--- /dev/null
+++ b/dev-ada/langkit/langkit-22.0.0-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8,9} )
+
+DISTUTILS_USE_SETUPTOOLS=no
+inherit distutils-r1 multiprocessing
+
+DESCRIPTION="A Python framework to generate language parsers"
+HOMEPAGE="https://www.adacore.com/community"
+SRC_URI="https://github.com/AdaCore/${PN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+shared static-libs static-pic"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-ada/gnatcoll-bindings[iconv,shared?,static-libs?,static-pic?]
+ dev-python/mako[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/funcy[${PYTHON_USEDEP}]
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-ada/e3-core[${PYTHON_USEDEP}]"
+BDEPEND="${RDEPEND}"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+ cd testsuite/tests
+
+ # missing gprbuild option to build libraries static/relocatable
+ rm -r {langkit_support,adalog,misc/link_two_libs} || die
+
+ # require railroad-diagrams
+ rm -r contrib/svg_railroad_diagrams || die
+}
+
+python_compile_all() {
+ build () {
+ gprbuild -j$(makeopts_jobs) -p -v \
+ -XLIBRARY_TYPE=$1 -P support/langkit_support.gpr -XBUILD_MODE=dev \
+ -cargs:Ada ${ADAFLAGS} -cargs:C ${CFLAGS} || die "gprbuild failed"
+ }
+ if use shared; then
+ build relocatable
+ fi
+ if use static-libs; then
+ build static
+ fi
+ if use static-pic; then
+ build static-pic
+ fi
+}
+
+python_test_all() {
+ ${EPYTHON} ./manage.py make --no-langkit-support || die
+ eval $(./manage.py setenv)
+ ${EPYTHON} ./manage.py test --verbose |& tee langkit.testOut
+ grep -qw FAIL langkit.testOut && die
+}
+
+python_install_all() {
+ build () {
+ gprinstall -v -P support/langkit_support.gpr -p -XBUILD_MODE=dev \
+ --prefix="${D}"/usr --build-var=LIBRARY_TYPE \
+ --build-var=LANGKIT_SUPPORT_LIBRARY_TYPE \
+ --sources-subdir=include/langkit_support \
+ -XLIBRARY_TYPE=$1 --build-name=$1 || die
+ }
+ if use shared; then
+ build relocatable
+ fi
+ if use static-libs; then
+ build static
+ fi
+ if use static-pic; then
+ build static-pic
+ fi
+}
diff --git a/dev-ada/langkit/metadata.xml b/dev-ada/langkit/metadata.xml
index 1d15b41d3ff8..09df5e8fc04c 100644
--- a/dev-ada/langkit/metadata.xml
+++ b/dev-ada/langkit/metadata.xml
@@ -4,6 +4,10 @@
<maintainer type="project">
<email>ada@gentoo.org</email>
</maintainer>
+ <use>
+ <flag name="shared">Build shared library</flag>
+ <flag name="static-pic">Build static library with pic code</flag>
+ </use>
<longdescription lang="en">
Langkit (nickname for language kit) is a tool whose purpose is to make
it easy to create syntactic and semantic analysis engines. Write a