Skip to content

Commit

Permalink
dev-ada/libadalang: build examples
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/829871
Closes: https://bugs.gentoo.org/829870
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <[email protected]>
  • Loading branch information
atupone committed Dec 24, 2021
1 parent a4d9b3f commit 85ec082
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
32 changes: 22 additions & 10 deletions dev-ada/libadalang/libadalang-22.0.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ SRC_URI="https://github.com/AdaCore/${PN}/archive/refs/tags/v${PV}.tar.gz
LICENSE="GPL-3 gcc-runtime-library-exception-3.1"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="test shared +static-libs static-pic"
REQUIRED_USE="|| ( shared static-libs static-pic )
${PYTHON_REQUIRED_USE}
IUSE="test +static-libs static-pic"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
${ADA_REQUIRED_USE}"
RESTRICT="!test? ( test )"

RDEPEND="dev-python/pyyaml
dev-ada/gnatcoll-bindings[${ADA_USEDEP},gmp,iconv,shared?,static-libs?,static-pic?]
dev-ada/gnatcoll-bindings[${ADA_USEDEP},gmp,iconv,shared,static-libs?,static-pic?]
${ADA_DEPS}
${PYTHON_DEPS}
dev-ada/langkit[${ADA_USEDEP},shared?,static-libs?,static-pic?]
dev-ada/langkit[${ADA_USEDEP},shared,static-libs?,static-pic?]
$(python_gen_cond_dep '
dev-ada/langkit[${PYTHON_USEDEP}]
')"
Expand All @@ -51,12 +50,15 @@ pkg_setup() {
if use static-pic; then
libType+=',static-pic'
fi
if use shared; then
libType+=',relocatable'
fi
libType+=',relocatable'
libType=${libType:1}
}

src_prepare() {
default
rm -r testsuite/tests/misc/copyright || die
}

src_configure() {
${EPYTHON} manage.py generate -v debug || die
}
Expand All @@ -67,11 +69,21 @@ src_compile() {
-j$(makeopts_jobs) \
--gargs "-cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS}" \
--library-types=${libType} || die
GPR_PROJECT_PATH="${S}"/build \
gprbuild -P contrib/highlight/highlight.gpr \
-j$(makeopts_jobs) -v \
-XBUILD_MODE=prod \
-XLIBRARY_TYPE=relocatable \
-XXMLADA_BUILD=relocatable \
-cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS} \
|| die
}

src_test() {
${EPYTHON} manage.py test --restricted-env -j 1
${EPYTHON} manage.py test --restricted-env -j 1 |& tee libadalang.testOut
${EPYTHON} manage.py test \
--build-mode "prod" \
--restricted-env -j 1 \
|& tee libadalang.testOut
grep -qw FAIL libadalang.testOut && die
}

Expand Down
1 change: 0 additions & 1 deletion dev-ada/libadalang/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<email>[email protected]</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">
Expand Down

0 comments on commit 85ec082

Please sign in to comment.