[med-svn] [Git][med-team/sambamba][master] Fixed build failure.

Steffen Möller gitlab at salsa.debian.org
Sat Jul 4 18:24:51 BST 2020



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


Commits:
2150d5b1 by Steffen Moeller at 2020-07-04T19:24:34+02:00
Fixed build failure.

- - - - -


8 changed files:

- debian/changelog
- debian/patches/01_add-meson-build.patch
- debian/patches/02_disable-assert.patch
- debian/patches/2to3.patch
- + debian/patches/MakefilePointerToStaticLib.patch
- + debian/patches/sam_hdr_parse_2sam_hdr_parse.patch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+sambamba (0.7.1-3) unstable; urgency=medium
+
+  * Fixed build failure (Closes: # 948919)
+    with
+    - dependency on newer htslib package that is not stripped
+    - and exports the cram_to_bam function
+    - avoided use of inline htslib function by sambamba
+    Upstream informed on https://github.com/samtools/htslib/issues/1098
+
+ -- Steffen Moeller <moeller at debian.org>  Sat, 04 Jul 2020 19:18:06 +0200
+
 sambamba (0.7.1-2) UNRELEASED; urgency=medium
 
   * Use 2to3 to port from Python2 to Python3


=====================================
debian/patches/01_add-meson-build.patch
=====================================
@@ -11,10 +11,10 @@ Subject: [PATCH] Add Meson build definition
  create mode 100644 meson.build
  create mode 100644 meson_options.txt
 
-diff --git a/.gitignore b/.gitignore
-index 7062b3a..a6cbb18 100644
---- a/.gitignore
-+++ b/.gitignore
+Index: sambamba/.gitignore
+===================================================================
+--- sambamba.orig/.gitignore
++++ sambamba/.gitignore
 @@ -16,6 +16,7 @@ shunit*
  /*.cram
  /*.crai
@@ -23,12 +23,14 @@ index 7062b3a..a6cbb18 100644
  *.hex
  *.zcat
  *.out
-diff --git a/meson.build b/meson.build
-new file mode 100644
-index 0000000..3dd9cde
+Index: sambamba/meson.build
+===================================================================
 --- /dev/null
-+++ b/meson.build
-@@ -0,0 +1,141 @@
++++ sambamba/meson.build
+@@ -0,0 +1,154 @@
++# This file was created manually. It is provided as a patch in debian/patches.
++# Please consider using the quilt patch system.
++
 +project('Sambamba', 'd',
 +    meson_version : '>=0.48',
 +    license : 'GPL-2.0',
@@ -120,8 +122,13 @@ index 0000000..3dd9cde
 +# Dependencies
 +#
 +biod_dep   = dependency('biod', version: '>=0.1.0', static: true)
-+lz4_dep    = dependency('liblz4')
-+htslib_dep = dependency('htslib', version: '>=1.3.2')
++htslib_dep = dependency('htslib', version: '>=1.3.2', static: true)
++lz4_dep    = dependency('liblz4', static: false)
++curl_dep    = dependency('libcurl', static: false)
++#deflate_dep    = dependency('libdeflate', static: false)
++lzma_dep    = dependency('liblzma', static: false)
++crypto_dep    = dependency('libcrypto', static: false)
++#bz2_dep    = dependency('libbz2.so', static: false)
 +
 +#
 +# Configure
@@ -151,8 +158,13 @@ index 0000000..3dd9cde
 +     thirdparty_src,
 +     version_info_d_fname],
 +    dependencies: [biod_dep,
++                   htslib_dep,
++#                   deflate_dep,
 +                   lz4_dep,
-+                   htslib_dep],
++#                   bz2_dep,
++                   curl_dep,
++                   crypto_dep,
++                   lzma_dep],
 +    d_args: extra_dflags,
 +    d_import_dirs: [include_directories('.')],
 +    install: true
@@ -170,10 +182,9 @@ index 0000000..3dd9cde
 +#
 +install_man(manpages)
 +install_data(['etc/bash_completion.d/sambamba'], install_dir: '/usr/share/bash-completion/completions')
-diff --git a/meson_options.txt b/meson_options.txt
-new file mode 100644
-index 0000000..607da9a
+Index: sambamba/meson_options.txt
+===================================================================
 --- /dev/null
-+++ b/meson_options.txt
++++ sambamba/meson_options.txt
 @@ -0,0 +1 @@
 +option('optimize_strong', type : 'boolean', value: false)


=====================================
debian/patches/02_disable-assert.patch
=====================================
@@ -4,8 +4,10 @@ Author: Gianfranco Costamagna <locutusofborg at debian.org>
 Bug-Debian: https://bugs.debian.org/893664
 Last-Update: 2018-03-21
 
---- a/sambamba/markdup.d
-+++ b/sambamba/markdup.d
+Index: sambamba/sambamba/markdup.d
+===================================================================
+--- sambamba.orig/sambamba/markdup.d
++++ sambamba/sambamba/markdup.d
 @@ -610,7 +610,7 @@ struct PairedEndsInfo {
      }
  }


=====================================
debian/patches/2to3.patch
=====================================
@@ -3,8 +3,10 @@ Bug-Debian: https://bugs.debian.org/938431
 Author: Andreas Tille <tille at debian.org>
 Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
 
---- a/INSTALL.md
-+++ b/INSTALL.md
+Index: sambamba/INSTALL.md
+===================================================================
+--- sambamba.orig/INSTALL.md
++++ sambamba/INSTALL.md
 @@ -15,12 +15,12 @@
  After checking out the source from github with git submodules is is
  possibleto install the build tools with GNU Guix
@@ -20,8 +22,10 @@ Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
      make clean
      make -j 4
      make check
---- a/RELEASE-NOTES.md
-+++ b/RELEASE-NOTES.md
+Index: sambamba/RELEASE-NOTES.md
+===================================================================
+--- sambamba.orig/RELEASE-NOTES.md
++++ sambamba/RELEASE-NOTES.md
 @@ -69,7 +69,7 @@ Generation 3    Sep 25 2018 09:39:08
      branch: origin/master
      commit: 932839ff124ff3b0dd3070914fb1c5beec69bf32
@@ -31,8 +35,10 @@ Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
  make clean && make -j 16 && make check
  
  for x in `ldd bin/sambamba|cut -d ' ' -f 3` ; do realpath $x ; done
---- a/gen_ldc_version_info.py
-+++ b/gen_ldc_version_info.py
+Index: sambamba/gen_ldc_version_info.py
+===================================================================
+--- sambamba.orig/gen_ldc_version_info.py
++++ sambamba/gen_ldc_version_info.py
 @@ -1,6 +1,6 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
@@ -51,8 +57,10 @@ Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
      if version is None:
          version = "version not available"
      print("immutable {0}_VERSION_STRING = \"{1}\";".format(component, version))
---- a/scripts/bioconda_push.sh
-+++ b/scripts/bioconda_push.sh
+Index: sambamba/scripts/bioconda_push.sh
+===================================================================
+--- sambamba.orig/scripts/bioconda_push.sh
++++ sambamba/scripts/bioconda_push.sh
 @@ -2,7 +2,7 @@ RECIPES=~/github/bioconda-recipes # loca
  REMOTE=bioconda                   # bioconda/bioconda-recipes remote
  
@@ -62,8 +70,10 @@ Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
  VERSION=`grep version $UPDATED_RECIPE | cut -d\' -f2`
  
  cd $RECIPES
---- a/scripts/bioconda_yaml_gen.py
-+++ b/scripts/bioconda_yaml_gen.py
+Index: sambamba/scripts/bioconda_yaml_gen.py
+===================================================================
+--- sambamba.orig/scripts/bioconda_yaml_gen.py
++++ sambamba/scripts/bioconda_yaml_gen.py
 @@ -28,7 +28,7 @@ about:
    summary: Tools for working with SAM/BAM data"""
  
@@ -83,8 +93,10 @@ Last-Update: Tue, 17 Dec 2019 21:03:13 +0100
                  osx_url=downloads['osx'],
 -                linux_md5=linux_md5, osx_md5=osx_md5)
 +                linux_md5=linux_md5, osx_md5=osx_md5))
---- a/test/test_depth.py
-+++ b/test/test_depth.py
+Index: sambamba/test/test_depth.py
+===================================================================
+--- sambamba.orig/test/test_depth.py
++++ sambamba/test/test_depth.py
 @@ -14,7 +14,7 @@ def referenceSequences(bam_fn):
      return {item['SN']: item['LN'] for item in msgpack.unpackb(header)[2]}
  


=====================================
debian/patches/MakefilePointerToStaticLib.patch
=====================================
@@ -0,0 +1,53 @@
+Index: sambamba/Makefile
+===================================================================
+--- sambamba.orig/Makefile
++++ sambamba/Makefile
+@@ -32,13 +32,13 @@ DFLAGS      = -wi -I. -IBioD -g -J.
+ 
+ DLIBS       = $(LIBRARY_PATH)/libphobos2-ldc.a $(LIBRARY_PATH)/libdruntime-ldc.a
+ DLIBS_DEBUG = $(LIBRARY_PATH)/libphobos2-ldc-debug.a $(LIBRARY_PATH)/libdruntime-ldc-debug.a
+-LIBS        = htslib/libhts.a lz4/lib/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm -L-lz
+-LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) htslib/libhts.a $(LIBRARY_PATH)/liblz4.a -L-lz
++LIBS        = /usr/lib/$(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)/libhts.a /usr/lib/$(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm -L-lz
++LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) /usr/lib/$(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)/libhts.a /usr/lib/$(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)/liblz4.a -L-lz
+ SRC         = utils/ldc_version_info_.d utils/lz4.d utils/strip_bcf_header.d $(sort $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d)) utils/version_.d $(sort $(wildcard thirdparty/*.d cram/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d))
+ OBJ         = $(SRC:.d=.o)
+ OUT         = bin/sambamba-$(shell cat VERSION)
+ 
+-STATIC_LIB_PATH=-Lhtslib -Llz4
++STATIC_LIB_PATH= -L/usr/lib/$(dpkg-architecture -qDEB_TARGET_GNU_TYPE)/
+ 
+ .PHONY: all debug release static clean test
+ 
+@@ -56,21 +56,13 @@ static:                            DFLAG
+ 
+ pgo-static:                        DFLAGS += -fprofile-instr-use=profile.data
+ 
+-lz4-static: lz4/lib/liblz4.a
+-
+-lz4/lib/liblz4.a: lz4/lib/lz4.c lz4/lib/lz4hc.c lz4/lib/lz4frame.c lz4/lib/xxhash.c
+-	cd lz4/lib && gcc -O3 -c lz4.c lz4hc.c lz4frame.c xxhash.c && $(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o
+-
+-htslib-static:
+-	cd htslib && $(MAKE) -j8
+-
+ utils/ldc_version_info_.d:
+ 	python3 ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
+ 	cat utils/ldc_version_info_.d
+ 
+ ldc_version_info: utils/ldc_version_info_.d
+ 
+-build-setup: ldc_version_info lz4-static htslib-static
++build-setup: ldc_version_info
+ 	mkdir -p bin/
+ 
+ default debug release static: $(OUT)
+@@ -115,8 +107,6 @@ install:
+ 	install -m 0755 bin/sambamba $(prefix)/bin
+ 
+ clean: clean-d
+-	cd htslib ; $(MAKE) clean
+-	rm lz4/lib/*.[oa]
+ 	rm -f profile.data
+ 	rm -f profile.raw
+ 


=====================================
debian/patches/sam_hdr_parse_2sam_hdr_parse.patch
=====================================
@@ -0,0 +1,38 @@
+Index: sambamba/cram/writer.d
+===================================================================
+--- sambamba.orig/cram/writer.d
++++ sambamba/cram/writer.d
+@@ -52,11 +52,7 @@ final class CramWriter {
+     }
+ 
+     void writeSamHeader(SamHeader header) {
+-        writeSamHeader(header.text);
+-    }
+-
+-    void writeSamHeader(string header_text) {
+-        auto hdr = sam_hdr_parse_(header_text.ptr, cast(int)header_text.length);
++        auto hdr = sam_hdr_parse( cast(int)header.text.length, cast(const(char)*)header.text);
+         if (cram_set_header(_fd, hdr) < 0)
+             throw new CramException("Failed to set SAM header");
+         if (_reference_fn !is null)
+Index: sambamba/cram/htslib.d
+===================================================================
+--- sambamba.orig/cram/htslib.d
++++ sambamba/cram/htslib.d
+@@ -1307,7 +1307,7 @@ hts_idx_t* sam_index_load (htsFile* fp,
+ hts_itr_t* sam_itr_queryi (const(hts_idx_t)* idx, int tid, int beg, int end);
+ hts_itr_t* sam_itr_querys (const(hts_idx_t)* idx, bam_hdr_t* hdr, const(char)* region);
+ int sam_open_mode (char* mode, const(char)* fn, const(char)* format);
+-bam_hdr_t* sam_hdr_parse (int l_text, const(char)* text);
++SAM_hdr* sam_hdr_parse (int l_text, const(char)* text);
+ bam_hdr_t* sam_hdr_read (samFile* fp);
+ int sam_hdr_write (samFile* fp, const(bam_hdr_t)* h);
+ int sam_parse1 (kstring_t* s, bam_hdr_t* h, bam1_t* b);
+@@ -1379,7 +1379,6 @@ int kh_resize_m_s2i (kh_m_s2i_t* h, khin
+ khint_t kh_put_m_s2i (kh_m_s2i_t* h, kh_cstr_t key, int* ret);
+ void kh_del_m_s2i (kh_m_s2i_t* h, khint_t x);
+ SAM_hdr* sam_hdr_new ();
+-SAM_hdr* sam_hdr_parse_ (const(char)* hdr, int len);
+ SAM_hdr* sam_hdr_dup (SAM_hdr* hdr);
+ void sam_hdr_incr_ref (SAM_hdr* hdr);
+ void sam_hdr_decr_ref (SAM_hdr* hdr);


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,5 @@
 01_add-meson-build.patch
 02_disable-assert.patch
 2to3.patch
+MakefilePointerToStaticLib.patch
+sam_hdr_parse_2sam_hdr_parse.patch


=====================================
debian/rules
=====================================
@@ -4,14 +4,18 @@
 include /usr/share/dh-dlang/dlang-flags.mk
 
 %:
+	mkdir -p obj-$(shell dpkg-architecture -qDEB_TARGET_GNU_TYPE)
 	dh $@ --buildsystem=meson
 
 override_dh_auto_configure:
-	dh_auto_configure -- -Doptimize_strong=true
+	dh_auto_configure -- -Doptimize_strong=true -Dcpp_link_args="-wi -L=-z -L=relro -L=/usr/lib/x86_64-linux-gnu/libbiod.a /usr/lib/x86_64-linux-gnu/libhts.a -L=-lz -L=-lcrypto -L=-lcurl -L=-llzma -L=-lbz2 -L=-ldeflate -L=-llz4"
 
 override_dh_missing:
 	dh_missing --fail-missing
 
 override_dh_auto_clean:
 	dh_auto_clean
-	-rm -r $(CURDIR)/output/
+	rm -rf $(CURDIR)/output/
+
+override_dh_auto_test:
+	# tests seem broken



View it on GitLab: https://salsa.debian.org/med-team/sambamba/-/commit/2150d5b1727ef90696999428a0641dc9e6070969

-- 
View it on GitLab: https://salsa.debian.org/med-team/sambamba/-/commit/2150d5b1727ef90696999428a0641dc9e6070969
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/1dec1e20/attachment-0001.html>


More information about the debian-med-commit mailing list