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-biology/samtools/files/, sci-biology/samtools/
Date: Mon, 28 Mar 2016 19:59:38
Message-Id: 1459195164.767b616524e6b171ed4775fe35ecd068f58abc22.soap@gentoo
1 commit: 767b616524e6b171ed4775fe35ecd068f58abc22
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 19:59:02 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 19:59:24 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=767b6165
7
8 sci-biology/samtools: version bump to 1.3, to match htslib
9
10 * EAPI=6
11 * Added modern AX_WITH_CURSES that works with pkg-config
12 * Fixed incorrect symlinks for libbam.so
13
14 Package-Manager: portage-2.2.28
15
16 sci-biology/samtools/Manifest | 1 +
17 .../samtools/files/samtools-1.3-buildsystem.patch | 174 +++++
18 .../samtools/files/samtools-1.3-ncurses.patch | 737 +++++++++++++++++++++
19 sci-biology/samtools/samtools-1.3.ebuild | 86 +++
20 4 files changed, 998 insertions(+)
21
22 diff --git a/sci-biology/samtools/Manifest b/sci-biology/samtools/Manifest
23 index fd88ba4..d25774f 100644
24 --- a/sci-biology/samtools/Manifest
25 +++ b/sci-biology/samtools/Manifest
26 @@ -4,3 +4,4 @@ DIST samtools-0.1.20.tar.gz 566387 SHA256 500019b4d1886ad995513d5ce8b413b14b51f1
27 DIST samtools-1.0.tar.bz2 4459669 SHA256 7340b843663c3f54a902a06f2f73c68198f3a62d29a2ed20671139957f7fd7c0 SHA512 5b80995c522d08b06a4c559f60a5e200d9085be7f44c3c9618db91e3de85e36c1473e42715eae8175520d7da3df8245bafa82e625d2fc08e0197adb395851693 WHIRLPOOL 2aa0f8639da9b0b828ca7296969e5c600b0e5452ad3231b914e4a7be418700906a4d695c928eaf837b643255567ec82cfadf0b53007e0f1e3a956856f6c4c832
28 DIST samtools-1.1.tar.bz2 4495373 SHA256 c24d26c303153d72b5bf3cc11f72c6c375a4ca1140cc485648c8c5473414b7f8 SHA512 a5552a6c8c4b0808b725b39ddb2fafa36c4f6623bfc7f84faadae7690223e4eec8d722af09c77145796ad9b3f01e04115dd0207207ccfafbb52ffc22d5fc09f0 WHIRLPOOL ed3131b2a8d8b4dab40b53d35a9b00b657670a949dc1597c91fbcd00392c1c1715a85a1d1e49bf0c73ae082738ccfb13d2c6809dbbeba17ff3028f6023ebc449
29 DIST samtools-1.2.tar.bz2 4547126 SHA256 420e7a4a107fe37619b9d300b6379452eb8eb04a4a9b65c3ec69de82ccc26daa SHA512 4849c3274e732267516b63799f5430c5415d575d46eddf6b704dac51053281094b03b90dd9f5367bcd14c22fb0fb1bd6a412f7d4225f7be5f5385437c5d2101d WHIRLPOOL 273185764a807365a20c381769f987ef02d14ae8e20a3a7fd5af4344769c5fab68d7155523e8c0c8c3cc86092898c2c8454cce8f1560d415bc2b41549cdf04f4
30 +DIST samtools-1.3.tar.bz2 3978333 SHA256 beea4003c795a0a25224656815b4036f6864b8753053ed30c590bb052b70b60e SHA512 72920d4f0f10aa7b54ef448e03e6e769e1e07abd07388a2307d0e52548fa2909c03ca2c7eec5c63cf5b67724b2356833accb0079ce1486bb2ac66a45963a24ea WHIRLPOOL 3f798078100b4ed164f6c89d18cc8f62159437e2cfb2a228ac00f8d08313f7c39ef546214c0796c25a419c0a1065dc21d14b966fed769726b9b1975ec07e3b3e
31
32 diff --git a/sci-biology/samtools/files/samtools-1.3-buildsystem.patch b/sci-biology/samtools/files/samtools-1.3-buildsystem.patch
33 new file mode 100644
34 index 0000000..61f6b03
35 --- /dev/null
36 +++ b/sci-biology/samtools/files/samtools-1.3-buildsystem.patch
37 @@ -0,0 +1,174 @@
38 +--- samtools-1.3/Makefile
39 ++++ samtools-1.3/Makefile
40 +@@ -21,11 +21,12 @@
41 + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
42 + # DEALINGS IN THE SOFTWARE.
43 +
44 +-CC = gcc
45 +-CPPFLAGS =
46 +-CFLAGS = -g -Wall -O2
47 +-LDFLAGS =
48 +-LIBS =
49 ++CC ?= gcc
50 ++CPPFLAGS +=
51 ++CFLAGS ?= -g -Wall -O2
52 ++LDFLAGS +=
53 ++LIBS +=
54 ++BAMLIB ?= libbam.a
55 +
56 + DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
57 + LOBJS= bam_aux.o bam.o bam_import.o sam.o \
58 +@@ -42,6 +43,7 @@
59 + prefix = /usr/local
60 + exec_prefix = $(prefix)
61 + bindir = $(exec_prefix)/bin
62 ++libdir ?= $(exec_prefix)/lib
63 + datarootdir = $(prefix)/share
64 + mandir = $(datarootdir)/man
65 + man1dir = $(mandir)/man1
66 +@@ -129,67 +131,74 @@
67 + .c.o:
68 + $(CC) $(CFLAGS) $(ALL_CPPFLAGS) -c -o $@ $<
69 +
70 ++$(LOBJS):
71 ++ $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $<
72 +
73 +-lib:libbam.a
74 ++lib:libbam.a libbam.so.1.0
75 +
76 + libbam.a:$(LOBJS)
77 + $(AR) -csru $@ $(LOBJS)
78 +
79 +-samtools: $(AOBJS) libbam.a $(HTSLIB)
80 +- $(CC) -pthread $(ALL_LDFLAGS) -o $@ $(AOBJS) libbam.a $(HTSLIB_LIB) $(CURSES_LIB) -lm $(ALL_LIBS)
81 ++libbam.so.1.0:$(LOBJS)
82 ++ $(CC) $(LDFLAGS) -shared -Wl,--soname,$@ -o $@ $(LOBJS) $(HTSLIB) -lz
83 ++ ln -sf $@ libbam.so.1
84 ++ ln -sf $@ libbam.so
85 ++
86 ++samtools: $(AOBJS) lib
87 ++ $(CC) -pthread $(LDFLAGS) -o $@ $(AOBJS) $(BAMLIB) $(HTSLIB) $(LDLIBS) $(LIBCURSES) -lm -lz
88 +
89 + bam_h = bam.h $(htslib_bgzf_h) $(htslib_sam_h)
90 + bam2bcf_h = bam2bcf.h $(htslib_vcf_h) errmod.h
91 + bam_lpileup_h = bam_lpileup.h $(htslib_sam_h)
92 + bam_plbuf_h = bam_plbuf.h $(htslib_sam_h)
93 +-bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(htslib_khash_h) $(bam_lpileup_h)
94 ++bam_tview_h = bam_tview.h $(htslib_hts_h) $(htslib_sam_h) $(htslib_faidx_h) $(bam2bcf_h) $(bam_lpileup_h)
95 + sam_h = sam.h $(htslib_sam_h) $(bam_h)
96 + sam_opts_h = sam_opts.h $(htslib_hts_h)
97 +-sample_h = sample.h $(htslib_kstring_h)
98 ++sample_h = sample.h
99 +
100 + bam.o: bam.c $(bam_h) $(htslib_kstring_h) sam_header.h
101 +-bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(htslib_kstring_h) $(htslib_kfunc_h) $(bam2bcf_h) errmod.h
102 ++bam2bcf.o: bam2bcf.c $(htslib_sam_h) $(bam2bcf_h) errmod.h
103 + bam2bcf_indel.o: bam2bcf_indel.c $(htslib_sam_h) $(bam2bcf_h) kprobaln.h $(htslib_khash_h) $(htslib_ksort_h)
104 + bam2depth.o: bam2depth.c $(htslib_sam_h) samtools.h $(sam_opts_h)
105 + bam_addrprg.o: bam_addrprg.c $(htslib_sam_h) $(htslib_kstring_h) samtools.h $(sam_opts_h)
106 + bam_aux.o: bam_aux.c $(bam_h)
107 + bam_cat.o: bam_cat.c $(htslib_bgzf_h) $(htslib_sam_h) $(htslib_cram_h) $(htslib_khash_h)
108 + bam_color.o: bam_color.c $(bam_h)
109 +-bam_import.o: bam_import.c $(htslib_kstring_h) $(bam_h) $(htslib_kseq_h)
110 +-bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_khash_h) samtools.h
111 +-bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h) $(htslib_ksort_h)
112 ++bam_import.o: bam_import.c $(bam_h)
113 ++bam_index.o: bam_index.c $(htslib_hts_h) $(htslib_sam_h)
114 ++bam_lpileup.o: bam_lpileup.c $(bam_plbuf_h) $(bam_lpileup_h)
115 + bam_mate.o: bam_mate.c $(sam_opts_h) $(htslib_kstring_h) $(htslib_sam_h)
116 + bam_md.o: bam_md.c $(htslib_faidx_h) $(htslib_sam_h) $(htslib_kstring_h) kprobaln.h $(sam_opts_h)
117 + bam_plbuf.o: bam_plbuf.c $(htslib_hts_h) $(htslib_sam_h) $(bam_plbuf_h)
118 +-bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h) $(htslib_khash_str2int_h) sam_header.h samtools.h $(sam_opts_h) $(bam2bcf_h) $(sample_h)
119 ++bam_plcmd.o: bam_plcmd.c $(htslib_sam_h) $(htslib_faidx_h) sam_header.h samtools.h $(bam2bcf_h) $(sample_h)
120 + bam_quickcheck.o: bam_quickcheck.c $(htslib_hts_h) $(htslib_sam_h) $(htslib_bgzf_h)
121 + bam_reheader.o: bam_reheader.c $(htslib_bgzf_h) $(htslib_sam_h) $(htslib_hfile_h) $(htslib_cram_h) samtools.h
122 +-bam_rmdup.o: bam_rmdup.c $(htslib_sam_h) $(sam_opts_h) $(bam_h) $(htslib_khash_h)
123 +-bam_rmdupse.o: bam_rmdupse.c $(bam_h) $(htslib_sam_h) $(htslib_khash_h) $(htslib_klist_h)
124 +-bam_sort.o: bam_sort.c $(htslib_ksort_h) $(htslib_khash_h) $(htslib_klist_h) $(htslib_kstring_h) $(htslib_sam_h) $(sam_opts_h)
125 ++bam_rmdup.o: bam_rmdup.c $(sam_h)
126 ++bam_rmdupse.o: bam_rmdupse.c $(sam_h)
127 ++bam_sort.o: bam_sort.c $(htslib_sam_h)
128 + bam_split.o: bam_split.c $(htslib_sam_h) $(htslib_khash_h) $(htslib_kstring_h) $(sam_opts_h)
129 + bam_stat.o: bam_stat.c $(htslib_sam_h) samtools.h
130 + bam_tview.o: bam_tview.c $(bam_tview_h) $(htslib_faidx_h) $(htslib_sam_h) $(htslib_bgzf_h) $(sam_opts_h)
131 + bam_tview_curses.o: bam_tview_curses.c config.h $(bam_tview_h)
132 + bam_tview_html.o: bam_tview_html.c $(bam_tview_h)
133 + bam_flags.o: bam_flags.c $(htslib_sam_h)
134 +-bamshuf.o: bamshuf.c $(htslib_sam_h) $(htslib_hts_h) $(htslib_ksort_h) samtools.h $(sam_opts_h)
135 ++bamshuf.o: bamshuf.c $(htslib_sam_h) samtools.h
136 + bamtk.o: bamtk.c $(htslib_hts_h) samtools.h version.h
137 +-bedcov.o: bedcov.c $(htslib_kstring_h) $(htslib_sam_h) $(sam_opts_h) $(htslib_kseq_h)
138 +-bedidx.o: bedidx.c $(htslib_ksort_h) $(htslib_kseq_h) $(htslib_khash_h)
139 ++bedcov.o: bedcov.c $(htslib_sam_h)
140 ++bedidx.o: bedidx.c
141 + cut_target.o: cut_target.c $(htslib_sam_h) errmod.h $(htslib_faidx_h) $(sam_opts_h)
142 + dict.o: dict.c $(htslib_kseq_h) $(htslib_hts_h)
143 +-errmod.o: errmod.c errmod.h $(htslib_ksort_h)
144 ++errmod.o: errmod.c errmod.h
145 + kprobaln.o: kprobaln.c kprobaln.h
146 + padding.o: padding.c $(htslib_kstring_h) $(htslib_sam_h) $(htslib_faidx_h) sam_header.h $(sam_opts_h)
147 +-phase.o: phase.c $(htslib_sam_h) errmod.h $(sam_opts_h) $(htslib_kseq_h) $(htslib_khash_h) $(htslib_ksort_h)
148 ++phase.o: phase.c $(htslib_sam_h) errmod.h
149 + sam.o: sam.c $(htslib_faidx_h) $(sam_h)
150 +-sam_header.o: sam_header.c sam_header.h $(htslib_khash_h)
151 ++sam_header.o: sam_header.c sam_header.h
152 + sam_opts.o: sam_opts.c $(sam_opts_h)
153 +-sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) $(htslib_kstring_h) $(htslib_khash_h) samtools.h $(sam_opts_h)
154 +-sample.o: sample.c $(sample_h) $(htslib_khash_h)
155 +-stats_isize.o: stats_isize.c stats_isize.h $(htslib_khash_h)
156 +-stats.o: stats.c $(htslib_faidx_h) $(htslib_sam_h) $(htslib_hts_h) sam_header.h $(htslib_khash_str2int_h) samtools.h $(htslib_khash_h) $(htslib_kstring_h) stats_isize.h $(sam_opts_h)
157 ++sam_view.o: sam_view.c $(htslib_sam_h) $(htslib_faidx_h) samtools.h
158 ++sample.o: sample.c $(sample_h)
159 ++stats_isize.o: stats_isize.c stats_isize.h
160 ++stats.o: stats.c $(sam_h) sam_header.h samtools.h stats_isize.h $(htslib_faidx_h)
161 +
162 +
163 + # test programs
164 +@@ -197,8 +206,8 @@
165 + # For tests that might use it, set $REF_PATH explicitly to use only reference
166 + # areas within the test suite (or set it to ':' to use no reference areas).
167 + # (regression.sh sets $REF_PATH to a subdirectory itself.)
168 +-check test: samtools $(BGZIP) $(BUILT_TEST_PROGRAMS)
169 +- REF_PATH=: test/test.pl --exec bgzip=$(BGZIP)
170 ++check test: samtools $(BUILT_TEST_PROGRAMS)
171 ++ REF_PATH=: test/test.pl --exec bgzip=bgzip
172 + test/merge/test_bam_translate test/merge/test_bam_translate.tmp
173 + test/merge/test_rtrans_build
174 + test/merge/test_trans_tbl_init
175 +@@ -210,28 +219,28 @@
176 + test/split/test_parse_args
177 +
178 +
179 +-test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o sam_opts.o $(HTSLIB)
180 ++test/merge/test_bam_translate: test/merge/test_bam_translate.o test/test.o
181 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_bam_translate.o test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
182 +
183 +-test/merge/test_rtrans_build: test/merge/test_rtrans_build.o sam_opts.o $(HTSLIB)
184 ++test/merge/test_rtrans_build: test/merge/test_rtrans_build.o
185 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_rtrans_build.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
186 +
187 +-test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o sam_opts.o $(HTSLIB)
188 ++test/merge/test_trans_tbl_init: test/merge/test_trans_tbl_init.o
189 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/merge/test_trans_tbl_init.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
190 +
191 +-test/split/test_count_rg: test/split/test_count_rg.o test/test.o sam_opts.o $(HTSLIB)
192 ++test/split/test_count_rg: test/split/test_count_rg.o test/test.o
193 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_count_rg.o test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
194 +
195 +-test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o sam_opts.o $(HTSLIB)
196 ++test/split/test_expand_format_string: test/split/test_expand_format_string.o test/test.o
197 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_expand_format_string.o test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
198 +
199 +-test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o sam_opts.o $(HTSLIB)
200 ++test/split/test_filter_header_rg: test/split/test_filter_header_rg.o test/test.o
201 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_filter_header_rg.o test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
202 +
203 +-test/split/test_parse_args: test/split/test_parse_args.o test/test.o sam_opts.o $(HTSLIB)
204 ++test/split/test_parse_args: test/split/test_parse_args.o test/test.o
205 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/split/test_parse_args.o test/test.o sam_opts.o $(HTSLIB_LIB) $(ALL_LIBS)
206 +
207 +-test/vcf-miniview: test/vcf-miniview.o $(HTSLIB)
208 ++test/vcf-miniview: test/vcf-miniview.o
209 + $(CC) -pthread $(ALL_LDFLAGS) -o $@ test/vcf-miniview.o $(HTSLIB_LIB) $(ALL_LIBS)
210 +
211 + test_test_h = test/test.h $(htslib_sam_h)
212
213 diff --git a/sci-biology/samtools/files/samtools-1.3-ncurses.patch b/sci-biology/samtools/files/samtools-1.3-ncurses.patch
214 new file mode 100644
215 index 0000000..baeb670
216 --- /dev/null
217 +++ b/sci-biology/samtools/files/samtools-1.3-ncurses.patch
218 @@ -0,0 +1,737 @@
219 +* Add modern AX_WITH_CURSES that prefers using pkg-config for detecting ncurses
220 +* Change macro structure by moving AX_WITH_HTSLIB into its own file
221 +
222 +--- samtools-1.3/configure.ac
223 ++++ samtools-1.3/configure.ac
224 +@@ -28,6 +28,7 @@
225 + AC_PREREQ([2.63]) dnl This version introduced 4-argument AC_CHECK_HEADER
226 + AC_CONFIG_SRCDIR([bamtk.c])
227 + AC_CONFIG_HEADERS([config.h])
228 ++AC_CONFIG_MACRO_DIR([m4])
229 +
230 + dnl Copyright notice to be copied into the generated configure script
231 + AC_COPYRIGHT([Portions copyright (C) 2015 Genome Research Ltd.
232 +--- samtools-1.3/m4/ax_with_curses.m4
233 ++++ samtools-1.3/m4/ax_with_curses.m4
234 +@@ -0,0 +1,578 @@
235 ++# ===========================================================================
236 ++# http://www.gnu.org/software/autoconf-archive/ax_with_curses.html
237 ++# ===========================================================================
238 ++#
239 ++# SYNOPSIS
240 ++#
241 ++# AX_WITH_CURSES
242 ++#
243 ++# DESCRIPTION
244 ++#
245 ++# This macro checks whether a SysV or X/Open-compatible Curses library is
246 ++# present, along with the associated header file. The NcursesW
247 ++# (wide-character) library is searched for first, followed by Ncurses,
248 ++# then the system-default plain Curses. The first library found is the
249 ++# one returned. Finding libraries will first be attempted by using
250 ++# pkg-config, and should the pkg-config files not be available, will
251 ++# fallback to combinations of known flags itself.
252 ++#
253 ++# The following options are understood: --with-ncursesw, --with-ncurses,
254 ++# --without-ncursesw, --without-ncurses. The "--with" options force the
255 ++# macro to use that particular library, terminating with an error if not
256 ++# found. The "--without" options simply skip the check for that library.
257 ++# The effect on the search pattern is:
258 ++#
259 ++# (no options) - NcursesW, Ncurses, Curses
260 ++# --with-ncurses --with-ncursesw - NcursesW only [*]
261 ++# --without-ncurses --with-ncursesw - NcursesW only [*]
262 ++# --with-ncursesw - NcursesW only [*]
263 ++# --with-ncurses --without-ncursesw - Ncurses only [*]
264 ++# --with-ncurses - NcursesW, Ncurses [**]
265 ++# --without-ncurses --without-ncursesw - Curses only
266 ++# --without-ncursesw - Ncurses, Curses
267 ++# --without-ncurses - NcursesW, Curses
268 ++#
269 ++# [*] If the library is not found, abort the configure script.
270 ++#
271 ++# [**] If the second library (Ncurses) is not found, abort configure.
272 ++#
273 ++# The following preprocessor symbols may be defined by this macro if the
274 ++# appropriate conditions are met:
275 ++#
276 ++# HAVE_CURSES - if any SysV or X/Open Curses library found
277 ++# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions
278 ++# HAVE_CURSES_COLOR - if library supports color (enhanced functions)
279 ++# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features
280 ++# HAVE_NCURSESW - if NcursesW (wide char) library is to be used
281 ++# HAVE_NCURSES - if the Ncurses library is to be used
282 ++#
283 ++# HAVE_CURSES_H - if <curses.h> is present and should be used
284 ++# HAVE_NCURSESW_H - if <ncursesw.h> should be used
285 ++# HAVE_NCURSES_H - if <ncurses.h> should be used
286 ++# HAVE_NCURSESW_CURSES_H - if <ncursesw/curses.h> should be used
287 ++# HAVE_NCURSES_CURSES_H - if <ncurses/curses.h> should be used
288 ++#
289 ++# (These preprocessor symbols are discussed later in this document.)
290 ++#
291 ++# The following output variables are defined by this macro; they are
292 ++# precious and may be overridden on the ./configure command line:
293 ++#
294 ++# CURSES_LIB - library to add to xxx_LDADD
295 ++# CURSES_CPPFLAGS - include paths to add to xxx_CPPFLAGS
296 ++#
297 ++# Neither the library listed in CURSES_LIB, nor the flags in
298 ++# CURSES_CPPFLAGS are added to LIBS, respectively CPPFLAGS, by default.
299 ++# You need to add both to the appropriate xxx_LDADD/xxx_CPPFLAGS line in
300 ++# your Makefile.am. For example:
301 ++#
302 ++# prog_LDADD = @CURSES_LIB@
303 ++# prog_CPPFLAGS = @CURSES_CPPFLAGS@
304 ++#
305 ++# If CURSES_LIB is set on the configure command line (such as by running
306 ++# "./configure CURSES_LIB=-lmycurses"), then the only header searched for
307 ++# is <curses.h>. If the user needs to specify an alternative path for a
308 ++# library (such as for a non-standard NcurseW), the user should use the
309 ++# LDFLAGS variable.
310 ++#
311 ++# The following shell variables may be defined by this macro:
312 ++#
313 ++# ax_cv_curses - set to "yes" if any Curses library found
314 ++# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present
315 ++# ax_cv_curses_color - set to "yes" if color functions present
316 ++# ax_cv_curses_obsolete - set to "yes" if obsolete features present
317 ++#
318 ++# ax_cv_ncursesw - set to "yes" if NcursesW library found
319 ++# ax_cv_ncurses - set to "yes" if Ncurses library found
320 ++# ax_cv_plaincurses - set to "yes" if plain Curses library found
321 ++# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no"
322 ++#
323 ++# These variables can be used in your configure.ac to determine the level
324 ++# of support you need from the Curses library. For example, if you must
325 ++# have either Ncurses or NcursesW, you could include:
326 ++#
327 ++# AX_WITH_CURSES
328 ++# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
329 ++# AC_MSG_ERROR([requires either NcursesW or Ncurses library])
330 ++# fi
331 ++#
332 ++# If any Curses library will do (but one must be present and must support
333 ++# color), you could use:
334 ++#
335 ++# AX_WITH_CURSES
336 ++# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
337 ++# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
338 ++# fi
339 ++#
340 ++# Certain preprocessor symbols and shell variables defined by this macro
341 ++# can be used to determine various features of the Curses library. In
342 ++# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses
343 ++# library found conforms to the traditional SysV and/or X/Open Base Curses
344 ++# definition. Any working Curses library conforms to this level.
345 ++#
346 ++# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the
347 ++# library supports the X/Open Enhanced Curses definition. In particular,
348 ++# the wide-character types attr_t, cchar_t and wint_t, the functions
349 ++# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES
350 ++# are checked. The Ncurses library does NOT conform to this definition,
351 ++# although NcursesW does.
352 ++#
353 ++# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library
354 ++# supports color functions and macros such as COLOR_PAIR, A_COLOR,
355 ++# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the
356 ++# X/Open Base Curses definition, but are part of the Enhanced set of
357 ++# functions. The Ncurses library DOES support these functions, as does
358 ++# NcursesW.
359 ++#
360 ++# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the
361 ++# library supports certain features present in SysV and BSD Curses but not
362 ++# defined in the X/Open definition. In particular, the functions
363 ++# getattrs(), getcurx() and getmaxx() are checked.
364 ++#
365 ++# To use the HAVE_xxx_H preprocessor symbols, insert the following into
366 ++# your system.h (or equivalent) header file:
367 ++#
368 ++# #if defined HAVE_NCURSESW_CURSES_H
369 ++# # include <ncursesw/curses.h>
370 ++# #elif defined HAVE_NCURSESW_H
371 ++# # include <ncursesw.h>
372 ++# #elif defined HAVE_NCURSES_CURSES_H
373 ++# # include <ncurses/curses.h>
374 ++# #elif defined HAVE_NCURSES_H
375 ++# # include <ncurses.h>
376 ++# #elif defined HAVE_CURSES_H
377 ++# # include <curses.h>
378 ++# #else
379 ++# # error "SysV or X/Open-compatible Curses header file required"
380 ++# #endif
381 ++#
382 ++# For previous users of this macro: you should not need to change anything
383 ++# in your configure.ac or Makefile.am, as the previous (serial 10)
384 ++# semantics are still valid. However, you should update your system.h (or
385 ++# equivalent) header file to the fragment shown above. You are encouraged
386 ++# also to make use of the extended functionality provided by this version
387 ++# of AX_WITH_CURSES, as well as in the additional macros
388 ++# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM.
389 ++#
390 ++# LICENSE
391 ++#
392 ++# Copyright (c) 2009 Mark Pulford <mark@××××××××.au>
393 ++# Copyright (c) 2009 Damian Pietras <daper@×××××.net>
394 ++# Copyright (c) 2012 Reuben Thomas <rrt@××××.org>
395 ++# Copyright (c) 2011 John Zaitseff <J.Zaitseff@×××××××.au>
396 ++#
397 ++# This program is free software: you can redistribute it and/or modify it
398 ++# under the terms of the GNU General Public License as published by the
399 ++# Free Software Foundation, either version 3 of the License, or (at your
400 ++# option) any later version.
401 ++#
402 ++# This program is distributed in the hope that it will be useful, but
403 ++# WITHOUT ANY WARRANTY; without even the implied warranty of
404 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
405 ++# Public License for more details.
406 ++#
407 ++# You should have received a copy of the GNU General Public License along
408 ++# with this program. If not, see <http://www.gnu.org/licenses/>.
409 ++#
410 ++# As a special exception, the respective Autoconf Macro's copyright owner
411 ++# gives unlimited permission to copy, distribute and modify the configure
412 ++# scripts that are the output of Autoconf when processing the Macro. You
413 ++# need not follow the terms of the GNU General Public License when using
414 ++# or distributing such scripts, even though portions of the text of the
415 ++# Macro appear in them. The GNU General Public License (GPL) does govern
416 ++# all other use of the material that constitutes the Autoconf Macro.
417 ++#
418 ++# This special exception to the GPL applies to versions of the Autoconf
419 ++# Macro released by the Autoconf Archive. When you make and distribute a
420 ++# modified version of the Autoconf Macro, you may extend this special
421 ++# exception to the GPL to apply to your modified version as well.
422 ++
423 ++#serial 16
424 ++
425 ++# internal function to factorize common code that is used by both ncurses
426 ++# and ncursesw
427 ++AC_DEFUN([_FIND_CURSES_FLAGS], [
428 ++ AC_MSG_CHECKING([for $1 via pkg-config])
429 ++
430 ++ _PKG_CONFIG([_ax_cv_$1_lib], [libs], [$1])
431 ++ _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1])
432 ++
433 ++ AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[
434 ++ AC_MSG_RESULT([no])
435 ++ # No suitable .pc file found, have to find flags via fallback
436 ++ AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [
437 ++ AS_ECHO()
438 ++ pkg_cv__ax_cv_$1_lib="-l$1"
439 ++ pkg_cv__ax_cv_$1_cppflags="$CURSES_CPPFLAGS"
440 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_lib"
441 ++ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
442 ++
443 ++ AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_lib])
444 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
445 ++ [
446 ++ AC_MSG_RESULT([yes])
447 ++ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_lib])
448 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
449 ++ ax_cv_$1=yes
450 ++ ],[
451 ++ AC_MSG_RESULT([no])
452 ++ m4_if(
453 ++ [$1],[ncursesw],[pkg_cv__ax_cv_$1_lib="$pkg_cv__ax_cv_$1_lib -ltinfow"],
454 ++ [$1],[ncurses],[pkg_cv__ax_cv_$1_lib="$pkg_cv__ax_cv_$1_lib -ltinfo"]
455 ++ )
456 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_lib"
457 ++
458 ++ AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_lib])
459 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
460 ++ ax_cv_$1=yes
461 ++ ],[
462 ++ ax_cv_$1=no
463 ++ ])
464 ++ ])
465 ++ ],[
466 ++ ax_cv_$1=no
467 ++ ])
468 ++ ])
469 ++ ],[
470 ++ AC_MSG_RESULT([yes])
471 ++ # Found .pc file, using its information
472 ++ LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_lib"
473 ++ CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
474 ++ ax_cv_$1=yes
475 ++ ])
476 ++])
477 ++
478 ++AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
479 ++AC_DEFUN([AX_WITH_CURSES], [
480 ++ AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses])
481 ++ AC_ARG_VAR([CURSES_CPPFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw])
482 ++ AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
483 ++ [force the use of Ncurses or NcursesW])],
484 ++ [], [with_ncurses=check])
485 ++ AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw],
486 ++ [do not use NcursesW (wide character support)])],
487 ++ [], [with_ncursesw=check])
488 ++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
489 ++
490 ++ ax_saved_LIBS=$LIBS
491 ++ ax_saved_CPPFLAGS=$CPPFLAGS
492 ++
493 ++ AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
494 ++ [ax_with_plaincurses=no], [ax_with_plaincurses=check])
495 ++
496 ++ ax_cv_curses_which=no
497 ++
498 ++ # Test for NcursesW
499 ++ AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [
500 ++ _FIND_CURSES_FLAGS([ncursesw])
501 ++
502 ++ AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
503 ++ AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
504 ++ ])
505 ++
506 ++ AS_IF([test "x$ax_cv_ncursesw" = xyes], [
507 ++ ax_cv_curses=yes
508 ++ ax_cv_curses_which=ncursesw
509 ++ CURSES_LIB="$pkg_cv__ax_cv_ncursesw_lib"
510 ++ CURSES_CPPFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags"
511 ++ AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
512 ++ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
513 ++
514 ++ AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [
515 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
516 ++ @%:@define _XOPEN_SOURCE_EXTENDED 1
517 ++ @%:@include <ncursesw/curses.h>
518 ++ ]], [[
519 ++ chtype a = A_BOLD;
520 ++ int b = KEY_LEFT;
521 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
522 ++ attr_t d = WA_NORMAL;
523 ++ cchar_t e;
524 ++ wint_t f;
525 ++ int g = getattrs(stdscr);
526 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
527 ++ initscr();
528 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
529 ++ wattr_set(stdscr, d, 0, NULL);
530 ++ wget_wch(stdscr, &f);
531 ++ ]])],
532 ++ [ax_cv_header_ncursesw_curses_h=yes],
533 ++ [ax_cv_header_ncursesw_curses_h=no])
534 ++ ])
535 ++ AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [
536 ++ ax_cv_curses_enhanced=yes
537 ++ ax_cv_curses_color=yes
538 ++ ax_cv_curses_obsolete=yes
539 ++ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
540 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
541 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
542 ++ AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if <ncursesw/curses.h> is present])
543 ++ ])
544 ++
545 ++ AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [
546 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
547 ++ @%:@define _XOPEN_SOURCE_EXTENDED 1
548 ++ @%:@include <ncursesw.h>
549 ++ ]], [[
550 ++ chtype a = A_BOLD;
551 ++ int b = KEY_LEFT;
552 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
553 ++ attr_t d = WA_NORMAL;
554 ++ cchar_t e;
555 ++ wint_t f;
556 ++ int g = getattrs(stdscr);
557 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
558 ++ initscr();
559 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
560 ++ wattr_set(stdscr, d, 0, NULL);
561 ++ wget_wch(stdscr, &f);
562 ++ ]])],
563 ++ [ax_cv_header_ncursesw_h=yes],
564 ++ [ax_cv_header_ncursesw_h=no])
565 ++ ])
566 ++ AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [
567 ++ ax_cv_curses_enhanced=yes
568 ++ ax_cv_curses_color=yes
569 ++ ax_cv_curses_obsolete=yes
570 ++ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
571 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
572 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
573 ++ AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if <ncursesw.h> is present])
574 ++ ])
575 ++
576 ++ AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [
577 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
578 ++ @%:@define _XOPEN_SOURCE_EXTENDED 1
579 ++ @%:@include <ncurses.h>
580 ++ ]], [[
581 ++ chtype a = A_BOLD;
582 ++ int b = KEY_LEFT;
583 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
584 ++ attr_t d = WA_NORMAL;
585 ++ cchar_t e;
586 ++ wint_t f;
587 ++ int g = getattrs(stdscr);
588 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
589 ++ initscr();
590 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
591 ++ wattr_set(stdscr, d, 0, NULL);
592 ++ wget_wch(stdscr, &f);
593 ++ ]])],
594 ++ [ax_cv_header_ncurses_h_with_ncursesw=yes],
595 ++ [ax_cv_header_ncurses_h_with_ncursesw=no])
596 ++ ])
597 ++ AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [
598 ++ ax_cv_curses_enhanced=yes
599 ++ ax_cv_curses_color=yes
600 ++ ax_cv_curses_obsolete=yes
601 ++ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
602 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
603 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
604 ++ AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
605 ++ ])
606 ++
607 ++ AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [
608 ++ AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h])
609 ++ ])
610 ++ ])
611 ++ ])
612 ++ unset pkg_cv__ax_cv_ncursesw_lib
613 ++ unset pkg_cv__ax_cv_ncursesw_cppflags
614 ++
615 ++ # Test for Ncurses
616 ++ AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
617 ++ _FIND_CURSES_FLAGS([ncurses])
618 ++
619 ++ AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
620 ++ AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
621 ++ ])
622 ++
623 ++ AS_IF([test "x$ax_cv_ncurses" = xyes], [
624 ++ ax_cv_curses=yes
625 ++ ax_cv_curses_which=ncurses
626 ++ CURSES_LIB="$pkg_cv__ax_cv_ncurses_lib"
627 ++ CURSES_CPPFLAGS="$pkg_cv__ax_cv_ncurses_cppflags"
628 ++ AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
629 ++ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
630 ++
631 ++ AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [
632 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
633 ++ @%:@include <ncurses/curses.h>
634 ++ ]], [[
635 ++ chtype a = A_BOLD;
636 ++ int b = KEY_LEFT;
637 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
638 ++ int g = getattrs(stdscr);
639 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
640 ++ initscr();
641 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
642 ++ ]])],
643 ++ [ax_cv_header_ncurses_curses_h=yes],
644 ++ [ax_cv_header_ncurses_curses_h=no])
645 ++ ])
646 ++ AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [
647 ++ ax_cv_curses_color=yes
648 ++ ax_cv_curses_obsolete=yes
649 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
650 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
651 ++ AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if <ncurses/curses.h> is present])
652 ++ ])
653 ++
654 ++ AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [
655 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
656 ++ @%:@include <ncurses.h>
657 ++ ]], [[
658 ++ chtype a = A_BOLD;
659 ++ int b = KEY_LEFT;
660 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
661 ++ int g = getattrs(stdscr);
662 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
663 ++ initscr();
664 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
665 ++ ]])],
666 ++ [ax_cv_header_ncurses_h=yes],
667 ++ [ax_cv_header_ncurses_h=no])
668 ++ ])
669 ++ AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [
670 ++ ax_cv_curses_color=yes
671 ++ ax_cv_curses_obsolete=yes
672 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
673 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
674 ++ AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
675 ++ ])
676 ++
677 ++ AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [
678 ++ AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h])
679 ++ ])
680 ++ ])
681 ++ ])
682 ++ unset pkg_cv__ax_cv_ncurses_lib
683 ++ unset pkg_cv__ax_cv_ncurses_cppflags
684 ++
685 ++ # Test for plain Curses (or if CURSES_LIB was set by user)
686 ++ AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
687 ++ AS_IF([test "x$CURSES_LIB" != x], [
688 ++ LIBS="$ax_saved_LIBS $CURSES_LIB"
689 ++ ], [
690 ++ LIBS="$ax_saved_LIBS -lcurses"
691 ++ ])
692 ++
693 ++ AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [
694 ++ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
695 ++ [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no])
696 ++ ])
697 ++
698 ++ AS_IF([test "x$ax_cv_plaincurses" = xyes], [
699 ++ ax_cv_curses=yes
700 ++ ax_cv_curses_which=plaincurses
701 ++ AS_IF([test "x$CURSES_LIB" = x], [
702 ++ CURSES_LIB="-lcurses"
703 ++ ])
704 ++ AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
705 ++
706 ++ # Check for base conformance (and header file)
707 ++
708 ++ AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [
709 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
710 ++ @%:@include <curses.h>
711 ++ ]], [[
712 ++ chtype a = A_BOLD;
713 ++ int b = KEY_LEFT;
714 ++ initscr();
715 ++ ]])],
716 ++ [ax_cv_header_curses_h=yes],
717 ++ [ax_cv_header_curses_h=no])
718 ++ ])
719 ++ AS_IF([test "x$ax_cv_header_curses_h" = xyes], [
720 ++ AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])
721 ++
722 ++ # Check for X/Open Enhanced conformance
723 ++
724 ++ AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [
725 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
726 ++ @%:@define _XOPEN_SOURCE_EXTENDED 1
727 ++ @%:@include <curses.h>
728 ++ @%:@ifndef _XOPEN_CURSES
729 ++ @%:@error "this Curses library is not enhanced"
730 ++ "this Curses library is not enhanced"
731 ++ @%:@endif
732 ++ ]], [[
733 ++ chtype a = A_BOLD;
734 ++ int b = KEY_LEFT;
735 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
736 ++ attr_t d = WA_NORMAL;
737 ++ cchar_t e;
738 ++ wint_t f;
739 ++ initscr();
740 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
741 ++ wattr_set(stdscr, d, 0, NULL);
742 ++ wget_wch(stdscr, &f);
743 ++ ]])],
744 ++ [ax_cv_plaincurses_enhanced=yes],
745 ++ [ax_cv_plaincurses_enhanced=no])
746 ++ ])
747 ++ AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [
748 ++ ax_cv_curses_enhanced=yes
749 ++ ax_cv_curses_color=yes
750 ++ AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
751 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
752 ++ ])
753 ++
754 ++ # Check for color functions
755 ++
756 ++ AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [
757 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
758 ++ @%:@define _XOPEN_SOURCE_EXTENDED 1
759 ++ @%:@include <curses.h>
760 ++ ]], [[
761 ++ chtype a = A_BOLD;
762 ++ int b = KEY_LEFT;
763 ++ chtype c = COLOR_PAIR(1) & A_COLOR;
764 ++ initscr();
765 ++ init_pair(1, COLOR_WHITE, COLOR_RED);
766 ++ ]])],
767 ++ [ax_cv_plaincurses_color=yes],
768 ++ [ax_cv_plaincurses_color=no])
769 ++ ])
770 ++ AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [
771 ++ ax_cv_curses_color=yes
772 ++ AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
773 ++ ])
774 ++
775 ++ # Check for obsolete functions
776 ++
777 ++ AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [
778 ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
779 ++ @%:@include <curses.h>
780 ++ ]], [[
781 ++ chtype a = A_BOLD;
782 ++ int b = KEY_LEFT;
783 ++ int g = getattrs(stdscr);
784 ++ int h = getcurx(stdscr) + getmaxx(stdscr);
785 ++ initscr();
786 ++ ]])],
787 ++ [ax_cv_plaincurses_obsolete=yes],
788 ++ [ax_cv_plaincurses_obsolete=no])
789 ++ ])
790 ++ AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [
791 ++ ax_cv_curses_obsolete=yes
792 ++ AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
793 ++ ])
794 ++ ])
795 ++
796 ++ AS_IF([test "x$ax_cv_header_curses_h" = xno], [
797 ++ AC_MSG_WARN([could not find a working curses.h])
798 ++ ])
799 ++ ])
800 ++ ])
801 ++
802 ++ AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no])
803 ++ AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no])
804 ++ AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no])
805 ++ AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
806 ++
807 ++ LIBS=$ax_saved_LIBS
808 ++ CPPFLAGS=$ax_saved_CPPFLAGS
809 ++
810 ++ unset ax_saved_LIBS
811 ++ unset ax_saved_CPPFLAGS
812 ++])dnl
813 +--- samtools-1.3/m4/ax_with_htslib.m4
814 ++++ samtools-1.3/m4/ax_with_htslib.m4
815 +@@ -0,0 +1,140 @@
816 ++# ===========================================================================
817 ++# http://www.gnu.org/software/autoconf-archive/ax_with_htslib.html
818 ++# ===========================================================================
819 ++#
820 ++# SYNOPSIS
821 ++#
822 ++# AX_WITH_HTSLIB
823 ++#
824 ++# DESCRIPTION
825 ++#
826 ++# This macro checks whether HTSlib <http://www.htslib.org/> is installed
827 ++# or nearby, and adds a --with-htslib=DIR option to the configure script
828 ++# for specifying the location. It locates either an installation prefix
829 ++# (with 'include' and 'lib' subdirectories) or an HTSlib source tree, as
830 ++# HTSlib is fast-moving and users may wish to use an in-development tree.
831 ++#
832 ++# Different checks occur depending on the --with-htslib argument given:
833 ++#
834 ++# With --with-htslib=DIR, checks whether DIR is a source tree or contains
835 ++# a working installation.
836 ++# By default, searches for a source tree (with a name matching htslib*)
837 ++# within or alongside $srcdir. Produces AC_MSG_ERROR if there are
838 ++# several equally-likely candidates. If there are none, checks for
839 ++# a working default installation.
840 ++# With --with-htslib=system, checks for a working default installation.
841 ++#
842 ++# If a source tree is found or specified, it is added to AC_CONFIG_SUBDIRS
843 ++# (which unfortunately may cause a "you should use literals" warning when
844 ++# autoconf is run).
845 ++#
846 ++# The following output variables are set by this macro:
847 ++#
848 ++# HTSDIR Directory containing HTSlib source tree
849 ++# HTSLIB_CPPFLAGS Preprocessor flags for compiling with HTSlib
850 ++# HTSLIB_LDFLAGS Linker flags for linking with HTSlib
851 ++#
852 ++# The following shell variables may be defined:
853 ++#
854 ++# ax_cv_htslib Set to "yes" if HTSlib was found
855 ++# ax_cv_htslib_which Set to "source", "install", or "none"
856 ++#
857 ++# LICENSE
858 ++#
859 ++# Copyright (C) 2015 Genome Research Ltd
860 ++#
861 ++# Copying and distribution of this file, with or without modification, are
862 ++# permitted in any medium without royalty provided the copyright notice
863 ++# and this notice are preserved. This file is offered as-is, without any
864 ++# warranty.
865 ++
866 ++#serial 1
867 ++
868 ++AC_DEFUN([AX_WITH_HTSLIB],
869 ++[AC_ARG_WITH([htslib],
870 ++ [AS_HELP_STRING([--with-htslib=DIR],
871 ++ [use the HTSlib source tree or installation in DIR])
872 ++dnl Not indented, to avoid extra whitespace outwith AS_HELP_STRING()
873 ++AS_HELP_STRING([--with-htslib=system],
874 ++ [use only a system HTSlib installation])],
875 ++ [], [with_htslib=search])
876 ++
877 ++case $with_htslib in
878 ++yes|search)
879 ++ AC_MSG_CHECKING([location of HTSlib source tree])
880 ++ case $srcdir in
881 ++ .) srcp= ;;
882 ++ *) srcp=$srcdir/ ;;
883 ++ esac
884 ++ found=
885 ++ for dir in ${srcp}htslib* -- ${srcp}../htslib -- ${srcp}../htslib*
886 ++ do
887 ++ if test "$dir" = "--"; then
888 ++ test -n "$found" && break
889 ++ elif test -f "$dir/hts.c" && test -f "$dir/htslib/hts.h"; then
890 ++ found="${found}1"
891 ++ HTSDIR=$dir
892 ++ fi
893 ++ done
894 ++ if test -z "$found"; then
895 ++ AC_MSG_RESULT([none found])
896 ++ ax_cv_htslib_which=system
897 ++ elif test "$found" = 1; then
898 ++ AC_MSG_RESULT([$HTSDIR])
899 ++ ax_cv_htslib_which=source
900 ++ else
901 ++ AC_MSG_RESULT([several directories found])
902 ++ AC_MSG_ERROR([use --with-htslib=DIR to select which HTSlib to use])
903 ++ fi
904 ++ ;;
905 ++no) ax_cv_htslib_which=none ;;
906 ++system) ax_cv_htslib_which=system ;;
907 ++*)
908 ++ HTSDIR=$with_htslib
909 ++ if test -f "$HTSDIR/hts.c" && test -f "$HTSDIR/htslib/hts.h"; then
910 ++ ax_cv_htslib_which=source
911 ++ else
912 ++ ax_cv_htslib_which=install
913 ++ fi
914 ++ ;;
915 ++esac
916 ++
917 ++case $ax_cv_htslib_which in
918 ++source)
919 ++ ax_cv_htslib=yes
920 ++ HTSLIB_CPPFLAGS="-I$HTSDIR"
921 ++ HTSLIB_LDFLAGS="-L$HTSDIR"
922 ++ # We can't use a literal, because $HTSDIR is user-provided and variable
923 ++ AC_CONFIG_SUBDIRS($HTSDIR)
924 ++ ;;
925 ++system)
926 ++ AC_CHECK_HEADER([htslib/sam.h],
927 ++ [AC_CHECK_LIB(hts, hts_version, [ax_cv_htslib=yes], [ax_cv_htslib=no])],
928 ++ [ax_cv_htslib=no], [;])
929 ++ ax_cv_htslib_which=install
930 ++ HTSDIR=
931 ++ HTSLIB_CPPFLAGS=
932 ++ HTSLIB_LDFLAGS=
933 ++ ;;
934 ++install)
935 ++ ax_saved_CPPFLAGS=$CPPFLAGS
936 ++ ax_saved_LDFLAGS=$LDFLAGS
937 ++ HTSLIB_CPPFLAGS="-I$HTSDIR/include"
938 ++ HTSLIB_LDFLAGS="-L$HTSDIR/lib"
939 ++ CPPFLAGS="$CPPFLAGS $HTSLIB_CPPFLAGS"
940 ++ LDFLAGS="$LDFLAGS $HTSLIB_LDFLAGS"
941 ++ AC_CHECK_HEADER([htslib/sam.h],
942 ++ [AC_CHECK_LIB(hts, hts_version, [ax_cv_htslib=yes], [ax_cv_htslib=no])],
943 ++ [ax_cv_htslib=no], [;])
944 ++ HTSDIR=
945 ++ CPPFLAGS=$ax_saved_CPPFLAGS
946 ++ LDFLAGS=$ax_saved_LDFLAGS
947 ++ ;;
948 ++none)
949 ++ ax_cv_htslib=no
950 ++ ;;
951 ++esac
952 ++
953 ++AC_SUBST([HTSDIR])
954 ++AC_SUBST([HTSLIB_CPPFLAGS])
955 ++AC_SUBST([HTSLIB_LDFLAGS])])
956
957 diff --git a/sci-biology/samtools/samtools-1.3.ebuild b/sci-biology/samtools/samtools-1.3.ebuild
958 new file mode 100644
959 index 0000000..ec510ec
960 --- /dev/null
961 +++ b/sci-biology/samtools/samtools-1.3.ebuild
962 @@ -0,0 +1,86 @@
963 +# Copyright 1999-2016 Gentoo Foundation
964 +# Distributed under the terms of the GNU General Public License v2
965 +# $Id$
966 +
967 +EAPI=6
968 +
969 +PYTHON_COMPAT=( python2_7 )
970 +
971 +inherit autotools python-r1 toolchain-funcs
972 +
973 +DESCRIPTION="Utilities for analysing and manipulating the SAM/BAM alignment formats"
974 +HOMEPAGE="http://www.htslib.org/"
975 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
976 +
977 +LICENSE="MIT"
978 +SLOT="0"
979 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos"
980 +IUSE="examples"
981 +
982 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
983 +
984 +RDEPEND="sys-libs/ncurses:0=
985 + >=sci-libs/htslib-${PV}
986 + dev-lang/lua:0
987 + dev-lang/perl"
988 +DEPEND="${RDEPEND}
989 + virtual/pkgconfig"
990 +
991 +PATCHES=(
992 + "${FILESDIR}/${P}-buildsystem.patch"
993 + "${FILESDIR}/${P}-ncurses.patch"
994 +)
995 +
996 +src_prepare() {
997 + default
998 +
999 + # unbundle libs
1000 + find htslib-* -delete || die
1001 +
1002 + sed -i -e 's~/software/bin/python~/usr/bin/env python~' "${S}"/misc/varfilter.py || die
1003 + sed -i -e '/htslib.mk/d' -i Makefile || die
1004 +
1005 + tc-export CC AR
1006 +
1007 + rm -f aclocal.m4 || die
1008 + eautoreconf
1009 +}
1010 +
1011 +src_compile() {
1012 + local mymakeargs=(
1013 + LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
1014 + HTSDIR="${EPREFIX}/usr/include"
1015 + HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
1016 + BAMLIB="libbam.so"
1017 + libdir=/usr/$(get_libdir)
1018 + )
1019 + emake "${mymakeargs[@]}"
1020 +}
1021 +
1022 +src_test() {
1023 + local mymakeargs=(
1024 + LIBCURSES="$($(tc-getPKG_CONFIG) --libs ncurses)"
1025 + HTSDIR="${EPREFIX}/usr/include"
1026 + HTSLIB=$($(tc-getPKG_CONFIG) --libs htslib)
1027 + BAMLIB="libbam.so"
1028 + )
1029 + LD_LIBRARY_PATH="${S}" emake "${mymakeargs[@]}" test
1030 +}
1031 +
1032 +src_install() {
1033 + dobin samtools $(find misc -type f -executable)
1034 +
1035 + python_replicate_script "${ED}"/usr/bin/varfilter.py
1036 + dolib.so libbam.so*
1037 +
1038 + insinto /usr/include/bam
1039 + doins *.h
1040 +
1041 + doman ${PN}.1
1042 + dodoc AUTHORS NEWS README
1043 +
1044 + if use examples; then
1045 + insinto /usr/share/${PN}
1046 + doins -r examples
1047 + fi
1048 +}