public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergey Torokhov" <torokhov-s-a@yandex.ru>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-util/fpm/
Date: Wed, 19 Apr 2023 00:23:58 +0000 (UTC)	[thread overview]
Message-ID: <1681862268.cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b.SergeyTorokhov@gentoo> (raw)

commit:     cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Tue Apr 18 23:05:31 2023 +0000
Commit:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
CommitDate: Tue Apr 18 23:57:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cafd796f

dev-util/fpm: replace repetitive build flags with BUILD_FLAGS array

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>

 dev-util/fpm/fpm-0.7.0-r2.ebuild | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/dev-util/fpm/fpm-0.7.0-r2.ebuild b/dev-util/fpm/fpm-0.7.0-r2.ebuild
index fba8f63c4..38cc9186d 100644
--- a/dev-util/fpm/fpm-0.7.0-r2.ebuild
+++ b/dev-util/fpm/fpm-0.7.0-r2.ebuild
@@ -52,7 +52,7 @@ pkg_pretend() {
 	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
 }
 
-set_omp_flag() {
+set_build_flags() {
 	OMPFLAG=""
 	if use openmp ; then
 		case $(tc-getFC) in
@@ -62,13 +62,19 @@ set_omp_flag() {
 				die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
 		esac
 	fi
+
+	BUILD_FLAGS=( --compiler "$(tc-getFC)"
+		--flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2"
+		--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}"
+		--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}"
+		--archiver "$(tc-getAR)" --link-flag "${LDFLAGS}" )
 }
 
 pkg_setup() {
 	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
 	fortran-2_pkg_setup
 	python-any-r1_pkg_setup
-	set_omp_flag
+	set_build_flags
 }
 
 src_prepare() {
@@ -88,10 +94,7 @@ src_compile() {
 	"$(tc-getFC)" -J "${BSDIR}" -o "${BSDIR}"/fpm "${BSDIR}/${P}.F90" || die
 
 	# Use the bootstrap binary to build the feature complete fpm version
-	"${BSDIR}"/fpm build --verbose --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
-		--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
-		--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
-		--archiver "$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+	"${BSDIR}"/fpm build --verbose "${BUILD_FLAGS[@]}" || die
 
 	if use doc ; then
 		einfo "Build API documentation:"
@@ -100,19 +103,12 @@ src_compile() {
 }
 
 src_test() {
-	"${BSDIR}"/fpm test --verbose --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
-		--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
-		--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
-		--archiver="$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+	"${BSDIR}"/fpm test --verbose "${BUILD_FLAGS[@]}" || die
 }
 
 src_install() {
 	# Set prefix and pass all used env flags to avoid recompiling with default values
-	"${BSDIR}"/fpm install --prefix "${ED}/usr" \
-		--compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
-		--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
-		--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
-		--archiver="$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+		"${BSDIR}"/fpm install --prefix "${ED}/usr" "${BUILD_FLAGS[@]}" || die
 
 	use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
 	einstalldocs


             reply	other threads:[~2023-04-19  0:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  0:23 Sergey Torokhov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-21 20:32 [gentoo-commits] repo/proj/guru:dev commit in: dev-util/fpm/ Sergey Torokhov
2023-07-09  2:00 Anna Vyalkova
2023-07-09  2:00 Anna Vyalkova
2023-02-01 23:01 Sergey Torokhov
2023-01-19  0:00 Sergey Torokhov
2022-12-22  1:11 Sergey Torokhov
2022-11-26 18:19 Sergey Torokhov
2022-11-26  7:14 Sergey Torokhov
2022-11-24 13:14 Sergey Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1681862268.cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b.SergeyTorokhov@gentoo \
    --to=torokhov-s-a@yandex.ru \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox