[med-svn] [Git][med-team/htslib][master] Helping compilation of sambamba

Steffen Möller gitlab at salsa.debian.org
Sat Jul 4 15:53:02 BST 2020



Steffen Möller pushed to branch master at Debian Med / htslib


Commits:
972db398 by Steffen Moeller at 2020-07-04T16:51:45+02:00
Helping compilation of sambamba

- - - - -


5 changed files:

- debian/changelog
- debian/control
- + debian/patches/cram_to_bam_export.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+htslib (1.10.2-4) unstable; urgency=medium
+
+  * d/control: Added Rules-Requires-Root: no
+  * Exported cram_to_bam function to compile sambamba, borrowed from
+    http://git.genenetwork.org/guix-bioinformatics/guix-bioinformatics
+    htslib-add-cram_to_bam.patch
+
+ -- Steffen Moeller <moeller at debian.org>  Sat, 04 Jul 2020 14:04:35 +0200
+
 htslib (1.10.2-3) unstable; urgency=medium
 
   [ Andreas Tille ]


=====================================
debian/control
=====================================
@@ -2,7 +2,8 @@ Source: htslib
 Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
 Uploaders: Charles Plessy <plessy at debian.org>,
            Andreas Tille <tille at debian.org>,
-           Michael R. Crusoe <crusoe at debian.org>
+           Michael R. Crusoe <crusoe at debian.org>,
+           Steffen Moeller <moeller at debian.org>
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 12),
@@ -17,6 +18,7 @@ Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/htslib
 Vcs-Git: https://salsa.debian.org/med-team/htslib.git
 Homepage: https://github.com/samtools/htslib
+Rules-Requires-Root: no
 
 Package: libhts3
 Architecture: any
@@ -60,6 +62,9 @@ Description: development files for the HTSlib
  .
  This package contains development files for the HTSlib: headers, static
  library, manual pages, etc.
+ .
+ For compatibility with sambamba, the internal routine cram_to_bam was
+ exported, hereto adopting a patch found in guix.
 
 Package: htslib-test
 Architecture: all


=====================================
debian/patches/cram_to_bam_export.patch
=====================================
@@ -0,0 +1,47 @@
+Description: Exports the cram_to_bam function to support the
+  sambamba package.
+Author: Roel Janssen <roel at gnu.org>
+
+Index: htslib/cram/cram_decode.c
+===================================================================
+--- htslib.orig/cram/cram_decode.c
++++ htslib/cram/cram_decode.c
+@@ -2803,8 +2803,8 @@ int cram_decode_slice_mt(cram_fd *fd, cr
+  * Returns the used size of the bam record on success
+  *         -1 on failure.
+  */
+-static int cram_to_bam(sam_hdr_t *sh, cram_fd *fd, cram_slice *s,
+-                       cram_record *cr, int rec, bam_seq_t **bam) {
++int cram_to_bam(sam_hdr_t * const sh, const cram_fd * const fd, cram_slice * const s,
++                cram_record * const cr, int rec, bam_seq_t **bam) {
+     int bam_idx, rg_len;
+     char name_a[1024], *name;
+     int name_len;
+Index: htslib/cram/cram_decode.h
+===================================================================
+--- htslib.orig/cram/cram_decode.h
++++ htslib/cram/cram_decode.h
+@@ -106,6 +106,23 @@ int cram_decode_slice(cram_fd *fd, cram_
+ 
+ 
+ /*
++ * Converts a cram in-memory record into a bam in-memory record. We
++ * pass a pointer to a bam_seq_t pointer along with the a pointer to
++ * the allocated size. These can initially be pointers to NULL and zero..
++ *
++ * This function will reallocate the bam buffer as required and update
++ * (*bam)->alloc accordingly, allowing it to be used within a loop
++ * efficiently without needing to allocate new bam objects over and
++ * over again.
++ *
++ * Returns the used size of the bam record on success
++ *         -1 on failure.
++ */
++int cram_to_bam(SAM_hdr * const bfd, const cram_fd * const fd, cram_slice * const s,
++                cram_record *const cr, int rec, bam_seq_t **bam);
++
++
++/*
+  * Drains and frees the decode read-queue for a multi-threaded reader.
+  */
+ void cram_drain_rqueue(cram_fd *fd);


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ fPIC.patch
 testShebang.patch
 fix_float_precision
 big-endian
+cram_to_bam_export.patch


=====================================
debian/rules
=====================================
@@ -54,6 +54,10 @@ override_dh_auto_install-arch:
 	$(RM) -r test
 	mv test_backup test
 
+override_dh_strip:
+	# This is apparently important for the interpretation by ldc2 in sambamba
+	dh_strip -Xlibhts.a
+
 override_dh_auto_install-indep:
 
 override_dh_auto_test-arch:



View it on GitLab: https://salsa.debian.org/med-team/htslib/-/commit/972db398ea64df81b6adc890a81c5506f33b3a7f

-- 
View it on GitLab: https://salsa.debian.org/med-team/htslib/-/commit/972db398ea64df81b6adc890a81c5506f33b3a7f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200704/096f9be2/attachment-0001.html>


More information about the debian-med-commit mailing list