From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6AE8D15ACFC for ; Wed, 19 Apr 2023 00:24:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3FB75E089D; Wed, 19 Apr 2023 00:24:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9DB9E089D for ; Wed, 19 Apr 2023 00:24:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 720A1340BB4 for ; Wed, 19 Apr 2023 00:24:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CA75EA3F for ; Wed, 19 Apr 2023 00:23:58 +0000 (UTC) From: "Sergey Torokhov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergey Torokhov" Message-ID: <1681862268.cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b.SergeyTorokhov@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-util/fpm/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-util/fpm/fpm-0.7.0-r2.ebuild X-VCS-Directories: dev-util/fpm/ X-VCS-Committer: SergeyTorokhov X-VCS-Committer-Name: Sergey Torokhov X-VCS-Revision: cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b X-VCS-Branch: dev Date: Wed, 19 Apr 2023 00:23:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e8b2aa4d-828a-40dd-85e9-9e4486846ee5 X-Archives-Hash: 1d3c2c13957a4b1402bf442a52606f74 commit: cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b Author: Sergey Torokhov yandex ru> AuthorDate: Tue Apr 18 23:05:31 2023 +0000 Commit: Sergey Torokhov yandex 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 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