From 6fd02632f028aa49ad82067f53d274e81a5d3fae Mon Sep 17 00:00:00 2001 From: "Jason W. Bacon" Date: Thu, 5 Nov 2020 20:30:50 +0000 Subject: [PATCH] biology/htslib: Upgrade to 1.11.0 Numerous bug fixes, new features and performance improvements since 1.10 https://github.com/samtools/htslib/releases/tag/1.11 Reported by: portscout --- biology/htslib/Makefile | 2 +- biology/htslib/distinfo | 6 +- biology/htslib/files/patch-Makefile | 41 +++-------- biology/htslib/files/patch-hfile__libcurl.c | 82 ++++----------------- biology/htslib/files/patch-hts.c | 10 +++ biology/htslib/files/patch-sam.c | 10 +++ biology/htslib/pkg-plist | 3 +- 7 files changed, 51 insertions(+), 103 deletions(-) create mode 100644 biology/htslib/files/patch-hts.c create mode 100644 biology/htslib/files/patch-sam.c diff --git a/biology/htslib/Makefile b/biology/htslib/Makefile index 11927a423710..733ec0c41dea 100644 --- a/biology/htslib/Makefile +++ b/biology/htslib/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= htslib -DISTVERSION= 1.10.2 +DISTVERSION= 1.11.0 CATEGORIES= biology devel MAINTAINER= jwb@FreeBSD.org diff --git a/biology/htslib/distinfo b/biology/htslib/distinfo index c27d7e91533c..ef59ac4df246 100644 --- a/biology/htslib/distinfo +++ b/biology/htslib/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1595116892 -SHA256 (samtools-htslib-1.10.2_GH0.tar.gz) = b352eabed6392869dbdea0fe6db10a736a226d1f90036a724a49798f7e81cab7 -SIZE (samtools-htslib-1.10.2_GH0.tar.gz) = 1452177 +TIMESTAMP = 1602982298 +SHA256 (samtools-htslib-1.11.0_GH0.tar.gz) = 55356e78f25a20194488d94308335f409c3757101398961388caf38d3cce12dd +SIZE (samtools-htslib-1.11.0_GH0.tar.gz) = 1485848 diff --git a/biology/htslib/files/patch-Makefile b/biology/htslib/files/patch-Makefile index c2b011767521..6f8216bbc7bb 100644 --- a/biology/htslib/files/patch-Makefile +++ b/biology/htslib/files/patch-Makefile @@ -1,31 +1,7 @@ ---- Makefile.orig 2020-08-02 22:52:13 UTC +--- Makefile.orig 2020-10-18 00:44:56 UTC +++ Makefile -@@ -22,25 +22,26 @@ - # 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 +@@ -40,7 +40,8 @@ EXTRA_CFLAGS_PIC = -fpic + LDFLAGS = -fvisibility=hidden LIBS = $(htslib_default_libs) -prefix = /usr/local @@ -34,7 +10,7 @@ exec_prefix = $(prefix) bindir = $(exec_prefix)/bin includedir = $(prefix)/include -@@ -53,13 +54,13 @@ man5dir = $(mandir)/man5 +@@ -53,13 +54,14 @@ man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 pkgconfigdir= $(prefix)/libdata/pkgconfig @@ -47,6 +23,7 @@ -INSTALL_PROGRAM = $(INSTALL) +# Use ports BSD_INSTALL_PROGRAM to strip if WITH_DEBUG is not set +MKDIR_P = mkdir -p ++INSTALL = install -p +INSTALL_DATA = ${BSD_INSTALL_DATA} +INSTALL_DIR = $(MKDIR_P) +INSTALL_LIB = ${BSD_INSTALL_LIB} @@ -55,12 +32,12 @@ # Set by config.mk if plugins are enabled plugindir = -@@ -98,7 +99,7 @@ BUILT_THRASH_PROGRAMS = \ +@@ -100,7 +102,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 +-all: lib-static lib-shared $(BUILT_PROGRAMS) plugins $(BUILT_TEST_PROGRAMS) \ ++all: lib-static lib-shared $(BUILT_PROGRAMS) plugins \ + htslib_static.mk htslib-uninstalled.pc HTSPREFIX = - include htslib_vars.mk diff --git a/biology/htslib/files/patch-hfile__libcurl.c b/biology/htslib/files/patch-hfile__libcurl.c index e4cd8745a18e..2406056b1c04 100644 --- a/biology/htslib/files/patch-hfile__libcurl.c +++ b/biology/htslib/files/patch-hfile__libcurl.c @@ -1,74 +1,24 @@ ---- hfile_libcurl.c.orig 2019-12-19 09:54:30 UTC +--- hfile_libcurl.c.orig 2020-09-22 12:15:49 UTC +++ hfile_libcurl.c -@@ -74,6 +74,10 @@ typedef struct { - unsigned int size; - } hdrlist; +@@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR O + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. */ +#ifndef ENOTRECOVERABLE +#define ENOTRECOVERABLE EIO +#endif + + #define HTS_BUILDING_LIBRARY // Enables HTSLIB_EXPORT, see htslib/hts_defs.h + #include + +@@ -73,6 +77,10 @@ typedef struct { + unsigned int num; + 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, CURLcode err) - 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, void *bufferv, - 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_libcurl *fp, of - } - 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; diff --git a/biology/htslib/files/patch-hts.c b/biology/htslib/files/patch-hts.c new file mode 100644 index 000000000000..d18904348c86 --- /dev/null +++ b/biology/htslib/files/patch-hts.c @@ -0,0 +1,10 @@ +--- hts.c.orig 2020-10-18 00:49:42 UTC ++++ hts.c +@@ -39,6 +39,7 @@ DEALINGS IN THE SOFTWARE. */ + #include + #include + #include ++#include // R_OK + + #include "htslib/hts.h" + #include "htslib/bgzf.h" diff --git a/biology/htslib/files/patch-sam.c b/biology/htslib/files/patch-sam.c new file mode 100644 index 000000000000..679b4d71967d --- /dev/null +++ b/biology/htslib/files/patch-sam.c @@ -0,0 +1,10 @@ +--- sam.c.orig 2020-10-18 00:50:46 UTC ++++ sam.c +@@ -35,6 +35,7 @@ DEALINGS IN THE SOFTWARE. */ + #include + #include + #include ++#include // usleep() + + // Suppress deprecation message for cigar_tab, which we initialise + #include "htslib/hts_defs.h" diff --git a/biology/htslib/pkg-plist b/biology/htslib/pkg-plist index dd5727097944..06e7972133d5 100644 --- a/biology/htslib/pkg-plist +++ b/biology/htslib/pkg-plist @@ -16,6 +16,7 @@ include/htslib/khash.h include/htslib/khash_str2int.h include/htslib/klist.h include/htslib/knetfile.h +include/htslib/kroundup.h include/htslib/kseq.h include/htslib/ksort.h include/htslib/kstring.h @@ -29,7 +30,7 @@ include/htslib/vcf_sweep.h include/htslib/vcfutils.h lib/libhts.a lib/libhts.so -lib/libhts.so.%%PORTVERSION%% +lib/libhts.so.1.11 lib/libhts.so.3 libdata/pkgconfig/htslib.pc man/man1/bgzip.1.gz