summaryrefslogtreecommitdiff
blob: 18d10335b4e3c65f334511596d6fad5f418ddb74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

ADA_COMPAT=( gnat_2021 gcc_12_2_0 )
PYTHON_COMPAT=( python3_{8,9,10,11} )

inherit python-any-r1 ada multiprocessing

DESCRIPTION="LibGPR2 - Parser for GPR Project files"
HOMEPAGE="https://github.com/AdaCore/gpr"
SRC_URI="https://github.com/AdaCore/${PN}/archive/refs/tags/v${PV}.tar.gz
	-> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="${ADA_DEPS}
	dev-ada/xmlada[${ADA_USEDEP}]
	shared? ( dev-ada/xmlada[shared,static-pic] )
	dev-ada/gnatcoll-core[${ADA_USEDEP}]
	shared? ( dev-ada/gnatcoll-core[shared,static-pic] )
	dev-ada/gnatcoll-bindings[${ADA_USEDEP},iconv,gmp]
	shared? ( dev-ada/gnatcoll-bindings[shared,static-pic] )"

DEPEND="${RDEPEND}
	dev-ada/gprconfig_kb[${ADA_USEDEP}]
	dev-ada/gprbuild[${ADA_USEDEP}]"

BDEPEND="${PYTHON_DEPS}
	$(python_gen_any_dep '
		dev-ada/langkit[${PYTHON_USEDEP}]
	')"

IUSE="+shared"
REQUIRED_USE="${ADA_REQUIRED_USE}"

python_check_deps() {
	python_has_version "dev-ada/langkit[${PYTHON_USEDEP}]"
}

src_configure() {
	emake PROCESSORS=$(makeopts_jobs) \
		GPR2KBDIR=/usr/share/gprconfig \
		ENABLE_SHARED=$(usex shared) \
		setup
}

src_compile() {
	emake GPRBUILD_OPTIONS=-v
}

src_install() {
	emake install \
		prefix="${D}"/usr
	einstalldocs

	rm "${D}"/usr/bin/gprclean || die
	rm "${D}"/usr/bin/gprconfig || die
	rm "${D}"/usr/bin/gprinstall || die
	rm "${D}"/usr/bin/gprls || die
	rm "${D}"/usr/bin/gprname || die
}