Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/libb2/
Date: Sun, 27 Oct 2019 17:11:26
Message-Id: 1572196275.74cd8462dc9cbbe66f2d7fa8f1006581d3d6aace.mgorny@gentoo
1 commit: 74cd8462dc9cbbe66f2d7fa8f1006581d3d6aace
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 27 13:25:55 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 27 17:11:15 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74cd8462
7
8 app-crypt/libb2: Enable multilib support (needed for libarchive)
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 app-crypt/libb2/libb2-0.98.1-r2.ebuild | 68 ++++++++++++++++++++++++++++++++++
13 1 file changed, 68 insertions(+)
14
15 diff --git a/app-crypt/libb2/libb2-0.98.1-r2.ebuild b/app-crypt/libb2/libb2-0.98.1-r2.ebuild
16 new file mode 100644
17 index 00000000000..5473f617de9
18 --- /dev/null
19 +++ b/app-crypt/libb2/libb2-0.98.1-r2.ebuild
20 @@ -0,0 +1,68 @@
21 +# Copyright 1999-2019 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=7
25 +
26 +inherit autotools multilib-minimal toolchain-funcs
27 +
28 +DESCRIPTION="C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp"
29 +HOMEPAGE="https://github.com/BLAKE2/libb2"
30 +GITHASH="73d41c8255a991ed2adea41c108b388d9d14b449"
31 +SRC_URI="https://github.com/BLAKE2/libb2/archive/${GITHASH}.tar.gz -> ${P}.tar.gz"
32 +
33 +LICENSE="CC0-1.0"
34 +SLOT="0"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
36 +IUSE="static-libs native-cflags openmp"
37 +
38 +DEPEND="
39 + openmp? (
40 + || ( >=sys-devel/gcc-4.2:*[openmp] sys-devel/clang-runtime:*[openmp] )
41 + )
42 +"
43 +RDEPEND="${DEPEND}"
44 +
45 +S=${WORKDIR}/${PN}-${GITHASH}
46 +
47 +pkg_setup() {
48 + if [[ ${MERGE_TYPE} != "binary" ]] && use openmp && ! tc-has-openmp; then
49 + ewarn "You are using a compiler without OpenMP support"
50 + die "Need an OpenMP capable compiler"
51 + fi
52 +}
53 +
54 +src_prepare() {
55 + default
56 + # fix bashism
57 + sed -i -e 's/ == / = /' configure.ac || die
58 + # https://github.com/BLAKE2/libb2/pull/28
59 + echo 'libb2_la_LDFLAGS = -no-undefined' >> src/Makefile.am || die
60 + eautoreconf # upstream doesn't make releases
61 +}
62 +
63 +multilib_src_configure() {
64 + ECONF_SOURCE=${S} \
65 + econf \
66 + $(use_enable static-libs static) \
67 + $(use_enable native-cflags native) \
68 + $(use_enable openmp)
69 +}
70 +
71 +do_make() {
72 + # respect our CFLAGS when native-cflags is not in effect
73 + local openmp=$(use openmp && echo -fopenmp)
74 + emake $(use native-cflags && echo no)CFLAGS="${CFLAGS} ${openmp}" "$@"
75 +}
76 +
77 +multilib_src_compile() {
78 + do_make
79 +}
80 +
81 +multilib_src_test() {
82 + do_make check
83 +}
84 +
85 +multilib_src_install_all() {
86 + einstalldocs
87 + find "${ED}" -name '*.la' -type f -delete || die
88 +}