dev-ada/templates-parser: add 25.0.0

Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
This commit is contained in:
Alfredo Tupone 2025-01-01 22:28:27 +01:00
parent 1e47fd7ad2
commit 955b94e674
No known key found for this signature in database
GPG Key ID: FBE5925C5B02CE58
3 changed files with 135 additions and 0 deletions

View File

@ -1 +1,2 @@
DIST templates-parser-24.0.0.tar.gz 226649 BLAKE2B 6e84721cbe28164e9c5f683906ff0b360a7dca82a2b91a7fe0253546c6d617d82ff2bb385133435e48c1588821daa3171eee86aeb0de27a55f38cad372f858db SHA512 3661ccb4be3bc3a6a81bbf04244f3b943c87655cad25370e857bb09d24b86ee801388a4a71d63f9135d5f069c54bc184cef4a8a25bcc90d0add8a15c67f8c374
DIST templates-parser-25.0.0.tar.gz 259459 BLAKE2B b0ba2ad87cbd9cb34773cce54160a30e59b566ec72ce773525ba4cbb33be659dd83f23846bcb6d6fd88726c7cfae52e2993c1ced052f078bd589b14cf73cef55 SHA512 902e41f713dd8446e08ba6f180b4c88c35d37da3476d0c925a4b6a05fb5038ff9ec1b0daa0443a55e82f902867b774efb4e28c0b7d8ec59fb15d050ee523ee87

View File

@ -6,7 +6,12 @@
</maintainer>
<use>
<flag name="shared">Build shared library</flag>
<flag name="static-pic">Build static library with pic code</flag>
</use>
<longdescription lang="en">
The templates parser package has been designed to parse files and to
replace some specific tags into these files by some specified values.
</longdescription>
<upstream>
<remote-id type="github">AdaCore/templates-parser</remote-id>
</upstream>

View File

@ -0,0 +1,129 @@
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ADA_COMPAT=( gnat_2021 gcc_12 gcc_13 )
inherit ada multiprocessing
DESCRIPTION="A template engine"
HOMEPAGE="https://github.com/AdaCore/templates-parser"
SRC_URI="https://github.com/AdaCore/${PN}/archive/refs/tags/v${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc man +shared static-libs static-pic"
RESTRICT="test"
RDEPEND="${ADA_DEPS}
dev-ada/xmlada[${ADA_USEDEP},shared?,static-libs?]
shared? ( dev-ada/xmlada[static-pic] )"
DEPEND="${RDEPEND}
dev-ada/gprbuild[${ADA_USEDEP}]"
BDEPEND="doc? (
dev-tex/latexmk
dev-texlive/texlive-latexextra
)
man? (
dev-python/sphinx
dev-python/sphinx-rtd-theme
)"
REQUIRED_USE="|| ( shared static-libs )
${ADA_REQUIRED_USE}
doc? ( man )"
src_configure() {
emake PROCESSORS=$(makeopts_jobs) \
DEFAULT_LIBRARY_TYPE=$(usex shared relocatable static) \
ENABLE_STATIC=$(usex static-libs true false) \
ENABLE_SHARED=$(usex shared true false) \
prefix=/usr \
setup
}
src_compile() {
build() {
gprbuild -p -v -XPRJ_BUILD=Release -XPRJ_TARGET=Linux \
-XTP_XMLADA=Disabled -XPROCESSORS=$(makeopts_jobs) \
-XVERSION=$(ver_cut 1-2) -XLIBRARY_TYPE=$1 -XXMLADA_BUILD=$1 \
--subdirs=${CHOST}/release/$1 \
-Ptemplates_parser -largs ${LDFLAGS} -cargs ${ADAFLAGS} \
|| 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
local lib
if use shared; then
lib=relocatable
elif use static-libs; then
lib=static
else
lib=static-pic
fi
gprbuild -p -v -XPRJ_BUILD=Release -XPRJ_TARGET=Linux \
-XTP_XMLADA=Disabled -XPROCESSORS=$(makeopts_jobs) \
-XVERSION=$(ver_cut 1-2) -XLIBRARY_TYPE=${lib} -XXMLADA_BUILD=${lib} \
--subdirs=${CHOST}/release/${lib} -Ptools/tools -largs ${LDFLAGS} \
-cargs ${ADAFLAGS} \
|| die "gprbuild failed"
if use man; then
emake -C docs man GPROPTS=-v
fi
if use doc; then
emake -C docs html epub latexpdf GPROPTS=-v
fi
}
src_install() {
build() {
gprinstall -XPRJ_BUILD=Release -XPRJ_TARGET=Linux \
-XTP_XMLADA=Disabled -XPROCESSORS=$(makeopts_jobs) \
-XVERSION=$(ver_cut 1-2) -XLIBRARY_TYPE=$1 -XXMLADA_BUILD=$1 \
-p -f --prefix="${D}"/usr --build-var=LIBRARY_TYPE \
--build-var=TEMPLATES_PARSER_BUILD --subdirs=${CHOST}/release/$1 \
--build-name=$1 -Ptemplates_parser \
|| die "gprinstall 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
local lib
if use shared; then
lib=relocatable
elif use static-libs; then
lib=static
else
lib=static-pic
fi
gprinstall -XPRJ_BUILD=Release -XPRJ_TARGET=Linux -XTP_XMLADA=Disabled \
-XPROCESSORS=$(makeopts_jobs) -XVERSION=$(ver_cut 1-2) \
-XLIBRARY_TYPE=${lib} -XXMLADA_BUILD=${lib} -p -f --prefix="${D}"/usr \
--build-var=LIBRARY_TYPE --build-var=TEMPLATES_PARSER_BUILD \
--mode=usage --subdirs=${CHOST}/release/${lib} \
--install-name=templates_parser -Ptools/tools \
|| die "gprinstall failed"
DOCS="README.md"
if use doc; then
mv "${D}"/usr/share/doc/templates_parser "${D}"/usr/share/doc/"${PF}" || die
DOCS+=" docs/build/epub/Templates_ParserTemplatesEngine.epub"
fi
einstalldocs
use man && doman docs/build/man/templates_parser.1
rm -r "${D}"/usr/share/gpr/manifests
}