profiles: Mask dev-db/mysql-5.5*
[gentoo.git] / sci-libs / djbfft / djbfft-0.76-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
6
7 DESCRIPTION="Extremely fast library for floating-point convolution"
8 HOMEPAGE="http://cr.yp.to/djbfft.html"
9 SRC_URI="http://cr.yp.to/djbfft/${P}.tar.gz"
10
11 LICENSE="public-domain"
12 SLOT="0"
13 KEYWORDS="alpha amd64 arm arm64 ~hppa ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
14 IUSE=""
15 DOCS=( CHANGES README TODO VERSION )
16
17 src_prepare() {
18         SOVER="${PV:0:1}.${PV:2:1}.${PV:3:1}" # a.bc -> a.b.c
19         # mask out everything, which is not suggested by the author (RTFM)!
20         ALLOWED_FLAGS="-fstack-protector -march -mcpu -pipe -mpreferred-stack-boundary -ffast-math"
21         strip-flags
22
23         SONAME="libdjbfft.so.${SOVER}"
24
25         epatch \
26                 "${FILESDIR}"/${P}-gcc3.patch \
27                 "${FILESDIR}"/${P}-shared.patch \
28                 "${FILESDIR}"/${P}-headers.patch
29         multilib_copy_sources
30 }
31
32 multilib_src_configure() {
33         [[ ${ABI} == x86* ]] && append-cflags -malign-double
34
35         sed -i -e "s:\"lib\":\"$(get_libdir)\":" hier.c || die
36         echo "$(tc-getCC) ${CFLAGS} -fPIC" > "conf-cc"
37         echo "$(tc-getCC) ${LDFLAGS}" > "conf-ld"
38         echo "${ED}usr" > "conf-home"
39         einfo "conf-cc: $(<conf-cc)"
40 }
41
42 multilib_src_compile() {
43         emake \
44                 LIBDJBFFT=${SONAME} \
45                 LIBPERMS=0755 \
46                 ${SONAME}
47         echo "the compile function was:"
48         cat ./compile
49         echo "the conf-ld function was:"
50         cat ./conf-ld
51 }
52
53 multilib_src_test() {
54         local t
55         for t in accuracy accuracy2 speed; do
56                 emake ${t}
57                 einfo "Testing ${t}"
58                 LD_LIBRARY_PATH=. ./${t} > ${t}.out || die "test ${t} failed"
59         done
60 }
61
62 multilib_src_install() {
63         emake LIBDJBFFT=${SONAME} install
64         ./install || die "install failed"
65         dosym ${SONAME} /usr/$(get_libdir)/libdjbfft.so
66         dosym ${SONAME} /usr/$(get_libdir)/libdjbfft.so.${SOVER%%.*}
67 }