summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-01-11 14:15:04 +0100
committerRicardo Wurmus <rekado@elephly.net>2022-01-11 14:19:53 +0100
commit9966f98b1b4e17b8a80865ad1e1938aff703bdfe (patch)
tree1fa995781b6d5f2dd6bd0f5b1de495e41d589520 /gnu
parent5b200dbfb0714016b3731ef288b7821f30ec2524 (diff)
downloadguix-9966f98b1b4e17b8a80865ad1e1938aff703bdfe.tar.gz
gnu: Add htslib-for-stringtie.
* gnu/packages/bioinformatics.scm (htslib-for-stringtie): New variable.
* gnu/packages/patches/htslib-for-stringtie.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/bioinformatics.scm12
-rw-r--r--gnu/packages/patches/htslib-for-stringtie.patch26
3 files changed, 39 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index e4f596f0bd..feadac4bad 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1255,6 +1255,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/hedgewars-network-bsd.patch		\
   %D%/packages/patches/helm-fix-gcc-9-build.patch		\
   %D%/packages/patches/http-parser-CVE-2020-8287.patch		\
+  %D%/packages/patches/htslib-for-stringtie.patch		\
   %D%/packages/patches/hubbub-sort-entities.patch		\
   %D%/packages/patches/hueplusplus-mbedtls.patch		\
   %D%/packages/patches/hurd-cross.patch				\
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 487c43a2da..2b9a27d44b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -4884,6 +4884,18 @@ data.  It also provides the @command{bgzip}, @command{htsfile}, and
     (native-inputs
      `(("perl" ,perl)))))
 
+(define htslib-for-stringtie
+  (package
+    (inherit htslib)
+    (source (origin
+              (inherit (package-source htslib))
+              (patches
+               (search-patches "htslib-for-stringtie.patch"))))
+    (arguments
+     `(#:configure-flags '("--with-libdeflate")))
+    (inputs
+     (list bzip2 libdeflate openssl))))
+
 (define-public idr
   (package
     (name "idr")
diff --git a/gnu/packages/patches/htslib-for-stringtie.patch b/gnu/packages/patches/htslib-for-stringtie.patch
new file mode 100644
index 0000000000..3e6cd5bb63
--- /dev/null
+++ b/gnu/packages/patches/htslib-for-stringtie.patch
@@ -0,0 +1,26 @@
+These changes are commits d7e357946ead219b81cc1becbe0de8a99d96ca84 and
+8ed0daa39bc662defa99507f926815431056543a in
+https://github.com/samtools/htscodecs.  The stringtie package expects these
+changes to have been applied.
+
+diff -ru htslib-1.12/htscodecs/htscodecs/tokenise_name3.c stringtie-2.2.0/htslib/htscodecs/htscodecs/tokenise_name3.c
+--- a/htscodecs/htscodecs/tokenise_name3.c	2021-02-22 13:07:06.000000000 +0100
++++ b/htscodecs/htscodecs/tokenise_name3.c	2021-12-04 19:27:39.000000000 +0100
+@@ -211,7 +211,7 @@
+ 	if (!ctx) return NULL;
+ 	ctx->max_names = max_names;
+ 	pthread_setspecific(tok_key, ctx);
+-    } else if (ctx->max_names < max_names) {
++    } else if (ctx->max_names < max_names+1) {
+ 	ctx = realloc(ctx, sizeof(*ctx) + ++max_names*sizeof(*ctx->lc));
+ 	if (!ctx) return NULL;
+ 	ctx->max_names = max_names;
+@@ -1058,6 +1058,8 @@
+ 	tok = decode_token_type(ctx, ntok);
+ 	//fprintf(stderr, "Tok %d = %d\n", ntok, tok);
+ 
++	ctx->lc[cnum].last_ntok = 0;
++
+ 	switch (tok) {
+ 	case N_CHAR:
+ 	    if (len+1 >= name_len) return -1;
\ No newline at end of file