dev-ada/gprbuild: add gnat_2016 and gnat_2017 use flags to select the compiler

Package-Manager: Portage-2.3.6, Repoman-2.3.1
This commit is contained in:
Tupone Alfredo
2017-06-26 22:03:11 +02:00
parent 594876bd35
commit e8347eefda
2 changed files with 24 additions and 30 deletions

View File

@@ -18,39 +18,26 @@ SRC_URI="
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="bootstrap +shared static static-pic"
IUSE="bootstrap gnat_2016 gnat_2017 +shared static static-pic"
DEPEND="dev-lang/gnat-gpl:=
!bootstrap? ( dev-ada/xmlada[static] )"
DEPEND="
!bootstrap? ( dev-ada/xmlada[static,gnat_2016=,gnat_2017=] )
gnat_2016? ( =dev-lang/gnat-gpl-2016 )
gnat_2017? ( =dev-lang/gnat-gpl-2017 )"
RDEPEND="${DEPEND}"
S="${WORKDIR}"/${MYP}-src
REQUIRED_USE="bootstrap? ( !shared !static !static-pic )"
REQUIRED_USE="bootstrap? ( !shared !static !static-pic )
^^ ( gnat_2016 gnat_2017 )"
PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
pkg_setup() {
GCC=${ADA:-$(tc-getCC)}
gnatbase=$(basename ${GCC})
if use bootstrap; then
gnatpath=$(dirname ${GCC})
GNATMAKE="${gnatbase/gcc/gnatmake}"
if [[ ${gnatpath} != "." ]] ; then
GNATMAKE="${gnatpath}/${GNATMAKE}"
fi
if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
eerror "You need a gcc compiler that provides the Ada Compiler:"
eerror "1) use gcc-config to select the right compiler or"
eerror "2) set ADA in make.conf"
die "ada compiler not available"
fi
fi
}
src_prepare() {
GCC_PV=${gnatbase#*gcc-}
if use gnat_2016; then
GCC_PV=4.9.4
else
GCC_PV=6.3.0
fi
sed -e "s:@VER@:${GCC_PV}:g" "${FILESDIR}"/${P}.xml > gnat-${GCC_PV}.xml
default
}
@@ -63,7 +50,9 @@ bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls"
lib_progs="gprlib gprbind"
src_compile() {
GCC=${CHOST}-gcc-${GCC_PV}
if use bootstrap; then
GNATMAKE=${CHOST}-gnatmake-${GCC_PV}
local xmlada_src="../xmlada-gpl-${PV}-src"
incflags="-Isrc -Igpr/src -I${xmlada_src}/sax -I${xmlada_src}/dom \
-I${xmlada_src}/schema -I${xmlada_src}/unicode \

View File

@@ -6,15 +6,20 @@
<name>Tupone Alfredo</name>
</maintainer>
<use>
<flag name="gnat_2016">Compile with dev-lang/gnat-gpl-2016</flag>
<flag name="gnat_2017">Compile with dev-lang/gnat-gpl-2017</flag>
<flag name="shared">Build shared library</flag>
<flag name="static">Build static library</flag>
<flag name="static-pic">Build static library with pic code</flag>
</use>
<longdescription lang="en">
XML/Ada is a set of modules that provide a simple manipulation of XML streams. It supports the whole XML 1.1 specifications, and can parse any file that follows this standard (including the contents of the DTD, although no validation of the document is done based on those).
It also provides support for a number of other standard associated with XML, like SAX, DOM and XML schemas.
In addition, it includes a module to manipulate Unicode streams, since this is required by the XML standard.
GPRbuild is an advanced software tool designed to help automate the
construction of multi-language systems. It removes complexity from
multi-language development by allowing developers to quickly and easily
compile and link software written in a combination of languages
including Ada, Assembler, C, C++, and Fortran. Easily extendable by
users to cover new toolchains and languages it is primarily aimed at
projects of all sizes organized into subsystems and libraries and is
particularly well-suited for compiled languages.
</longdescription>
</pkgmetadata>