# Copyright 2024-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake git-r3

DESCRIPTION="The official repository of the oncvpsp code to generate optimized norm-conserving Vanderbilt pseudopotentials"
HOMEPAGE="
	https://github.com/oncvpsp/oncvpsp
"
EGIT_REPO_URI=https://github.com/oncvpsp/oncvpsp

LICENSE="GPL-3"
SLOT="0"
KEYWORDS=""

IUSE="+blas +libxc test"

DEPEND="
	sys-devel/gcc[fortran]
	blas? ( virtual/blas )
	libxc? ( sci-libs/libxc:= )
"

PATCHES=(
	${FILESDIR}/4-no-cpm.patch
)

#
#src_install() {
#	dobin ${S}/src/oncvpspnr.x
#	dobin ${S}/src/oncvpspr.x
#	dobin ${S}/src/oncvpsp.x
#}

src_configure() {
        local mycmakeargs=(
                -DWITH_TOML=OFF
        )
	cmake_src_configure
}

src_install() {
	B=${S}/../${P}_build
        dobin ${B}/bin/oncvpspnr.x
	dobin ${B}/bin/oncvpspr.x
        dobin ${B}/bin/oncvpsp.x
}