mirror of
https://github.com/gentoo-mirror/guru.git
synced 2025-04-20 23:46:14 -04:00
Python 3.10 target is scheduled for removal in Gentoo: https://public-inbox.gentoo.org/gentoo-dev/e6ca9f1f4ababb79ab2a3d005c39b483c3ecef6e.camel@gentoo.org/ Sphinx 8.2.0 already dropped support for CPython 3.10 and PyPy 3.10, leading to multiple CI failures in ::guru. We can safely remove this target, because GURU is "experimental" and does not have stable keywords. Let's not remove "pypy3" right now because a) There are not many packages using it. b) So we can see which packages supported PyPy 3.10, and test them with PyPy 3.11. Closes: https://github.com/gentoo/guru/pull/291 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
119 lines
2.6 KiB
Bash
119 lines
2.6 KiB
Bash
# Copyright 1999-2024 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
FORTRAN_STANDARD="2003"
|
|
|
|
PYTHON_COMPAT=( python3_{11..12} )
|
|
|
|
inherit fortran-2 python-any-r1 toolchain-funcs
|
|
|
|
DESCRIPTION="Fortran Package Manager (fpm)"
|
|
HOMEPAGE="https://fpm.fortran-lang.org"
|
|
SRC_URI="
|
|
https://github.com/fortran-lang/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
|
https://github.com/fortran-lang/fpm/releases/download/v${PV}/${P}.F90
|
|
"
|
|
|
|
LICENSE="MIT"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
IUSE="openmp doc test"
|
|
RESTRICT="!test? ( test )"
|
|
|
|
CDEPEND="
|
|
dev-libs/fortran-regex
|
|
dev-libs/jonquil:0/2
|
|
dev-libs/toml-f:0/4
|
|
dev-libs/M_CLI2
|
|
"
|
|
|
|
RDEPEND="
|
|
${CDEPEND}
|
|
dev-vcs/git
|
|
"
|
|
|
|
DEPEND="
|
|
${CDEPEND}
|
|
doc? (
|
|
${PYTHON_DEPS}
|
|
$(python_gen_any_dep '
|
|
app-text/ford[${PYTHON_USEDEP}]
|
|
')
|
|
)
|
|
"
|
|
|
|
DOCS=( LICENSE PACKAGING.md README.md )
|
|
|
|
PATCHES="${FILESDIR}/${P}_fpm_toml.patch"
|
|
|
|
BSDIR="build/bootstrap" # Bootstrap directory path
|
|
|
|
pkg_pretend() {
|
|
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
|
}
|
|
|
|
set_build_flags() {
|
|
OMPFLAG=""
|
|
if use openmp ; then
|
|
case $(tc-getFC) in
|
|
*gfortran* )
|
|
OMPFLAG="-fopenmp" ;;
|
|
* )
|
|
die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
|
|
esac
|
|
fi
|
|
|
|
BUILD_FLAGS=( --compiler "$(tc-getFC)"
|
|
--flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/fortran-regex -I/usr/include/jonquil/modules \
|
|
-I/usr/include/M_CLI2 -I/usr/include/toml-f/modules"
|
|
--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_build_flags
|
|
}
|
|
|
|
src_prepare() {
|
|
default
|
|
|
|
mkdir -p "${BSDIR}" || die
|
|
cp "${DISTDIR}/${P}.F90" "${BSDIR}/" || die
|
|
|
|
# Use favicon.png instead remote icon
|
|
sed -i -e 's#https://fortran-lang.org/assets/img/fortran_logo_512x512.png#favicon.png#' docs.md || die
|
|
}
|
|
|
|
src_compile() {
|
|
default
|
|
|
|
# Build a bootstrap binary from the single source version
|
|
"$(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 "${BUILD_FLAGS[@]}" || die
|
|
|
|
if use doc ; then
|
|
einfo "Build API documentation:"
|
|
ford docs.md || die
|
|
fi
|
|
}
|
|
|
|
src_test() {
|
|
"${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" "${BUILD_FLAGS[@]}" || die
|
|
|
|
use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
|
|
einstalldocs
|
|
}
|