summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2023-05-22 21:05:02 +0200
committerAlfredo Tupone <tupone@gentoo.org>2023-05-22 21:22:57 +0200
commit129ee4c06245a78f8a567c35658279d00fa7e136 (patch)
treeb1ed8d8fc72214eb09ed1b84047dcf2b1523d0db /dev-ada/gpr
parentdev-java/scala-cli-bin: add 1.0.0_rc2 (diff)
downloadgentoo-129ee4c06245a78f8a567c35658279d00fa7e136.tar.gz
gentoo-129ee4c06245a78f8a567c35658279d00fa7e136.tar.bz2
gentoo-129ee4c06245a78f8a567c35658279d00fa7e136.zip
dev-ada/gpr: static-libs and static-pic control generation of .a files
Closes: https://bugs.gentoo.org/902535 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'dev-ada/gpr')
-rw-r--r--dev-ada/gpr/gpr-23.0.0-r2.ebuild65
-rw-r--r--dev-ada/gpr/gpr-23.0.0-r3.ebuild113
-rw-r--r--dev-ada/gpr/metadata.xml1
3 files changed, 114 insertions, 65 deletions
diff --git a/dev-ada/gpr/gpr-23.0.0-r2.ebuild b/dev-ada/gpr/gpr-23.0.0-r2.ebuild
deleted file mode 100644
index ce0429b7f624..000000000000
--- a/dev-ada/gpr/gpr-23.0.0-r2.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2022-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-ADA_COMPAT=( gnat_2021 gcc_12 )
-PYTHON_COMPAT=( python3_{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
-}
diff --git a/dev-ada/gpr/gpr-23.0.0-r3.ebuild b/dev-ada/gpr/gpr-23.0.0-r3.ebuild
new file mode 100644
index 000000000000..5ac3ae0f761c
--- /dev/null
+++ b/dev-ada/gpr/gpr-23.0.0-r3.ebuild
@@ -0,0 +1,113 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ADA_COMPAT=( gnat_2021 gcc_12 )
+PYTHON_COMPAT=( python3_{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"
+IUSE="+shared static-libs static-pic"
+REQUIRED_USE="|| ( shared static-libs static-pic )
+ ${ADA_REQUIRED_USE}"
+
+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}]
+ ')"
+
+python_check_deps() {
+ python_has_version "dev-ada/langkit[${PYTHON_USEDEP}]"
+}
+
+src_configure() {
+ emake ENABLE_SHARED=$(usex shared) setup
+}
+
+src_compile() {
+ build() {
+ gprbuild -p -m -v -j$(makeopts_jobs) -XGPR2_BUILD=release \
+ -XLIBRARY_TYPE=$1 -XXMLADA_BUILD=$1 gpr2.gpr || die
+ }
+ mkdir -p .build/kb || die
+ gprbuild -p -P src/kb/collect_kb.gpr -XKB_BUILD_DIR=.build/kb \
+ --relocate-build-tree || die
+ .build/kb/collect_kb -o .build/kb/config.kb /usr/share/gprconfig || die
+ emake -C langkit setup DEST="${S}/.build/lkparser"
+ if use shared; then
+ build relocatable
+ fi
+ if use static-libs; then
+ build static
+ fi
+ if use static-pic; then
+ build static-pic
+ fi
+ if use static-libs; then
+ libtype='static'
+ elif use static-pic; then
+ libtype='static-pic'
+ elif use shared; then
+ libtype='relocatable'
+ fi
+
+ gprbuild -p -m -v -j$(makeopts_jobs) -XGPR2_BUILD=release \
+ -XLIBRARY_TYPE=${libtype} -XXMLADA_BUILD=${libtype} gpr2-tools.gpr \
+ || die
+ gprbuild -p -m -v -j$(makeopts_jobs) -XGPR2_BUILD=release \
+ -XLIBRARY_TYPE=${libtype} -XXMLADA_BUILD=${libtype} \
+ -XLANGKIT_SUPPORT_BUILD=${libtype} gpr2-name.gpr || die
+}
+
+src_install() {
+ build() {
+ gprinstall -p -f -v -XGPR2_BUILD=release --prefix="${D}/usr" \
+ -XLIBRARY_TYPE=$1 -XXMLADA_BUILD=$1 --build-name=$1 \
+ --build-var=LIBRARY_TYPE \
+ --build-var=GPR2_LIBRARY_TYPE gpr2.gpr || die
+ }
+ if use shared; then
+ build relocatable
+ fi
+ if use static-libs; then
+ build static
+ fi
+ if use static-pic; then
+ build static-pic
+ fi
+ gprinstall -p -f -v -XGPR2_BUILD=release --prefix="${D}/usr" \
+ -XLIBRARY_TYPE=${libtype} -XXMLADA_BUILD=${libtype} \
+ --build-name=${libtype} --mode=usage gpr2-tools.gpr || die
+ gprinstall -p -f -v -XGPR2_BUILD=release --prefix='${D}/usr' \
+ -XLIBRARY_TYPE=${libtype} -XXMLADA_BUILD=${libtype} \
+ -XLANGKIT_SUPPORT_BUILD=${libtype} --build-name=${libtype} \
+ --mode=usage gpr2-name.gpr || die
+
+ 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
+}
diff --git a/dev-ada/gpr/metadata.xml b/dev-ada/gpr/metadata.xml
index 51966a8cdf1e..3551228a3310 100644
--- a/dev-ada/gpr/metadata.xml
+++ b/dev-ada/gpr/metadata.xml
@@ -6,6 +6,7 @@
</maintainer>
<use>
<flag name="shared">Build shared library</flag>
+ <flag name="static-pic">Build static library with pic code</flag>
</use>
<upstream>
<remote-id type="github">AdaCore/gpr</remote-id>