commit:     fbe3b8ebb4bd549548943edd4d1b83f2d759228d
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 27 13:54:44 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 13:54:58 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbe3b8eb

app-crypt/libb2: addUSE=native-cflags to control feature guessing

Package-Manager: Portage-2.3.13, Repoman-2.3.3

 app-crypt/libb2/libb2-0.98.ebuild | 10 ++++++----
 app-crypt/libb2/metadata.xml      |  8 ++++++++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/app-crypt/libb2/libb2-0.98.ebuild 
b/app-crypt/libb2/libb2-0.98.ebuild
index 08bf237662f..b42921bc69d 100644
--- a/app-crypt/libb2/libb2-0.98.ebuild
+++ b/app-crypt/libb2/libb2-0.98.ebuild
@@ -13,7 +13,7 @@ 
SRC_URI="https://github.com/BLAKE2/libb2/archive/${GITHASH}.tar.gz -> ${P}.tar.g
 LICENSE="CC0-1.0"
 SLOT="0"
 KEYWORDS="~amd64 ~ppc64"
-IUSE="static"
+IUSE="static native-cflags"
 
 DEPEND=""
 RDEPEND="${DEPEND}"
@@ -28,12 +28,14 @@ src_prepare() {
 }
 
 src_configure() {
-       econf $(use_enable static)
+       econf \
+               $(use_enable static) \
+               $(use_enable native-cflags native)
 }
 
 src_compile() {
-       # respect our CFLAGS
-       emake CFLAGS="${CFLAGS}"
+       # respect our CFLAGS when native-cflags is not in effect
+       emake $(use native-cflags && echo no)CFLAGS="${CFLAGS}"
 }
 
 src_install() {

diff --git a/app-crypt/libb2/metadata.xml b/app-crypt/libb2/metadata.xml
index 5ef83e989e9..76fd7590acb 100644
--- a/app-crypt/libb2/metadata.xml
+++ b/app-crypt/libb2/metadata.xml
@@ -10,4 +10,12 @@
 
                Official implementations from BLAKE2 project.
        </longdescription>
+       <use>
+               <flag name="native-cflags">
+               Use CFLAGS as determined by configure script.  These flags will
+               enable all CPU specific features it find available, to further
+               optimise the implementation.  This discards any existing CFLAGS
+               set in make.conf or similar.
+               </flag>
+       </use>
 </pkgmetadata>

Reply via email to