mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-21 13:03:31 -04:00
dev-util/fpm: replace repetitive build flags with BUILD_FLAGS array
Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
This commit is contained in:
@@ -52,7 +52,7 @@ pkg_pretend() {
|
|||||||
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||||||
}
|
}
|
||||||
|
|
||||||
set_omp_flag() {
|
set_build_flags() {
|
||||||
OMPFLAG=""
|
OMPFLAG=""
|
||||||
if use openmp ; then
|
if use openmp ; then
|
||||||
case $(tc-getFC) in
|
case $(tc-getFC) in
|
||||||
@@ -62,13 +62,19 @@ set_omp_flag() {
|
|||||||
die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
|
die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
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() {
|
pkg_setup() {
|
||||||
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
||||||
fortran-2_pkg_setup
|
fortran-2_pkg_setup
|
||||||
python-any-r1_pkg_setup
|
python-any-r1_pkg_setup
|
||||||
set_omp_flag
|
set_build_flags
|
||||||
}
|
}
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
@@ -88,10 +94,7 @@ src_compile() {
|
|||||||
"$(tc-getFC)" -J "${BSDIR}" -o "${BSDIR}"/fpm "${BSDIR}/${P}.F90" || die
|
"$(tc-getFC)" -J "${BSDIR}" -o "${BSDIR}"/fpm "${BSDIR}/${P}.F90" || die
|
||||||
|
|
||||||
# Use the bootstrap binary to build the feature complete fpm version
|
# 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" \
|
"${BSDIR}"/fpm build --verbose "${BUILD_FLAGS[@]}" || die
|
||||||
--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
|
|
||||||
--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
|
|
||||||
--archiver "$(tc-getAR)" --link-flag "${LDFLAGS}" || die
|
|
||||||
|
|
||||||
if use doc ; then
|
if use doc ; then
|
||||||
einfo "Build API documentation:"
|
einfo "Build API documentation:"
|
||||||
@@ -100,19 +103,12 @@ src_compile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
src_test() {
|
src_test() {
|
||||||
"${BSDIR}"/fpm test --verbose --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
|
"${BSDIR}"/fpm test --verbose "${BUILD_FLAGS[@]}" || die
|
||||||
--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
|
|
||||||
--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
|
|
||||||
--archiver="$(tc-getAR)" --link-flag "${LDFLAGS}" || die
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
# Set prefix and pass all used env flags to avoid recompiling with default values
|
# Set prefix and pass all used env flags to avoid recompiling with default values
|
||||||
"${BSDIR}"/fpm install --prefix "${ED}/usr" \
|
"${BSDIR}"/fpm install --prefix "${ED}/usr" "${BUILD_FLAGS[@]}" || die
|
||||||
--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
|
|
||||||
|
|
||||||
use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
|
use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
|
||||||
einstalldocs
|
einstalldocs
|
||||||
|
|||||||
Reference in New Issue
Block a user