434c852375c60a3fb53d924a9eefa3b54a9c2099
[gentoo.git] / dev-ada / xmlada / xmlada-2018.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit multiprocessing
7
8 MYP=${PN}-gpl-${PV}
9
10 DESCRIPTION="Set of modules that provide a simple manipulation of XML streams"
11 HOMEPAGE="http://libre.adacore.com/"
12 SRC_URI="http://mirrors.cdn.adacore.com/art/591aeb88c7a4473fcbb154f8 ->
13         ${MYP}-src.tar.gz"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="gnat_2016 gnat_2017 +gnat_2018 +shared static-libs static-pic"
19 REQUIRED_USE="|| ( shared static-libs static-pic )
20         ^^ ( gnat_2016 gnat_2017 gnat_2018 )"
21
22 RDEPEND="gnat_2016? ( dev-lang/gnat-gpl:4.9.4 )
23         gnat_2017? ( dev-lang/gnat-gpl:6.3.0 )
24         gnat_2018? ( dev-lang/gnat-gpl:7.3.1 )"
25 DEPEND="${RDEPEND}
26         dev-ada/gprbuild[gnat_2016(-)?,gnat_2017(-)?,gnat_2018(-)?]"
27
28 S="${WORKDIR}"/${MYP}-src
29
30 PATCHES=( "${FILESDIR}"/${PN}-2017-gentoo.patch )
31
32 src_configure () {
33         econf --prefix="${D}"/usr
34 }
35
36 src_compile () {
37         build () {
38                 gprbuild -j$(makeopts_jobs) -m -p -v -XLIBRARY_TYPE=$1 \
39                         -XBUILD=Production -XPROCESSORS=$(makeopts_jobs) xmlada.gpr \
40                         -cargs ${ADAFLAGS} || die "gprbuild failed"
41         }
42         if use shared; then
43                 build relocatable
44         fi
45         if use static-libs; then
46                 build static
47         fi
48         if use static-pic; then
49                 build static-pic
50         fi
51 }
52
53 src_test() {
54         emake test
55         emake run_test | grep DIFF && die
56 }
57
58 src_install () {
59         build () {
60                 gprinstall -XLIBRARY_TYPE=$1 -f -p -XBUILD=Production \
61                         -XPROCESSORS=$(makeopts_jobs) --prefix="${D}"usr \
62                         --install-name=xmlada --build-var=LIBRARY_TYPE \
63                         --build-var=XMLADA_BUILD \
64                         --build-name=$1 xmlada.gpr || die "gprinstall failed"
65         }
66         if use shared; then
67                 build relocatable
68         fi
69         if use static-libs; then
70                 build static
71         fi
72         if use static-pic; then
73                 build static-pic
74         fi
75
76         einstalldocs
77         dodoc xmlada-roadmap.txt
78         rm "${D}"/usr/share/doc/${PN}/.buildinfo || die
79         rm -r "${D}"/usr/share/gpr/manifests || die
80 }