dev-util/fpm: new package, version 0.7.0

Fortran package manager.

It's strange but in src_compile the "${EPYTHON} ford"
tries to call "${S}/ford" instead of python site-package
like within dev-libs/fortran-stdlib when build HTML docs.

Tests currently is disabled.

Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
This commit is contained in:
Sergey Torokhov
2022-11-19 03:07:06 +03:00
parent a7eed76f75
commit 92e3da05aa
4 changed files with 124 additions and 0 deletions

2
dev-util/fpm/Manifest Normal file
View File

@@ -0,0 +1,2 @@
DIST fpm-0.7.0.F90 985847 BLAKE2B 05d6acc336880ea0c2dcd01db9b5eb5790ee593d9d97b36c7dab231d96f564125293e944f4c7c1debcee1dace9a0709ca9dbec40535c2b7320f909023d561d0a SHA512 76e4a465f38375469ccad849f705837d90dc288df2ac101dfc6941f4fa676c3302f6f23bfd45037c7ce4bb5fac637f021373ff0756534d5cf762044709dbd8c0
DIST fpm-0.7.0.tar.gz 169412 BLAKE2B 6895d91cb67a8d15e50025c298aed32e77966685a1db426b9437a5c441f7c365cec76a7836c83ff5a5299216a9392812ae832bfb72d5cd4263bcb60976d12b6e SHA512 ec18798e02b4fb3e403062c68f97bf34200559207ffc87dba3b8b801aef31cabefdcda29203a1405ed0231192316a1fab16ecff603b0bf9fab0cede0fe4506de

View File

@@ -0,0 +1,21 @@
diff -Naur a/fpm.toml b/fpm.toml
--- a/fpm.toml
+++ b/fpm.toml
@@ -5,14 +5,9 @@
maintainer = ""
copyright = "2020 fpm contributors"
-[dependencies]
-[dependencies.toml-f]
-git = "https://github.com/toml-f/toml-f"
-rev = "e49f5523e4ee67db6628618864504448fb8c8939"
-
-[dependencies.M_CLI2]
-git = "https://github.com/urbanjost/M_CLI2.git"
-rev = "ea6bbffc1c2fb0885e994d37ccf0029c99b19f24"
+[build]
+external-modules = ["tomlf", "m_cli2"]
+link = ["toml-f","m_cli2"]
[[test]]
name = "cli-test"

View File

@@ -0,0 +1,90 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
FORTRAN_STANDARD="2003"
PYTHON_COMPAT=( python3_{8..10} )
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 ~x86"
IUSE="doc"
RESTRICT="test"
CDEPEND="
dev-util/toml-f
dev-util/m_cli2
"
RDEPEND="
${CDEPEND}
dev-vcs/git
"
DEPEND="
${CDEPEND}
doc? (
${PYTHON_DEPS}
$(python_gen_any_dep '
app-doc/ford[${PYTHON_USEDEP}]
')
)
"
DOCS=( LICENSE PACKAGING.md README.md )
PATCHES="${FILESDIR}/${P}_fpm_toml.patch"
BSDIR="build/bootstrap" # Bootstrap directory path
pkg_setup() {
fortran-2_pkg_setup
python-any-r1_pkg_setup
}
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 --compiler "$(tc-getFC)" --flag "${FCFLAGS} -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}"
if use doc ; then
einfo "Build API documentation:"
ford docs.md || die
fi
}
src_install() {
exeinto /usr/bin
doexe build/"$(tc-getFC)"_*/app/fpm
use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
einstalldocs
}

11
dev-util/fpm/metadata.xml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>torokhov-s-a@yandex.ru</email>
<name>Sergey Torokhov</name>
</maintainer>
<upstream>
<remote-id type="github">fortran-lang/fpm</remote-id>
</upstream>
</pkgmetadata>