From owner-svn-ports-head@freebsd.org Fri Dec 25 01:31:12 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DF62A51185; Fri, 25 Dec 2015 01:31:12 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEF6A112D; Fri, 25 Dec 2015 01:31:11 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBP1VBjY085478; Fri, 25 Dec 2015 01:31:11 GMT (envelope-from junovitch@FreeBSD.org) Received: (from junovitch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBP1V9DX085460; Fri, 25 Dec 2015 01:31:09 GMT (envelope-from junovitch@FreeBSD.org) Message-Id: <201512250131.tBP1V9DX085460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: junovitch set sender to junovitch@FreeBSD.org using -f From: Jason Unovitch Date: Fri, 25 Dec 2015 01:31:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r404398 - in head/biology: bcftools bcftools/files htslib htslib/files samtools samtools/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 01:31:12 -0000 Author: junovitch Date: Fri Dec 25 01:31:09 2015 New Revision: 404398 URL: https://svnweb.freebsd.org/changeset/ports/404398 Log: biology/{bcftools,htslib,samtools}: update 1.2.x -> 1.3 - Update ports to 1.3 and set BUILD_DEPENDS of dependent ports to require version 1.3 of htslib. - Add CURL option to htslib - Add TEST_TARGET with perl and bash dependencies for testing - Tidy up spacing and pkg-message's PR: 205524 PR: 205525 PR: 205526 Submitted by: cartwright@asu.edu (maintainer) Added: head/biology/bcftools/files/patch-test_test.pl (contents, props changed) head/biology/htslib/files/patch-hfile__libcurl.c (contents, props changed) head/biology/samtools/files/ax_with_curses.m4 (contents, props changed) head/biology/samtools/files/ax_with_htslib.m4 (contents, props changed) head/biology/samtools/files/patch-configure.ac (contents, props changed) head/biology/samtools/files/patch-dict.c (contents, props changed) head/biology/samtools/files/patch-test_test.pl (contents, props changed) Deleted: head/biology/bcftools/files/patch-plugins_fixploidy.mk head/biology/bcftools/files/patch-plugins_vcf2sex.mk head/biology/htslib/files/patch-cram_cram__io.c Modified: head/biology/bcftools/Makefile head/biology/bcftools/distinfo head/biology/bcftools/files/patch-Makefile head/biology/bcftools/files/patch-prob1.c head/biology/bcftools/files/pkg-message.in head/biology/bcftools/pkg-plist head/biology/htslib/Makefile head/biology/htslib/distinfo head/biology/htslib/files/patch-Makefile head/biology/htslib/files/patch-configure.ac head/biology/htslib/pkg-plist head/biology/samtools/Makefile head/biology/samtools/distinfo head/biology/samtools/files/patch-Makefile head/biology/samtools/files/patch-errmod.c head/biology/samtools/files/pkg-message.in head/biology/samtools/pkg-plist Modified: head/biology/bcftools/Makefile ============================================================================== --- head/biology/bcftools/Makefile Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/Makefile Fri Dec 25 01:31:09 2015 (r404398) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= bcftools -PORTVERSION= 1.2 +PORTVERSION= 1.3 CATEGORIES= biology MAINTAINER= cartwright@asu.edu @@ -11,15 +11,17 @@ COMMENT= Tools for manipulating next-gen LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -BUILD_DEPENDS= htslib>=1.2:${PORTSDIR}/biology/htslib +BUILD_DEPENDS= htslib>=1.3:${PORTSDIR}/biology/htslib LIB_DEPENDS= libhts.so:${PORTSDIR}/biology/htslib +TEST_DEPENDS= bash:${PORTSDIR}/shells/bash USE_GITHUB= yes GH_ACCOUNT= samtools -USES= gmake shebangfix +USES= gmake perl5 shebangfix +USE_PERL5= test SUB_FILES= pkg-message -SHEBANG_FILES= vcfutils.pl +SHEBANG_FILES= vcfutils.pl plot-vcfstats plugins/color-chrs.pl test/test.pl OPTIONS_DEFINE= GPL GPL_DESC= Enable modules that rely on GPL code @@ -33,10 +35,10 @@ CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \ - INSTALL_DATA="${INSTALL_DATA}" \ - INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ - INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ - INSTALL_DIR="${MKDIR}" + INSTALL_DATA="${INSTALL_DATA}" \ + INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ + INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ + INSTALL_DIR="${MKDIR}" .if ${PORT_OPTIONS:MGPL} MAKE_ENV+= USE_GPL=1 @@ -45,4 +47,6 @@ LICENSE= GPLv3 PLIST_SUB= PORTVERSION="${PORTVERSION}" +TEST_TARGET= test + .include Modified: head/biology/bcftools/distinfo ============================================================================== --- head/biology/bcftools/distinfo Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/distinfo Fri Dec 25 01:31:09 2015 (r404398) @@ -1,2 +1,2 @@ -SHA256 (samtools-bcftools-1.2_GH0.tar.gz) = 90ccd7dccfb0b2848b71f32fff073c420260e857b7feeb89c1fb4bfaba49bfba -SIZE (samtools-bcftools-1.2_GH0.tar.gz) = 511625 +SHA256 (samtools-bcftools-1.3_GH0.tar.gz) = 3f4d4bf68637070cb7dbb5d5619ece7e3315727e651eab751d849085439b11d8 +SIZE (samtools-bcftools-1.3_GH0.tar.gz) = 943041 Modified: head/biology/bcftools/files/patch-Makefile ============================================================================== --- head/biology/bcftools/files/patch-Makefile Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/files/patch-Makefile Fri Dec 25 01:31:09 2015 (r404398) @@ -1,84 +1,78 @@ ---- Makefile.orig 2015-02-02 15:40:17 UTC +--- Makefile.orig 2015-12-15 21:42:34 UTC +++ Makefile -@@ -29,14 +29,13 @@ TEST_PROG= test/test-rbuf +@@ -29,16 +29,15 @@ TEST_PROG= test/test-rbuf all: $(PROG) $(TEST_PROG) # Adjust $(HTSDIR) to point to your top-level htslib directory -HTSDIR = ../htslib -include $(HTSDIR)/htslib.mk -HTSLIB = $(HTSDIR)/libhts.a +-BGZIP = $(HTSDIR)/bgzip +-TABIX = $(HTSDIR)/tabix +HTSDIR = $(prefix)/include +HTSLIB = -lhts - BGZIP = $(HTSDIR)/bgzip - TABIX = $(HTSDIR)/tabix ++BGZIP = $(HTSDIR)/../bin/bgzip ++TABIX = $(HTSDIR)/../bin/tabix -CC = gcc +-CPPFLAGS = -CFLAGS = -g -Wall -Wc++-compat -O2 -+CC ?= cc -+CFLAGS += -Wall - DFLAGS = +-LDFLAGS = ++CC ?= cc ++CPPFLAGS += ++CFLAGS += -Wall ++LDFLAGS += + LIBS = + OBJS = main.o vcfindex.o tabix.o \ - vcfstats.o vcfisec.o vcfmerge.o vcfquery.o vcffilter.o filter.o vcfsom.o \ -@@ -52,22 +51,15 @@ INCLUDES = -I. -I$(HTSDIR) +@@ -57,26 +56,20 @@ GSL_LIBS = ifdef USE_GPL - CFLAGS += -DUSE_GPL - OBJS += polysomy.o -- LDLIBS = -lgsl -lcblas -+ LDLIBS += -lgsl -lgslcblas + EXTRA_CPPFLAGS += -DUSE_GPL + OBJS += polysomy.o peakfit.o +- GSL_LIBS = -lgsl -lcblas ++ GSL_LIBS = -lgsl -lgslcblas endif -prefix = /usr/local +prefix = ${STAGEDIR}${PREFIX} exec_prefix = $(prefix) bindir = $(exec_prefix)/bin + libdir = $(exec_prefix)/lib + libexecdir = $(exec_prefix)/libexec -mandir = $(prefix)/share/man +mandir = $(prefix)/man man1dir = $(mandir)/man1 + plugindir = $(libexecdir)/bcftools + pluginpath = $(plugindir) + -MKDIR_P = mkdir -p -INSTALL = install -p -INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) -m 644 -INSTALL_DIR = $(MKDIR_P) -m 755 - -- + MISC_PROGRAMS = plot-vcfstats vcfutils.pl plugins/color-chrs.pl + all:$(PROG) plugins +@@ -181,7 +174,7 @@ test/test-rbuf: test/test-rbuf.o + $(CC) $(LDFLAGS) -o $@ $^ -lm $(LIBS) - # See htslib/Makefile -@@ -102,8 +94,8 @@ PLUGINC = $(foreach dir, plugins, $(wild - PLUGINS = $(PLUGINC:.c=.so) - PLUGINM = $(PLUGINC:.c=.mk) - --%.so: %.c version.h version.c $(HTSDIR)/libhts.so -- $(CC) $(CFLAGS) $(INCLUDES) -fPIC -shared -o $@ version.c $< -L$(HTSDIR) -lhts -+%.so: %.c version.h version.c -+ $(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDES) -fPIC -shared -o $@ version.c $< -lhts - - -include $(PLUGINM) - -@@ -156,10 +148,10 @@ version.o: version.h version.c - test/test-rbuf.o: test/test-rbuf.c rbuf.h - - test/test-rbuf: test/test-rbuf.o -- $(CC) $(CFLAGS) -o $@ -lm -ldl $< -+ $(CC) $(CFLAGS) -o $@ -lm $< - --bcftools: $(HTSLIB) $(OBJS) -- $(CC) $(CFLAGS) -o $@ $(OBJS) $(HTSLIB) -lpthread -lz -lm -ldl $(LDLIBS) -+bcftools: $(OBJS) -+ $(CC) -pthread $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(HTSLIB) -lz -lm $(LDLIBS) + bcftools: $(HTSLIB) $(OBJS) +- $(CC) -rdynamic $(LDFLAGS) -o $@ $(OBJS) $(HTSLIB) -lpthread -lz -lm -ldl $(GSL_LIBS) $(LIBS) ++ $(CC) -rdynamic $(LDFLAGS) -o $@ $(OBJS) $(HTSLIB) -pthread -lz -lm $(GSL_LIBS) $(LIBS) doc/bcftools.1: doc/bcftools.txt cd doc && a2x -adate="$(DOC_DATE)" -aversion=$(DOC_VERSION) --doctype manpage --format manpage bcftools.txt -@@ -170,8 +162,9 @@ doc/bcftools.html: doc/bcftools.txt - docs: doc/bcftools.1 doc/bcftools.html - - install: $(PROG) doc/bcftools.1 -- $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) -- $(INSTALL_PROGRAM) $(PROG) plot-vcfstats vcfutils.pl $(DESTDIR)$(bindir) -+ $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)/samtools_misc $(DESTDIR)$(man1dir) +@@ -198,8 +191,9 @@ docs: doc/bcftools.1 doc/bcftools.html + # Since there is no make dependency, bcftools.1 can be out-of-date and + # make docs can be run to update if asciidoc is available + install: $(PROG) +- $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(plugindir) +- $(INSTALL_PROGRAM) $(PROG) $(MISC_PROGRAMS) $(DESTDIR)$(bindir) ++ $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)/samtools_misc $(DESTDIR)$(man1dir) $(DESTDIR)$(plugindir) + $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir) -+ $(INSTALL_SCRIPT) plot-vcfstats vcfutils.pl $(DESTDIR)$(bindir)/samtools_misc ++ $(INSTALL_SCRIPT) $(MISC_PROGRAMS) $(DESTDIR)$(bindir)/samtools_misc $(INSTALL_DATA) doc/bcftools.1 $(DESTDIR)$(man1dir) + $(INSTALL_PROGRAM) plugins/*.so $(DESTDIR)$(plugindir) - clean: testclean clean-plugins Modified: head/biology/bcftools/files/patch-prob1.c ============================================================================== --- head/biology/bcftools/files/patch-prob1.c Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/files/patch-prob1.c Fri Dec 25 01:31:09 2015 (r404398) @@ -1,15 +1,13 @@ ---- prob1.c.orig 2015-04-28 01:28:23 UTC +--- prob1.c.orig 2015-12-15 21:42:34 UTC +++ prob1.c -@@ -33,6 +33,14 @@ THE SOFTWARE. */ +@@ -33,6 +33,12 @@ THE SOFTWARE. */ #include #include "prob1.h" +#include -+#ifdef __FreeBSD__ -+# if __FreeBSD_version < 1000034 -+# define logl(x) log(x) -+# define expl(x) exp(x) -+# endif ++#if defined(__FreeBSD__) && (__FreeBSD_version < 1000034) ++# define logl(x) log(x) ++# define expl(x) exp(x) +#endif + // #include "kstring.h" Added: head/biology/bcftools/files/patch-test_test.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/bcftools/files/patch-test_test.pl Fri Dec 25 01:31:09 2015 (r404398) @@ -0,0 +1,29 @@ +--- test/test.pl.orig 2015-12-22 22:45:13 UTC ++++ test/test.pl +@@ -290,7 +290,7 @@ sub _cmd + else + { + # child +- exec('/bin/bash', '-o','pipefail','-c', $cmd) or error("Cannot execute the command [/bin/sh -o pipefail -c $cmd]: $!"); ++ exec('/usr/local/bin/bash', '-o','pipefail','-c', $cmd) or error("Cannot execute the command [/usr/local/bin/sh -o pipefail -c $cmd]: $!"); + } + return ($? >> 8, join('',@out)); + } +@@ -657,7 +657,7 @@ sub test_usage + my $command = $args{cmd}; + my $commandpath = $$opts{bin}."/".$command; + my ($ret,$out) = _cmd("$commandpath $args{redirection} 2>&1"); +- if ( $out =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath: $out"); return; } ++ if ( $out =~ m/\/usr\/local\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath: $out"); return; } + + my @sections = ($out =~ m/(^[A-Za-z]+.*?)(?:(?=^[A-Za-z]+:)|\z)/msg); + +@@ -708,7 +708,7 @@ sub test_usage_subcommand + my $subcommand = $args{subcmd}; + my $commandpath = $$opts{bin}."/".$command; + my ($ret,$out) = _cmd("$commandpath $subcommand $args{redirection} 2>&1"); +- if ( $out =~ m/\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath $subcommand: $out"); return; } ++ if ( $out =~ m/\/usr\/local\/bin\/bash.*no.*such/i ) { failed($opts,$test,"could not run $commandpath $subcommand: $out"); return; } + + my @sections = ($out =~ m/(^[A-Za-z]+.*?)(?:(?=^[A-Za-z]+:)|\z)/msg); + Modified: head/biology/bcftools/files/pkg-message.in ============================================================================== --- head/biology/bcftools/files/pkg-message.in Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/files/pkg-message.in Fri Dec 25 01:31:09 2015 (r404398) @@ -1,2 +1,7 @@ +The miscellaneous tools included with Bcftools have been installed to +%%PREFIX%%/bin/samtools_misc -Add %%PREFIX%%/bin/samtools_misc to your path to use miscellaneous tools. +Add that directory to your path if you want to use these tools. + +Some of these tools depend on Perl5, and it will need to be installed to +use them. Modified: head/biology/bcftools/pkg-plist ============================================================================== --- head/biology/bcftools/pkg-plist Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/bcftools/pkg-plist Fri Dec 25 01:31:09 2015 (r404398) @@ -1,4 +1,18 @@ bin/bcftools +bin/samtools_misc/color-chrs.pl bin/samtools_misc/plot-vcfstats bin/samtools_misc/vcfutils.pl +libexec/bcftools/color-chrs.so +libexec/bcftools/counts.so +libexec/bcftools/dosage.so +libexec/bcftools/fill-AN-AC.so +libexec/bcftools/fill-tags.so +libexec/bcftools/fixploidy.so +libexec/bcftools/frameshifts.so +libexec/bcftools/impute-info.so +libexec/bcftools/mendelian.so +libexec/bcftools/missing2ref.so +libexec/bcftools/setGT.so +libexec/bcftools/tag2tag.so +libexec/bcftools/vcf2sex.so man/man1/bcftools.1.gz Modified: head/biology/htslib/Makefile ============================================================================== --- head/biology/htslib/Makefile Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/htslib/Makefile Fri Dec 25 01:31:09 2015 (r404398) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= htslib -PORTVERSION= 1.2.1 +PORTVERSION= 1.3 CATEGORIES= biology devel MAINTAINER= cartwright@asu.edu @@ -12,13 +12,26 @@ LICENSE= BSD3CLAUSE MIT LICENSE_COMB= multi LICENSE_FILE= ${WRKSRC}/LICENSE +TEST_DEPENDS= bash:${PORTSDIR}/shells/bash + USE_GITHUB= yes GH_ACCOUNT= samtools -USES= gmake +USES= autoreconf gmake perl5 shebangfix +USE_PERL5= test USE_LDCONFIG= yes -USE_AUTOTOOLS= autoconf -GNU_CONFIGURE=yes +GNU_CONFIGURE= yes +SHEBANG_FILES= test/compare_sam.pl test/test.pl test/test_view.pl + +OPTIONS_DEFINE= CURL +OPTIONS_DEFAULT= CURL + +CURL_DESC= Use libcurl for network file access (HTTPS and S3 support). +CURL_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl +CURL_CONFIGURE_ENABLE= libcurl + +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \ INSTALL_DATA="${INSTALL_DATA}" \ @@ -27,6 +40,8 @@ MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \ PLIST_SUB= PORTVERSION="${PORTVERSION}" +TEST_TARGET= test + post-patch: @${REINPLACE_CMD} -e 's|@PORTVERSION@|${PORTVERSION}|g' ${WRKSRC}/configure.ac Modified: head/biology/htslib/distinfo ============================================================================== --- head/biology/htslib/distinfo Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/htslib/distinfo Fri Dec 25 01:31:09 2015 (r404398) @@ -1,2 +1,2 @@ -SHA256 (samtools-htslib-1.2.1_GH0.tar.gz) = 4f67f0fc73ae86f3ed4336d8d8f6da3c12066e9cb5f142b685622dd6b8f9ae42 -SIZE (samtools-htslib-1.2.1_GH0.tar.gz) = 997625 +SHA256 (samtools-htslib-1.3_GH0.tar.gz) = 291a54090df3bc367b509890e1cfa34d53b1ee9be42c5fa6c2b1e2ec8f8b13af +SIZE (samtools-htslib-1.3_GH0.tar.gz) = 1042953 Modified: head/biology/htslib/files/patch-Makefile ============================================================================== --- head/biology/htslib/files/patch-Makefile Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/htslib/files/patch-Makefile Fri Dec 25 01:31:09 2015 (r404398) @@ -1,6 +1,6 @@ ---- Makefile.orig 2015-02-03 16:22:23 UTC +--- Makefile.orig 2015-12-15 16:34:33 UTC +++ Makefile -@@ -22,16 +22,9 @@ +@@ -22,16 +22,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. @@ -8,19 +8,18 @@ -AR = ar -RANLIB = ranlib - --CPPFLAGS = -I. -+CPPFLAGS += -I. - # TODO: probably update cram code to make it compile cleanly with -Wc++-compat +-CPPFLAGS = +-# TODO: probably update cram code to make it compile cleanly with -Wc++-compat -CFLAGS = -g -Wall -O2 EXTRA_CFLAGS_PIC = -fpic -LDFLAGS = --LDLIBS = +-LIBS = # For now these don't work too well as samtools also needs to know to # add -lbz2 and -llzma if linking against the static libhts.a library. -@@ -57,16 +50,10 @@ bindir = $(exec_prefix)/bin - includedir = $(prefix)/include +@@ -58,16 +49,10 @@ includedir = $(prefix)/include libdir = $(exec_prefix)/lib + libexecdir = $(exec_prefix)/libexec datarootdir = $(prefix)/share -mandir = $(datarootdir)/man +mandir = $(prefix)/man @@ -35,18 +34,18 @@ -INSTALL_DIR = $(MKDIR_P) -m 755 +pkgconfigdir= $(exec_prefix)/libdata/pkgconfig - BUILT_PROGRAMS = \ - bgzip \ -@@ -82,7 +69,7 @@ BUILT_TEST_PROGRAMS = \ + # Set by config.mk if plugins are enabled + plugindir = +@@ -86,7 +71,7 @@ BUILT_TEST_PROGRAMS = \ test/test-vcf-api \ test/test-vcf-sweep --all: lib-static lib-shared $(BUILT_PROGRAMS) $(BUILT_TEST_PROGRAMS) -+all: lib-static lib-shared $(BUILT_PROGRAMS) +-all: lib-static lib-shared $(BUILT_PROGRAMS) plugins $(BUILT_TEST_PROGRAMS) ++all: lib-static lib-shared $(BUILT_PROGRAMS) plugins HTSPREFIX = include htslib_vars.mk -@@ -332,7 +319,7 @@ installdirs: +@@ -361,7 +346,7 @@ installdirs: # and libhts.so.NN (used by client executables at runtime). install-so: libhts.so installdirs Modified: head/biology/htslib/files/patch-configure.ac ============================================================================== --- head/biology/htslib/files/patch-configure.ac Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/htslib/files/patch-configure.ac Fri Dec 25 01:31:09 2015 (r404398) @@ -1,11 +1,11 @@ ---- configure.ac.orig 2015-02-03 16:22:23 UTC +--- configure.ac.orig 2015-12-15 16:34:33 UTC +++ configure.ac @@ -23,7 +23,7 @@ # DEALINGS IN THE SOFTWARE. dnl Process this file with autoconf to produce a configure script -AC_INIT([HTSlib], m4_esyscmd_s([make print-version]), -+AC_INIT([HTSlib], [@PORTVERSION@], ++AC_INIT([HTSlib], [1.3], [samtools-help@lists.sourceforge.net], [], [http://www.htslib.org/]) AC_PREREQ(2.63) dnl This version introduced 4-argument AC_CHECK_HEADER AC_CONFIG_SRCDIR(hts.c) Added: head/biology/htslib/files/patch-hfile__libcurl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/htslib/files/patch-hfile__libcurl.c Fri Dec 25 01:31:09 2015 (r404398) @@ -0,0 +1,14 @@ +--- hfile_libcurl.c.orig 2015-12-22 22:35:42 UTC ++++ hfile_libcurl.c +@@ -39,6 +39,11 @@ DEALINGS IN THE SOFTWARE. */ + + #include + ++#include ++#if defined(__FreeBSD__) && (__FreeBSD_version < 1000033) && !defined(ENOTRECOVERABLE) ++# define ENOTRECOVERABLE EIO ++#endif ++ + typedef struct { + hFILE base; + CURL *easy; Modified: head/biology/htslib/pkg-plist ============================================================================== --- head/biology/htslib/pkg-plist Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/htslib/pkg-plist Fri Dec 25 01:31:09 2015 (r404398) @@ -2,10 +2,12 @@ bin/bgzip bin/htsfile bin/tabix include/htslib/bgzf.h +include/htslib/cram.h include/htslib/faidx.h include/htslib/hfile.h include/htslib/hts.h include/htslib/hts_defs.h +include/htslib/kbitset.h include/htslib/kfunc.h include/htslib/khash.h include/htslib/khash_str2int.h Modified: head/biology/samtools/Makefile ============================================================================== --- head/biology/samtools/Makefile Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/samtools/Makefile Fri Dec 25 01:31:09 2015 (r404398) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= samtools -PORTVERSION= 1.2 +PORTVERSION= 1.3 CATEGORIES= biology MAINTAINER= cartwright@asu.edu @@ -11,13 +11,17 @@ COMMENT= Tools for manipulating next-gen LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -BUILD_DEPENDS= htslib>=1.2:${PORTSDIR}/biology/htslib +BUILD_DEPENDS= htslib>=1.3:${PORTSDIR}/biology/htslib LIB_DEPENDS= libhts.so:${PORTSDIR}/biology/htslib +TEST_DEPENDS= bash:${PORTSDIR}/shells/bash USE_GITHUB= yes -USES= gmake +USES= autoreconf gmake perl5 shebangfix +USE_PERL5= test +GNU_CONFIGURE= yes SUB_FILES= pkg-message +SHEBANG_FILES= misc/*.pl misc/plot-bamstats test/test.pl CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib @@ -30,4 +34,11 @@ MAKE_ENV= INSTALL_LIB="${INSTALL_LIB}" \ PLIST_SUB= PORTVERSION="${PORTVERSION}" +TEST_TARGET= test + +post-patch: + @${REINPLACE_CMD} -e 's|@PORTVERSION@|${PORTVERSION}|g' ${WRKSRC}/configure.ac + ${CP} ${FILESDIR}/ax_with_htslib.m4 ${WRKSRC}/ + ${CP} ${FILESDIR}/ax_with_curses.m4 ${WRKSRC}/ + .include Modified: head/biology/samtools/distinfo ============================================================================== --- head/biology/samtools/distinfo Fri Dec 25 00:55:30 2015 (r404397) +++ head/biology/samtools/distinfo Fri Dec 25 01:31:09 2015 (r404398) @@ -1,2 +1,2 @@ -SHA256 (samtools-samtools-1.2_GH0.tar.gz) = e4be60ad24fe0324b9384fe58ec2ab7359fe926fbee3115d869c447eb01a9e47 -SIZE (samtools-samtools-1.2_GH0.tar.gz) = 4318615 +SHA256 (samtools-samtools-1.3_GH0.tar.gz) = f1eee9a217d547d9b483098519738ef351ec454f4a85cdb1e77ae8892fe858b5 +SIZE (samtools-samtools-1.3_GH0.tar.gz) = 3742904 Added: head/biology/samtools/files/ax_with_curses.m4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/biology/samtools/files/ax_with_curses.m4 Fri Dec 25 01:31:09 2015 (r404398) @@ -0,0 +1,518 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_with_curses.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_WITH_CURSES +# +# DESCRIPTION +# +# This macro checks whether a SysV or X/Open-compatible Curses library is +# present, along with the associated header file. The NcursesW +# (wide-character) library is searched for first, followed by Ncurses, +# then the system-default plain Curses. The first library found is the +# one returned. +# +# The following options are understood: --with-ncursesw, --with-ncurses, +# --without-ncursesw, --without-ncurses. The "--with" options force the +# macro to use that particular library, terminating with an error if not +# found. The "--without" options simply skip the check for that library. +# The effect on the search pattern is: +# +# (no options) - NcursesW, Ncurses, Curses +# --with-ncurses --with-ncursesw - NcursesW only [*] +# --without-ncurses --with-ncursesw - NcursesW only [*] +# --with-ncursesw - NcursesW only [*] +# --with-ncurses --without-ncursesw - Ncurses only [*] +# --with-ncurses - NcursesW, Ncurses [**] +# --without-ncurses --without-ncursesw - Curses only +# --without-ncursesw - Ncurses, Curses +# --without-ncurses - NcursesW, Curses +# +# [*] If the library is not found, abort the configure script. +# +# [**] If the second library (Ncurses) is not found, abort configure. +# +# The following preprocessor symbols may be defined by this macro if the +# appropriate conditions are met: +# +# HAVE_CURSES - if any SysV or X/Open Curses library found +# HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions +# HAVE_CURSES_COLOR - if library supports color (enhanced functions) +# HAVE_CURSES_OBSOLETE - if library supports certain obsolete features +# HAVE_NCURSESW - if NcursesW (wide char) library is to be used +# HAVE_NCURSES - if the Ncurses library is to be used +# +# HAVE_CURSES_H - if is present and should be used +# HAVE_NCURSESW_H - if should be used +# HAVE_NCURSES_H - if should be used +# HAVE_NCURSESW_CURSES_H - if should be used +# HAVE_NCURSES_CURSES_H - if should be used +# +# (These preprocessor symbols are discussed later in this document.) +# +# The following output variable is defined by this macro; it is precious +# and may be overridden on the ./configure command line: +# +# CURSES_LIB - library to add to xxx_LDADD +# +# The library listed in CURSES_LIB is NOT added to LIBS by default. You +# need to add CURSES_LIB to the appropriate xxx_LDADD line in your +# Makefile.am. For example: +# +# prog_LDADD = @CURSES_LIB@ +# +# If CURSES_LIB is set on the configure command line (such as by running +# "./configure CURSES_LIB=-lmycurses"), then the only header searched for +# is . The user may use the CPPFLAGS precious variable to +# override the standard #include search path. If the user needs to +# specify an alternative path for a library (such as for a non-standard +# NcurseW), the user should use the LDFLAGS variable. +# +# The following shell variables may be defined by this macro: +# +# ax_cv_curses - set to "yes" if any Curses library found +# ax_cv_curses_enhanced - set to "yes" if Enhanced functions present +# ax_cv_curses_color - set to "yes" if color functions present +# ax_cv_curses_obsolete - set to "yes" if obsolete features present +# +# ax_cv_ncursesw - set to "yes" if NcursesW library found +# ax_cv_ncurses - set to "yes" if Ncurses library found +# ax_cv_plaincurses - set to "yes" if plain Curses library found +# ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" +# +# These variables can be used in your configure.ac to determine the level +# of support you need from the Curses library. For example, if you must +# have either Ncurses or NcursesW, you could include: +# +# AX_WITH_CURSES +# if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then +# AC_MSG_ERROR([requires either NcursesW or Ncurses library]) +# fi +# +# If any Curses library will do (but one must be present and must support +# color), you could use: +# +# AX_WITH_CURSES +# if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then +# AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) +# fi +# +# Certain preprocessor symbols and shell variables defined by this macro +# can be used to determine various features of the Curses library. In +# particular, HAVE_CURSES and ax_cv_curses are defined if the Curses +# library found conforms to the traditional SysV and/or X/Open Base Curses +# definition. Any working Curses library conforms to this level. +# +# HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the +# library supports the X/Open Enhanced Curses definition. In particular, +# the wide-character types attr_t, cchar_t and wint_t, the functions +# wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES +# are checked. The Ncurses library does NOT conform to this definition, +# although NcursesW does. +# +# HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library +# supports color functions and macros such as COLOR_PAIR, A_COLOR, +# COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the +# X/Open Base Curses definition, but are part of the Enhanced set of +# functions. The Ncurses library DOES support these functions, as does +# NcursesW. +# +# HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the +# library supports certain features present in SysV and BSD Curses but not +# defined in the X/Open definition. In particular, the functions +# getattrs(), getcurx() and getmaxx() are checked. +# +# To use the HAVE_xxx_H preprocessor symbols, insert the following into +# your system.h (or equivalent) header file: +# +# #if defined HAVE_NCURSESW_CURSES_H +# # include +# #elif defined HAVE_NCURSESW_H +# # include +# #elif defined HAVE_NCURSES_CURSES_H +# # include +# #elif defined HAVE_NCURSES_H +# # include +# #elif defined HAVE_CURSES_H +# # include +# #else +# # error "SysV or X/Open-compatible Curses header file required" +# #endif +# +# For previous users of this macro: you should not need to change anything +# in your configure.ac or Makefile.am, as the previous (serial 10) +# semantics are still valid. However, you should update your system.h (or +# equivalent) header file to the fragment shown above. You are encouraged +# also to make use of the extended functionality provided by this version +# of AX_WITH_CURSES, as well as in the additional macros +# AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. +# +# LICENSE +# +# Copyright (c) 2009 Mark Pulford +# Copyright (c) 2009 Damian Pietras +# Copyright (c) 2012 Reuben Thomas +# Copyright (c) 2011 John Zaitseff +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 15 + +AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) +AC_DEFUN([AX_WITH_CURSES], [ + AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) + AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], + [force the use of Ncurses or NcursesW])], + [], [with_ncurses=check]) + AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], + [do not use NcursesW (wide character support)])], + [], [with_ncursesw=check]) + + ax_saved_LIBS=$LIBS + AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], + [ax_with_plaincurses=no], [ax_with_plaincurses=check]) + + ax_cv_curses_which=no + + # Test for NcursesW + + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [ + LIBS="$ax_saved_LIBS -lncursesw" + + AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no]) + ]) + AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ + AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) + ]) + + AS_IF([test "x$ax_cv_ncursesw" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=ncursesw + CURSES_LIB="-lncursesw" + AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncursesw_curses_h=yes], + [ax_cv_header_ncursesw_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) + ]) + + AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncursesw_h=yes], + [ax_cv_header_ncursesw_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) + ]) + + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_header_ncurses_h_with_ncursesw=yes], + [ax_cv_header_ncurses_h_with_ncursesw=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) + ]) + + 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], [ + AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) + ]) + ]) + ]) + + # Test for Ncurses + + AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ + LIBS="$ax_saved_LIBS -lncurses" + + AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_ncurses=yes], [ax_cv_ncurses=no]) + ]) + AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ + AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) + ]) + + AS_IF([test "x$ax_cv_ncurses" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=ncurses + CURSES_LIB="-lncurses" + AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_header_ncurses_curses_h=yes], + [ax_cv_header_ncurses_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) + ]) + + AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_header_ncurses_h=yes], + [ax_cv_header_ncurses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ + ax_cv_curses_color=yes + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) + ]) + + AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ + AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) + ]) + ]) + ]) + + # Test for plain Curses (or if CURSES_LIB was set by user) + + AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ + AS_IF([test "x$CURSES_LIB" != x], [ + LIBS="$ax_saved_LIBS $CURSES_LIB" + ], [ + LIBS="$ax_saved_LIBS -lcurses" + ]) + + AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ + AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], + [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) + ]) + + AS_IF([test "x$ax_cv_plaincurses" = xyes], [ + ax_cv_curses=yes + ax_cv_curses_which=plaincurses + AS_IF([test "x$CURSES_LIB" = x], [ + CURSES_LIB="-lcurses" + ]) + AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) + + # Check for base conformance (and header file) + + AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + initscr(); + ]])], + [ax_cv_header_curses_h=yes], + [ax_cv_header_curses_h=no]) + ]) + AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ + AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if is present]) + + # Check for X/Open Enhanced conformance + + AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + @%:@ifndef _XOPEN_CURSES + @%:@error "this Curses library is not enhanced" + "this Curses library is not enhanced" + @%:@endif + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + attr_t d = WA_NORMAL; + cchar_t e; + wint_t f; + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + wattr_set(stdscr, d, 0, NULL); + wget_wch(stdscr, &f); + ]])], + [ax_cv_plaincurses_enhanced=yes], + [ax_cv_plaincurses_enhanced=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ + ax_cv_curses_enhanced=yes + ax_cv_curses_color=yes + AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + ]) + + # Check for color functions + + AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@define _XOPEN_SOURCE_EXTENDED 1 + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + chtype c = COLOR_PAIR(1) & A_COLOR; + initscr(); + init_pair(1, COLOR_WHITE, COLOR_RED); + ]])], + [ax_cv_plaincurses_color=yes], + [ax_cv_plaincurses_color=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ + ax_cv_curses_color=yes + AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) + ]) + + # Check for obsolete functions + + AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + chtype a = A_BOLD; + int b = KEY_LEFT; + int g = getattrs(stdscr); + int h = getcurx(stdscr) + getmaxx(stdscr); + initscr(); + ]])], + [ax_cv_plaincurses_obsolete=yes], + [ax_cv_plaincurses_obsolete=no]) + ]) + AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ + ax_cv_curses_obsolete=yes + AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) + ]) + ]) + + AS_IF([test "x$ax_cv_header_curses_h" = xno], [ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***