public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: profiles/features/musl/, dev-ada/prettier-ada/
@ 2025-01-26 18:03 Alfredo Tupone
  0 siblings, 0 replies; only message in thread
From: Alfredo Tupone @ 2025-01-26 18:03 UTC (permalink / raw
  To: gentoo-commits

commit:     6a310b7ca7df13b67628b965b87bcd31e6b80dc6
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 18:01:24 2025 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 18:02:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a310b7c

dev-ada/prettier-ada: new package, add 25.0.0

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-ada/prettier-ada/Manifest                   |   1 +
 dev-ada/prettier-ada/metadata.xml               |  22 +++++
 dev-ada/prettier-ada/prettier-ada-25.0.0.ebuild | 106 ++++++++++++++++++++++++
 profiles/features/musl/package.mask             |   1 +
 4 files changed, 130 insertions(+)

diff --git a/dev-ada/prettier-ada/Manifest b/dev-ada/prettier-ada/Manifest
new file mode 100644
index 000000000000..b1946280867e
--- /dev/null
+++ b/dev-ada/prettier-ada/Manifest
@@ -0,0 +1 @@
+DIST prettier-ada-25.0.0.tar.gz 60082 BLAKE2B 7fa18f3557b0f4e031d24421b7e5876477ed9468886e8d74165c7eae3f4ecdba8dfa7efa6ac298b3065b23eff5f531c4194107be6d36aa4153670350f19f3fc0 SHA512 5e31bedf76f6051a1e40a298953d9aa269f24d374b619fba1de934d4b85efc358532d9d695084b41607ae7d8d87bf91f27a151760c1f010782b2af3f64783c6a

diff --git a/dev-ada/prettier-ada/metadata.xml b/dev-ada/prettier-ada/metadata.xml
new file mode 100644
index 000000000000..7f40891ad6cd
--- /dev/null
+++ b/dev-ada/prettier-ada/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>ada@gentoo.org</email>
+	</maintainer>
+	<use>
+		<flag name="shared">Build shared library</flag>
+		<flag name="static-pic">Build static library with pic code</flag>
+	</use>
+	<longdescription lang="en">
+		This project is a port of the Prettier formatter to the Ada programming
+		language. The aim of this project is to provide a tool that allows Ada
+		programmers to create formatters for any language of their choosing.
+		Please note that only the core generic formatting algorithm and its
+		dependencies were ported. The formatters for all supported languages
+		are not included in this project.
+	</longdescription>
+	<upstream>
+		<remote-id type="github">AdaCore/prettier-ada</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/dev-ada/prettier-ada/prettier-ada-25.0.0.ebuild b/dev-ada/prettier-ada/prettier-ada-25.0.0.ebuild
new file mode 100644
index 000000000000..426086a34194
--- /dev/null
+++ b/dev-ada/prettier-ada/prettier-ada-25.0.0.ebuild
@@ -0,0 +1,106 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+ADA_COMPAT=( gcc_12 gcc_13 gcc_14 )
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit ada python-any-r1 multiprocessing
+
+DESCRIPTION="Port of the Prettier formatter to the Ada programming language"
+HOMEPAGE="https://github.com/AdaCore/prettier-ada"
+SRC_URI="https://github.com/AdaCore/${PN}/archive/refs/tags/v${PV}.tar.gz
+	-> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="+shared static-libs static-pic test"
+
+RDEPEND="${ADA_DEPS}
+	dev-ada/VSS:${SLOT}[${ADA_USEDEP},shared?,static-libs?,static-pic?]
+	dev-ada/gnatcoll-core:${SLOT}[${ADA_USEDEP},shared?,static-libs?,static-pic?]"
+DEPEND="${RDEPEND}
+	dev-ada/gprbuild[${ADA_USEDEP}]"
+BDEPEND="test? (
+	$(python_gen_any_dep '
+		dev-ada/e3-testsuite[${PYTHON_USEDEP}]
+	')
+)"
+
+REQUIRED_USE="${ADA_REQUIRED_USE}
+	|| ( shared static-libs static-pic )
+	test? ( static-libs )"
+RESTRICT="!test? ( test )"
+
+python_check_deps() {
+	use test || return 0
+	python_has_version "dev-ada/e3-testsuite[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+	use test && python-any-r1_pkg_setup
+	ada_pkg_setup
+}
+
+src_compile() {
+	build() {
+		gprbuild \
+			-v \
+			-k \
+			-XLIBRARY_TYPE=$1 \
+			-XPRETTIER_ADA_LIBRARY_TYPE=$1 \
+			-P prettier_ada.gpr \
+			-p \
+			-j$(makeopts_jobs) \
+			-largs ${LDFLAGS} \
+			-cargs ${ADAFLAGS} \
+			|| die "gprbuild failed"
+	}
+	use shared && build relocatable
+	use static-libs && build static
+	use static-pic && build static-pic
+}
+
+src_install() {
+	build() {
+		gprinstall \
+			-XPRETTIER_ADA_LIBRARY_TYPE=$1 \
+			-XLIBRARY_TYPE=$1 \
+			--prefix="${D}"/usr \
+			--install-name=prettier_ada \
+			--build-name=$1 \
+			--build-var=LIBRARY_TYPE \
+			-P prettier_ada.gpr -p -f \
+			|| die "gprinstall failed"
+
+	}
+	use shared && build relocatable
+	use static-libs && build static
+	use static-pic && build static-pic
+	einstalldocs
+}
+
+src_test() {
+	gprbuild \
+		-v \
+		-k \
+		-XLIBRARY_TYPE=static \
+		-XPRETTIER_ADA_LIBRARY_TYPE=static \
+		-P testsuite/test_programs/test_programs.gpr \
+		-p \
+		-j$(makeopts_jobs) \
+		|| die
+	gprinstall \
+		-XLIBRARY_TYPE=static \
+		-XPRETTIER_ADA_LIBRARY_TYPE=static \
+		--prefix="${TMP}"/usr \
+		--install-name=test_programs \
+		--mode=usage \
+		-P testsuite/test_programs/test_programs.gpr \
+		-p \
+		-f \
+		|| die
+	PATH=${PATH}:"${TMP}"/usr/bin \
+	${EPYTHON} testsuite/testsuite.py || die
+}

diff --git a/profiles/features/musl/package.mask b/profiles/features/musl/package.mask
index 44d71073a068..c4d4892c0c68 100644
--- a/profiles/features/musl/package.mask
+++ b/profiles/features/musl/package.mask
@@ -115,6 +115,7 @@ dev-ada/ada_libfswatch
 dev-ada/gnatsymbolize
 dev-ada/AdaSAT
 dev-ada/lal-refactor
+dev-ada/prettier-ada
 
 # Sergey Popov <pinkbyte@gentoo.org> (2024-03-05)
 # games-strategy/seven-kingdoms does not build on musl,


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-26 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26 18:03 [gentoo-commits] repo/gentoo:master commit in: profiles/features/musl/, dev-ada/prettier-ada/ Alfredo Tupone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox