Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libtommath/
Date: Wed, 26 Jul 2017 20:41:51
Message-Id: 1501101697.75a62f8133f164629233684db882f16eec2fe1ef.slyfox@gentoo
1 commit: 75a62f8133f164629233684db882f16eec2fe1ef
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 26 20:41:37 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 26 20:41:37 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75a62f81
7
8 dev-libs/libtommath: respect CC in src_test(), bug #547760
9
10 While at it added actual test execution.
11 This package does not run 'make test' by default but only compiles ./test.
12
13 Package-Manager: Portage-2.3.6, Repoman-2.3.3
14
15 dev-libs/libtommath/libtommath-1.0-r1.ebuild | 72 ++++++++++++++++++++++++++++
16 1 file changed, 72 insertions(+)
17
18 diff --git a/dev-libs/libtommath/libtommath-1.0-r1.ebuild b/dev-libs/libtommath/libtommath-1.0-r1.ebuild
19 new file mode 100644
20 index 00000000000..157da4e5a9b
21 --- /dev/null
22 +++ b/dev-libs/libtommath/libtommath-1.0-r1.ebuild
23 @@ -0,0 +1,72 @@
24 +# Copyright 1999-2017 Gentoo Foundation
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=5
28 +
29 +inherit autotools eutils multilib toolchain-funcs
30 +
31 +DESCRIPTION="highly optimized and portable routines for integer theoretic applications"
32 +HOMEPAGE="http://www.libtom.net/"
33 +SRC_URI="https://github.com/libtom/libtommath/releases/download/v${PV}/ltm-${PV}.tar.xz"
34 +
35 +LICENSE="WTFPL-2"
36 +SLOT="0"
37 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
38 +IUSE="doc examples static-libs"
39 +
40 +DEPEND="sys-devel/libtool"
41 +RDEPEND=""
42 +
43 +src_prepare() {
44 + # need libtool for cross compilation. Bug #376643
45 + cat <<-EOF > configure.ac
46 + AC_INIT(libtommath, 0)
47 + AM_INIT_AUTOMAKE
48 + LT_INIT
49 + AC_CONFIG_FILES(Makefile)
50 + AC_OUTPUT
51 + EOF
52 + touch NEWS README AUTHORS ChangeLog Makefile.am
53 + eautoreconf
54 + export LT="${S}"/libtool
55 +}
56 +
57 +src_configure() {
58 + econf $(use_enable static-libs static)
59 +}
60 +
61 +_emake() {
62 + emake \
63 + CC="$(tc-getCC)" \
64 + AR="$(tc-getAR)" \
65 + RANLIB="$(tc-getRANLIB)" \
66 + -f makefile.shared \
67 + IGNORE_SPEED=1 \
68 + LIBPATH="${EPREFIX}/usr/$(get_libdir)" \
69 + INCPATH="${EPREFIX}/usr/include" \
70 + "$@"
71 +}
72 +
73 +src_compile() {
74 + _emake
75 +}
76 +
77 +src_test() {
78 + _emake test_standalone
79 + ./test || die
80 +}
81 +
82 +src_install() {
83 + _emake DESTDIR="${D}" install
84 + # We only link against -lc, so drop the .la file.
85 + find "${ED}" -name '*.la' -delete
86 +
87 + dodoc changes.txt
88 +
89 + use doc && dodoc *.pdf
90 +
91 + if use examples ; then
92 + docinto demo
93 + dodoc demo/*.c
94 + fi
95 +}