Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/fftw/, sci-libs/fftw/files/
Date: Wed, 31 Aug 2016 20:09:51
Message-Id: 1472674167.27003093937c3e0162477bbd3fd23c5de986d17a.soap@gentoo
1 commit: 27003093937c3e0162477bbd3fd23c5de986d17a
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 31 20:07:38 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 31 20:09:27 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27003093
7
8 sci-libs/fftw: Rewrite ebuild to EAPI=6 standards
9
10 * Use multibuild.eclass for single/double precision
11 * Make patches -p1 compliant
12 * Simplify src_configure phase
13
14 Package-Manager: portage-2.3.0
15
16 sci-libs/fftw/fftw-2.1.5-r9.ebuild | 138 ++++++++++++++++++++++
17 sci-libs/fftw/files/fftw-2.1.5-as-needed.patch | 16 +--
18 sci-libs/fftw/files/fftw-2.1.5-configure.in.patch | 4 +-
19 sci-libs/fftw/files/fftw-2.1.5-no-test.patch | 12 +-
20 4 files changed, 154 insertions(+), 16 deletions(-)
21
22 diff --git a/sci-libs/fftw/fftw-2.1.5-r9.ebuild b/sci-libs/fftw/fftw-2.1.5-r9.ebuild
23 new file mode 100644
24 index 00000000..bc142c7
25 --- /dev/null
26 +++ b/sci-libs/fftw/fftw-2.1.5-r9.ebuild
27 @@ -0,0 +1,138 @@
28 +# Copyright 1999-2016 Gentoo Foundation
29 +# Distributed under the terms of the GNU General Public License v2
30 +# $Id$
31 +
32 +EAPI=6
33 +
34 +FORTRAN_NEEDED=fortran
35 +
36 +inherit autotools flag-o-matic fortran-2 multibuild toolchain-funcs
37 +
38 +DESCRIPTION="Fast C library for the Discrete Fourier Transform"
39 +HOMEPAGE="http://www.fftw.org"
40 +SRC_URI="http://www.fftw.org/${P}.tar.gz"
41 +
42 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
43 +
44 +LICENSE="GPL-2+"
45 +SLOT="2.1"
46 +IUSE="doc float fortran mpi openmp threads static-libs"
47 +
48 +RDEPEND="mpi? ( virtual/mpi )"
49 +DEPEND="${RDEPEND}"
50 +
51 +PATCHES=(
52 + "${FILESDIR}"/${P}-as-needed.patch
53 + "${FILESDIR}"/${P}-configure.in.patch
54 + "${FILESDIR}"/${P}-no-test.patch
55 + "${FILESDIR}"/${P}-cc.patch
56 + "${FILESDIR}"/${P}-texinfo5.1.patch
57 +)
58 +
59 +pkg_setup() {
60 + if [[ ${MERGE_TYPE} != binary ]] && use openmp; then
61 + if ! tc-has-openmp; then
62 + ewarn "OpenMP is not available in your current selected compiler"
63 +
64 + if tc-is-clang; then
65 + ewarn "OpenMP support in sys-devel/clang is provided by sys-libs/libomp,"
66 + ewarn "which you will need to build ${CATEGORY}/${PN} with USE=\"openmp\""
67 + fi
68 +
69 + die "need openmp capable compiler"
70 + fi
71 + FORTRAN_NEED_OPENMP=1
72 + fi
73 +
74 + fortran-2_pkg_setup
75 +
76 + MULTIBUILD_VARIANTS=( single double )
77 +}
78 +
79 +src_prepare() {
80 + default
81 +
82 + # fix info files
83 + local infofile
84 + for infofile in doc/fftw*info*; do
85 + cat >> ${infofile} <<-EOF || die
86 + INFO-DIR-SECTION Libraries
87 + START-INFO-DIR-ENTRY
88 + * fftw: (fftw). ${DESCRIPTION}
89 + END-INFO-DIR-ENTRY
90 + EOF
91 + done
92 +
93 + mv configure.{in,ac} || die
94 + sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac || die
95 +
96 + eautoreconf
97 +
98 + # 'FAQ' is actually a dir and causes issues with einstalldocs
99 + rm -r FAQ || die
100 +
101 + multibuild_copy_sources
102 +}
103 +
104 +fftw_src_configure() {
105 + local myconf=(
106 + --with-gcc=$(tc-getCC)
107 + --enable-shared
108 + --enable-type-prefix
109 + --enable-vec-recurse
110 + $(use_enable fortran)
111 + $(use_enable mpi)
112 + $(use_enable static-libs static)
113 + $(use_enable x86 i386-hacks)
114 + $(use_with openmp)
115 + )
116 +
117 + if use openmp || use threads; then
118 + myconf+=( --enable-threads )
119 + else
120 + myconf+=( --disable-threads )
121 + fi
122 +
123 + [[ $MULTIBUILD_VARIANT == single ]] && myconf+=( --enable-float )
124 +
125 + econf "${myconf[@]}"
126 +}
127 +
128 +src_configure() {
129 + # this one is reported to cause trouble on pentium4 m series
130 + filter-mfpmath sse
131 +
132 + # here I need (surprise) to increase optimization:
133 + # --enable-i386-hacks requires -fomit-frame-pointer to work properly
134 + if use x86; then
135 + is-flag -fomit-frame-pointer || append-flags -fomit-frame-pointer
136 + fi
137 + use openmp && [[ $(tc-getCC)$ == icc* ]] && append-ldflags $(no-as-needed)
138 +
139 + multibuild_foreach_variant run_in_build_dir fftw_src_configure
140 +}
141 +
142 +src_compile() {
143 + multibuild_foreach_variant run_in_build_dir default_src_compile
144 +}
145 +
146 +src_test() {
147 + multibuild_foreach_variant run_in_build_dir default_src_test
148 +}
149 +
150 +src_install () {
151 + use doc && HTML_DOCS=( doc/{*.html,*.gif} )
152 + multibuild_foreach_variant run_in_build_dir default_src_install
153 +
154 + doheader fortran/fftw_f77.i
155 +
156 + create_fftw_symlinks() {
157 + local i f letter=$1
158 + for i in fft rfft; do
159 + for f in "${ED%/}"/usr/{include,$(get_libdir)}/*${letter}${i}*; do
160 + ln -s $(basename ${f}) ${f/${letter}${i}/${i}} || die
161 + done
162 + done
163 + }
164 + create_fftw_symlinks $(usex float s d)
165 +}
166
167 diff --git a/sci-libs/fftw/files/fftw-2.1.5-as-needed.patch b/sci-libs/fftw/files/fftw-2.1.5-as-needed.patch
168 index 2389f0e..63f46dc 100644
169 --- a/sci-libs/fftw/files/fftw-2.1.5-as-needed.patch
170 +++ b/sci-libs/fftw/files/fftw-2.1.5-as-needed.patch
171 @@ -1,5 +1,5 @@
172 ---- rfftw/Makefile.am.orig 2008-04-03 15:23:06.989019659 +0000
173 -+++ rfftw/Makefile.am 2008-04-03 15:23:35.658653448 +0000
174 +--- a/rfftw/Makefile.am
175 ++++ b/rfftw/Makefile.am
176 @@ -18,6 +18,7 @@
177 rfftw.h
178
179 @@ -8,8 +8,8 @@
180 MAINTAINERCLEANFILES = $(CODELETS) rconfig.c
181 DISTCLEANFILES = srfftw.h drfftw.h
182
183 ---- threads/Makefile.am.orig 2008-04-03 15:23:10.101197011 +0000
184 -+++ threads/Makefile.am 2008-04-03 15:23:35.662653676 +0000
185 +--- a/threads/Makefile.am
186 ++++ b/threads/Makefile.am
187 @@ -28,6 +28,10 @@
188 -version-info @SHARED_VERSION_INFO@ \
189 -rpath $(libdir)
190 @@ -33,8 +33,8 @@
191 @FFTW_PREFIX1@rfftw_threads.h: rfftw_threads.h
192 rm -f $@
193 sed 's/\"fftw/\"@FFTW_PREFIX@fftw/g;s/\"rfftw/\"@FFTW_PREFIX@rfftw/g' $(srcdir)/rfftw_threads.h > $@
194 ---- mpi/Makefile.am.orig 2008-04-03 15:22:43.811698858 +0000
195 -+++ mpi/Makefile.am 2008-04-03 15:25:50.930362143 +0000
196 +--- a/mpi/Makefile.am
197 ++++ b/mpi/Makefile.am
198 @@ -28,6 +28,9 @@
199 -version-info @SHARED_VERSION_INFO@ \
200 -rpath $(libdir)
201 @@ -92,8 +92,8 @@
202
203 # for some reason, automake tries to use autoheader in order to
204 # generate config.h.in, and fails because config.h.in is GNU-lly
205 ---- mpi/test_sched.c.orig 2008-04-03 16:58:01.969033125 +0000
206 -+++ mpi/test_sched.c 2008-04-03 16:59:27.521908505 +0000
207 +--- a/mpi/test_sched.c
208 ++++ b/mpi/test_sched.c
209 @@ -27,6 +27,8 @@
210 int **sched;
211 int npes = -1, sortpe = -1, steps;
212
213 diff --git a/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch b/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch
214 index 718e746..7abe3e7 100644
215 --- a/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch
216 +++ b/sci-libs/fftw/files/fftw-2.1.5-configure.in.patch
217 @@ -1,5 +1,5 @@
218 ---- configure.in.orig 2008-07-09 17:52:16.762461233 +0100
219 -+++ configure.in 2008-07-09 18:34:13.106471656 +0100
220 +--- a/configure.in
221 ++++ b/configure.in
222 @@ -1,6 +1,8 @@
223 +
224 dnl Process this file with autoconf to produce a configure script.
225
226 diff --git a/sci-libs/fftw/files/fftw-2.1.5-no-test.patch b/sci-libs/fftw/files/fftw-2.1.5-no-test.patch
227 index f9f54f6..cc844a4 100644
228 --- a/sci-libs/fftw/files/fftw-2.1.5-no-test.patch
229 +++ b/sci-libs/fftw/files/fftw-2.1.5-no-test.patch
230 @@ -1,13 +1,13 @@
231 ---- tests/Makefile.am.orig 2008-06-22 12:29:53.149138283 +0100
232 -+++ tests/Makefile.am 2008-06-22 12:30:32.731595087 +0100
233 +--- a/tests/Makefile.am
234 ++++ b/tests/Makefile.am
235 @@ -1,4 +1,4 @@
236 -noinst_PROGRAMS = fftw_test rfftw_test
237 +check_PROGRAMS = fftw_test rfftw_test
238 noinst_HEADERS = test_main.h
239
240 FFTWDIR=../fftw
241 ---- mpi/Makefile.am.orig 2008-06-22 17:21:16.998466390 +0100
242 -+++ mpi/Makefile.am 2008-06-22 17:27:42.996463162 +0100
243 +--- a/mpi/Makefile.am
244 ++++ b/mpi/Makefile.am
245 @@ -4,8 +4,8 @@
246
247 lib_LTLIBRARIES = @FFTW_MPI_LIBLIST@
248 @@ -18,8 +18,8 @@
249 EXTRA_LTLIBRARIES = lib@FFTW_PREFIX@fftw_mpi.la \
250 lib@FFTW_PREFIX@rfftw_mpi.la
251 EXTRA_HEADERS = @FFTW_PREFIX@fftw_mpi.h @FFTW_PREFIX@rfftw_mpi.h
252 ---- threads/Makefile.am.orig 2008-06-22 17:18:18.940409610 +0100
253 -+++ threads/Makefile.am 2008-06-22 17:28:00.485459803 +0100
254 +--- a/threads/Makefile.am
255 ++++ b/threads/Makefile.am
256 @@ -4,9 +4,9 @@
257
258 lib_LTLIBRARIES = @FFTW_THREADS_LIBLIST@