diff options
-rw-r--r-- | biology/htslib/Makefile | 21 | ||||
-rw-r--r-- | biology/htslib/PLIST | 5 | ||||
-rw-r--r-- | biology/htslib/buildlink3.mk | 4 | ||||
-rw-r--r-- | biology/htslib/distinfo | 13 | ||||
-rw-r--r-- | biology/htslib/patches/patch-Makefile | 76 | ||||
-rw-r--r-- | biology/htslib/patches/patch-cram_open__trace__file.c | 18 | ||||
-rw-r--r-- | biology/htslib/patches/patch-hfile__libcurl.c | 78 |
7 files changed, 198 insertions, 17 deletions
diff --git a/biology/htslib/Makefile b/biology/htslib/Makefile index 03ac98ed033..c248bf75e3c 100644 --- a/biology/htslib/Makefile +++ b/biology/htslib/Makefile @@ -1,25 +1,30 @@ -# $NetBSD: Makefile,v 1.15 2020/05/22 10:55:57 adam Exp $ +# $NetBSD: Makefile,v 1.16 2020/07/22 14:50:14 bacon Exp $ -DISTNAME= htslib-1.9 -PKGREVISION= 10 +DISTNAME= htslib-1.10.2 CATEGORIES= biology MASTER_SITES= ${MASTER_SITE_GITHUB:=samtools/} -EXTRACT_SUFX= .tar.bz2 -GITHUB_RELEASE= ${PKGVERSION_NOREV} MAINTAINER= bacon@NetBSD.org HOMEPAGE= https://www.htslib.org/ COMMENT= C library for high-throughput sequencing data formats LICENSE= mit -USE_TOOLS+= gmake perl +USE_TOOLS+= autoconf automake autoreconf bash gmake perl GNU_CONFIGURE= yes + +SUBST_CLASSES+= version +SUBST_STAGE.version= pre-configure +SUBST_SED.version= -e "s|m4_esyscmd_s(\[./version.sh 2>/dev/null\])|[${PKGVERSION_NOREV}]|" +SUBST_FILES.version= configure.ac + +REPLACE_PERL+= test/*.pl + CONFIGURE_ARGS+= --enable-libcurl PKGCONFIG_OVERRIDE= htslib.pc.in TEST_TARGET= test -REPLACE_PERL+= test/compare_sam.pl -REPLACE_PERL+= test/test.pl +pre-configure: + cd ${WRKSRC} && autoreconf .include "../../archivers/bzip2/buildlink3.mk" .include "../../archivers/xz/buildlink3.mk" diff --git a/biology/htslib/PLIST b/biology/htslib/PLIST index ca2d06e3dda..6289cd53d5a 100644 --- a/biology/htslib/PLIST +++ b/biology/htslib/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.1 2018/04/30 16:51:54 bacon Exp $ +@comment $NetBSD: PLIST,v 1.2 2020/07/22 14:50:14 bacon Exp $ bin/bgzip bin/htsfile bin/tabix @@ -31,7 +31,7 @@ include/htslib/vcfutils.h lib/libhts.a lib/libhts.so lib/libhts.so.${PKGVERSION} -lib/libhts.so.2 +lib/libhts.so.3 lib/pkgconfig/htslib.pc man/man1/bgzip.1 man/man1/htsfile.1 @@ -39,3 +39,4 @@ man/man1/tabix.1 man/man5/faidx.5 man/man5/sam.5 man/man5/vcf.5 +man/man7/htslib-s3-plugin.7 diff --git a/biology/htslib/buildlink3.mk b/biology/htslib/buildlink3.mk index 5c8a1c487be..7bb5583c741 100644 --- a/biology/htslib/buildlink3.mk +++ b/biology/htslib/buildlink3.mk @@ -1,11 +1,11 @@ -# $NetBSD: buildlink3.mk,v 1.2 2018/05/01 13:20:44 bacon Exp $ +# $NetBSD: buildlink3.mk,v 1.3 2020/07/22 14:50:14 bacon Exp $ BUILDLINK_TREE+= htslib .if !defined(HTSLIB_BUILDLINK3_MK) HTSLIB_BUILDLINK3_MK:= -BUILDLINK_API_DEPENDS.htslib+= htslib>=1.8 +BUILDLINK_API_DEPENDS.htslib+= htslib>=1.10.2 BUILDLINK_PKGSRCDIR.htslib?= ../../biology/htslib .endif # HTSLIB_BUILDLINK3_MK diff --git a/biology/htslib/distinfo b/biology/htslib/distinfo index 75982d9002f..b4938ea2013 100644 --- a/biology/htslib/distinfo +++ b/biology/htslib/distinfo @@ -1,6 +1,9 @@ -$NetBSD: distinfo,v 1.2 2018/11/06 10:24:14 adam Exp $ +$NetBSD: distinfo,v 1.3 2020/07/22 14:50:14 bacon Exp $ -SHA1 (htslib-1.9.tar.bz2) = 21be5187203df30637dda2e1133cae2e833ef050 -RMD160 (htslib-1.9.tar.bz2) = 85d5211cc197931e73a0dc7ca0673426f2ff6d89 -SHA512 (htslib-1.9.tar.bz2) = ddb0e2d970e4c2c27e203b064898f95cb7c187cd497c02fc7b4312dcea25669d0b6063d537687521e7a065f6daefa1ae897add2df4981037a187b499d08fdef7 -Size (htslib-1.9.tar.bz2) = 1178859 bytes +SHA1 (htslib-1.10.2.tar.gz) = 0ac4b86e49556d7dcaa89d4cce2661c9ca706631 +RMD160 (htslib-1.10.2.tar.gz) = 6d8b6a362297345420dc9acc544029276ce4b1b6 +SHA512 (htslib-1.10.2.tar.gz) = 7a91c15ca1de35653d068dc57ae511ad791ae0bd8504867d4e60c46e813e58b441409541197cde3b2a37840e60331336aebc627ecbf5c64fca1af63dd05f8f9e +Size (htslib-1.10.2.tar.gz) = 1452177 bytes +SHA1 (patch-Makefile) = e13333dd97ecd6c6753d14c1b738d6e5934a2911 +SHA1 (patch-cram_open__trace__file.c) = 49b47e13786317e652a8ec810cc91f10d21bb8ea +SHA1 (patch-hfile__libcurl.c) = 2a143818f1099ef01c57a3c904060a76abb63f14 diff --git a/biology/htslib/patches/patch-Makefile b/biology/htslib/patches/patch-Makefile new file mode 100644 index 00000000000..d8abf1d21a3 --- /dev/null +++ b/biology/htslib/patches/patch-Makefile @@ -0,0 +1,76 @@ +$NetBSD: patch-Makefile,v 1.1 2020/07/22 14:50:14 bacon Exp $ + +# Respect pkgsrc env + +--- Makefile.orig 2019-12-19 09:54:30.000000000 +0000 ++++ Makefile +@@ -22,44 +22,43 @@ + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + # DEALINGS IN THE SOFTWARE. + +-CC = gcc +-AR = ar +-RANLIB = ranlib ++CC ?= gcc ++AR ?= ar ++RANLIB ?= ranlib + + # Default libraries to link if configure is not used + htslib_default_libs = -lz -lm -lbz2 -llzma -lcurl + +-CPPFLAGS = ++# CPPFLAGS = + # TODO: make the 64-bit support for VCF optional via configure, for now add -DVCF_ALLOW_INT64 + # to CFLAGS manually, here or in config.mk if the latter exists. + # TODO: probably update cram code to make it compile cleanly with -Wc++-compat + # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600 + #CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600 +-CFLAGS = -g -Wall -O2 -fvisibility=hidden ++CFLAGS ?= -g -Wall -O2 -fvisibility=hidden + EXTRA_CFLAGS_PIC = -fpic +-LDFLAGS = -fvisibility=hidden ++LDFLAGS ?= -fvisibility=hidden + LIBS = $(htslib_default_libs) + +-prefix = /usr/local +-exec_prefix = $(prefix) ++PREFIX ?= /usr/local ++exec_prefix = $(PREFIX) + bindir = $(exec_prefix)/bin +-includedir = $(prefix)/include ++includedir = $(PREFIX)/include + libdir = $(exec_prefix)/lib + libexecdir = $(exec_prefix)/libexec +-datarootdir = $(prefix)/share ++datarootdir = $(PREFIX)/share + mandir = $(datarootdir)/man + man1dir = $(mandir)/man1 + man5dir = $(mandir)/man5 + man7dir = $(mandir)/man7 + pkgconfigdir= $(libdir)/pkgconfig + +-MKDIR_P = mkdir -p +-INSTALL = install -p +-INSTALL_DATA = $(INSTALL) -m 644 +-INSTALL_DIR = $(MKDIR_P) -m 755 +-INSTALL_LIB = $(INSTALL_DATA) +-INSTALL_MAN = $(INSTALL_DATA) +-INSTALL_PROGRAM = $(INSTALL) ++MKDIR_P = mkdir -p ++INSTALL_DATA = ${BSD_INSTALL_DATA} ++INSTALL_DIR = $(MKDIR_P) ++INSTALL_LIB = ${BSD_INSTALL_LIB} ++INSTALL_MAN = ${BSD_INSTALL_MAN} ++INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM} + + # Set by config.mk if plugins are enabled + plugindir = +@@ -98,7 +97,7 @@ BUILT_THRASH_PROGRAMS = \ + test/thrash_threads6 \ + test/thrash_threads7 + +-all: lib-static lib-shared $(BUILT_PROGRAMS) plugins $(BUILT_TEST_PROGRAMS) ++all: lib-static lib-shared $(BUILT_PROGRAMS) plugins + + HTSPREFIX = + include htslib_vars.mk diff --git a/biology/htslib/patches/patch-cram_open__trace__file.c b/biology/htslib/patches/patch-cram_open__trace__file.c new file mode 100644 index 00000000000..7915730995d --- /dev/null +++ b/biology/htslib/patches/patch-cram_open__trace__file.c @@ -0,0 +1,18 @@ +$NetBSD: patch-cram_open__trace__file.c,v 1.1 2020/07/22 14:50:14 bacon Exp $ + +# Enhance error message + +--- cram/open_trace_file.c.orig 2019-12-19 09:54:30.000000000 +0000 ++++ cram/open_trace_file.c +@@ -204,8 +204,9 @@ mFILE *find_file_url(const char *file, c + goto fail; + } + } +- if (hclose(hf) < 0 || len < 0) { +- hts_log_warning("Failed to read reference \"%s\": %s", path, strerror(errno)); ++ int close_status = hclose(hf); ++ if (close_status < 0 || len < 0) { ++ hts_log_warning("Failed to read reference \"%s\": %s close_status = %d len = %ld", path, strerror(errno)); + goto fail; + } + diff --git a/biology/htslib/patches/patch-hfile__libcurl.c b/biology/htslib/patches/patch-hfile__libcurl.c new file mode 100644 index 00000000000..b7177535ba2 --- /dev/null +++ b/biology/htslib/patches/patch-hfile__libcurl.c @@ -0,0 +1,78 @@ +$NetBSD: patch-hfile__libcurl.c,v 1.1 2020/07/22 14:50:14 bacon Exp $ + +# recent libcurl compatibility + +--- hfile_libcurl.c.orig 2019-12-19 09:54:30.000000000 +0000 ++++ hfile_libcurl.c +@@ -74,6 +74,10 @@ typedef struct { + unsigned int size; + } hdrlist; + ++#ifndef ENOTRECOVERABLE ++#define ENOTRECOVERABLE EIO ++#endif ++ + typedef struct { + hdrlist fixed; // List of headers supplied at hopen() + hdrlist extra; // List of headers from callback +@@ -218,6 +222,8 @@ static int easy_errno(CURL *easy, CURLco + return EEXIST; + + default: ++ hts_log_error("Libcurl reported error %d (%s)", (int) err, ++ curl_easy_strerror(err)); + return EIO; + } + } +@@ -238,6 +244,8 @@ static int multi_errno(CURLMcode errm) + return ENOMEM; + + default: ++ hts_log_error("Libcurl reported error %d (%s)", (int) errm, ++ curl_multi_strerror(errm)); + return EIO; + } + } +@@ -797,9 +805,13 @@ static ssize_t libcurl_read(hFILE *fpv, + fp->buffer.ptr.rd = buffer; + fp->buffer.len = nbytes; + fp->paused = 0; +- err = curl_easy_pause(fp->easy, CURLPAUSE_CONT); +- if (err != CURLE_OK) { errno = easy_errno(fp->easy, err); return -1; } +- ++ if (! fp->finished) { ++ err = curl_easy_pause(fp->easy, CURLPAUSE_CONT); ++ if (err != CURLE_OK) { ++ errno = easy_errno(fp->easy, err); ++ return -1; ++ } ++ } + while (! fp->paused && ! fp->finished) { + if (wait_perform(fp) < 0) return -1; + } +@@ -1003,12 +1015,6 @@ static int restart_from_position(hFILE_l + } + temp_fp.nrunning = ++fp->nrunning; + +- err = curl_easy_pause(temp_fp.easy, CURLPAUSE_CONT); +- if (err != CURLE_OK) { +- save_errno = easy_errno(temp_fp.easy, err); +- goto error_remove; +- } +- + while (! temp_fp.paused && ! temp_fp.finished) + if (wait_perform(&temp_fp) < 0) { + save_errno = errno; +@@ -1084,8 +1090,10 @@ static int libcurl_close(hFILE *fpv) + fp->buffer.len = 0; + fp->closing = 1; + fp->paused = 0; +- err = curl_easy_pause(fp->easy, CURLPAUSE_CONT); +- if (err != CURLE_OK) save_errno = easy_errno(fp->easy, err); ++ if (! fp->finished) { ++ err = curl_easy_pause(fp->easy, CURLPAUSE_CONT); ++ if (err != CURLE_OK) save_errno = easy_errno(fp->easy, err); ++ } + + while (save_errno == 0 && ! fp->paused && ! fp->finished) + if (wait_perform(fp) < 0) save_errno = errno; |