sci-libs/openblas: Allow custom CFLAGS and add fortran checks.
authorBenda Xu <heroxbd@gentoo.org>
Sun, 4 Aug 2019 13:12:33 +0000 (21:12 +0800)
committerBenda Xu <heroxbd@gentoo.org>
Sun, 4 Aug 2019 13:12:57 +0000 (21:12 +0800)
  Drop unused USE flags.

Suggested-By: Hasan ÇALIŞIR <hasan.calisir@psauxit.com>
Closes: https://github.com/gentoo/gentoo/pull/12576
Package-Manager: Portage-2.3.69, Repoman-2.3.12
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
sci-libs/openblas/metadata.xml
sci-libs/openblas/openblas-0.3.6.ebuild

index 95b34d1ccda30d106fc45a863a6271c246dc1064..fa16b081f1062dcf5b2fa87cf2bfa203f972be2f 100644 (file)
        </longdescription>
        <use>
                <flag name="dynamic">Build dynamic architecture detection at run time (for multi targets)</flag>
-               <flag name="pthread">Build with pthread threadding model</flag>
-               <flag name="serial">Build without multi-thraedding</flag>
                <flag name="eselect-ldso">Enable BLAS/LAPACK runtime switching</flag>
                <flag name="index-64bit">Compile a separate INTERFACE64 OpenBLAS</flag>
+               <flag name="pthread">Build with pthread threading model</flag>
        </use>
        <upstream>
                <remote-id type="github">xianyi/OpenBLAS</remote-id>
index 19c3b79f2584170db2d01dfddbb45522cdd61fb4..3a91ce44fc1454d6c1ee6e2f399a0ec36311f16d 100644 (file)
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit toolchain-funcs
+inherit fortran-2 toolchain-funcs
 
 DESCRIPTION="Optimized BLAS library based on GotoBLAS2"
 HOMEPAGE="http://xianyi.github.com/OpenBLAS/"
@@ -11,18 +11,28 @@ SRC_URI="https://github.com/xianyi/OpenBLAS/tarball/v${PV} -> ${P}.tar.gz"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
-IUSE="dynamic openmp pthread serial static-libs eselect-ldso index-64bit"
-REQUIRED_USE="?? ( openmp pthread serial )"
+IUSE="dynamic eselect-ldso index-64bit openmp pthread"
+REQUIRED_USE="?? ( openmp pthread )"
 
 RDEPEND="
-eselect-ldso? ( >=app-eselect/eselect-blas-0.2
-                               !app-eselect/eselect-cblas
-                               >=app-eselect/eselect-lapack-0.2 )
-"
+       eselect-ldso? ( >=app-eselect/eselect-blas-0.2
+                       !app-eselect/eselect-cblas
+                       >=app-eselect/eselect-lapack-0.2 )"
+
 DEPEND="virtual/pkgconfig"
 
 PATCHES=( "${FILESDIR}/shared-blas-lapack.patch" )
 
+src_prepare() {
+       default
+       # Set compiler and common CFLAGS.
+       sed \
+               -e "/^#\s*CC/cCC=$(tc-getCC)" \
+               -e "/^#\s*FC/cFC=$(tc-getFC)" \
+               -e "/^#\s*COMMON_OPT/cCOMMON_OPT=${CFLAGS}" \
+               -i "${S}"/Makefile.rule || die
+}
+
 openblas_flags() {
        local flags=()
        use dynamic && \
@@ -57,8 +67,13 @@ src_compile () {
        fi
 }
 
+src_test() {
+       emake tests $(openblas_flags)
+}
+
 src_install () {
        emake install $(openblas_flags)
+       dodoc GotoBLAS_*.txt *.md Changelog.txt
 
        if use eselect-ldso; then
                dodir /usr/$(get_libdir)/blas/openblas/