[med-svn] [Git][med-team/libbio-db-hts-perl][master] 4 commits: Fix t/05vcf.t expected GT values for htslib >= 1.22
Andreas Tille (@tille)
gitlab at salsa.debian.org
Mon Sep 21 16:40:54 BST 2026
Andreas Tille pushed to branch master at Debian Med / libbio-db-hts-perl
Commits:
9f1d3de1 by Andreas Tille at 2026-09-21T17:06:00+02:00
Fix t/05vcf.t expected GT values for htslib >= 1.22
htslib 1.22 changed the GT encoding for VCF < 4.4 input and BCF files:
the phasing bit of the first allele is now set correctly. Update the
hard-coded expected GT values in t/05vcf.t accordingly.
- - - - -
6abb92f7 by Andreas Tille at 2026-09-21T17:07:08+02:00
Htslib will be found thus completely remove unneeded patch
- - - - -
4cb4f5e3 by Andreas Tille at 2026-09-21T17:29:53+02:00
remove_rpath.patch: drop DT_RUNPATH injection to fix lintian custom-library-search-path error
- - - - -
1b1cc575 by Andreas Tille at 2026-09-21T17:31:53+02:00
Upload to unstable
- - - - -
5 changed files:
- debian/changelog
- − debian/patches/find_htslib.patch
- + debian/patches/fix_vcf_gt_test.patch
- + debian/patches/remove_rpath.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,13 +1,16 @@
-libbio-db-hts-perl (3.02-1) UNRELEASED; urgency=medium
+libbio-db-hts-perl (3.02-1) unstable; urgency=medium
* Point watch file to Github since there is a new tag which is missing
at CPAN
* New upstream version
+ * Fix t/05vcf.t expected GT values for htslib >= 1.22
+ * remove_rpath.patch: drop DT_RUNPATH injection to fix lintian
+ custom-library-search-path error
* Standards-Version: 4.7.4 (routine-update)
* Remove Priority field (cme)
* debputy lint --auto-fix (routine-update)
- -- Andreas Tille <tille at debian.org> Mon, 21 Sep 2026 13:39:48 +0200
+ -- Andreas Tille <tille at debian.org> Mon, 21 Sep 2026 17:30:26 +0200
libbio-db-hts-perl (3.01-6) unstable; urgency=medium
=====================================
debian/patches/find_htslib.patch deleted
=====================================
@@ -1,134 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: 2019-07-10
-Description: Take over changes in Build.PL from commit 83c9327 to make sure htslib will be found
-
---- a/Build.PL
-+++ b/Build.PL
-@@ -1,6 +1,6 @@
- #!/usr/bin/perl
-
--# Copyright [2015-2018] EMBL-European Bioinformatics Institute
-+# Copyright [2015-2019] EMBL-European Bioinformatics Institute
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
-@@ -75,7 +75,15 @@ sub find_hts {
- # If either of these are set, we expect to find the htslib files there:
- # (They're explicitly set by the user, so we shouldn't fall back to
- # finding another copy somewhere else.)
-- if (my $dir = $self->args('htslib')) {
-+ my $incdir = $self->args('htslib-includedir');
-+ my $libdir = $self->args('htslib-libdir');
-+ if ($incdir && $libdir) {
-+ return 1 if $self->find_hts_in_split_install_dirs($incdir, $libdir);
-+ $self->die_hts_not_found(
-+ "--htslib-includedir '$incdir' or --htslib-libdir '$libdir' command line parameters do not contain expected files\n"
-+ );
-+ }
-+ elsif (my $dir = $self->args('htslib')) {
- return 1 if $self->find_hts_in_build_dir($dir);
- return 1 if $self->find_hts_in_install_dir($dir);
- $self->die_hts_not_found(
-@@ -105,6 +113,9 @@ sub find_hts {
- }
- return 1 if $found;
-
-+ # Try pkgconfig again but this time trust whatever it returns, without extra verification
-+ return 1 if $self->find_hts_with_pkgconfig();
-+
- $self->die_hts_not_found();
- }
-
-@@ -114,12 +125,14 @@ sub set_include_and_compiler_flags {
- my $hts_include = $self->config_data('hts_include');
- my $hts_lib = $self->config_data('hts_lib');
- my $static = $self->args('static');
-- $self->include_dirs([$hts_include]);
-- if($static){
-- $self->extra_linker_flags("-L$hts_lib", '-lhts', '-lpthread', '-lz');
-- }else{
-- $self->extra_linker_flags("-L$hts_lib", "-Wl,-rpath,$hts_lib", '-lhts', '-lpthread', '-lz');
-+
-+ $self->include_dirs([$hts_include]) if $hts_include;
-+
-+ my @linker_dirflags;
-+ if ($hts_lib) {
-+ push @linker_dirflags, "-L$hts_lib";
- }
-+ $self->extra_linker_flags(@linker_dirflags, '-lhts', '-lpthread', '-lz');
- }
-
- sub hts_dev_files_exist {
-@@ -165,6 +178,48 @@ sub find_hts_in_install_dir {
- }
- }
-
-+sub find_hts_in_split_install_dirs {
-+ my ($self, $hts_include, $hts_lib) = @_;
-+
-+ chomp($hts_lib);
-+ chomp($hts_include);
-+ $hts_include =~ s{include/htslib$}{include};
-+
-+ if (hts_dev_files_exist($hts_lib, $hts_include)) {
-+ $self->config_data('hts_lib' => $hts_lib);
-+ $self->config_data('hts_include' => $hts_include);
-+ return 1;
-+ }
-+ else {
-+ return 0;
-+ }
-+}
-+
-+sub find_hts_with_pkgconfig {
-+ my ($self) = @_;
-+
-+ return 0 unless can_load(
-+ modules => { 'ExtUtils::PkgConfig' => undef }
-+ );
-+ my $pkg_name = 'htslib';
-+ return 0 unless ExtUtils::PkgConfig->exists($pkg_name);
-+
-+ if (my $libs_only_L = ExtUtils::PkgConfig->libs_only_L($pkg_name)) {
-+ # For compatibility with other htslib search methods. Note that this
-+ # assumes there will be at most one each of -I/-L directories, which
-+ # is true as of htslib-1.5 but might change in the future.
-+ $libs_only_L =~ s{^-L}{};
-+ $self->config_data('hts_lib' => $libs_only_L);
-+ }
-+ if (my $cflags_only_I = ExtUtils::PkgConfig->cflags_only_I($pkg_name)) {
-+ # See above
-+ $cflags_only_I =~ s{^-I}{};
-+ $self->config_data('hts_include' => $cflags_only_I);
-+ }
-+
-+ return 1;
-+}
-+
- sub die_hts_not_found {
- my ($self, $msg) = @_;
-
-@@ -177,12 +232,17 @@ Install it if you have not done so alrea
- This script will attempt to locate HTSlib by looking for htslib/hts.h
- and libhts.a / libhts.so in:
-
-- 1. --htslib command line argument
-- 2. HTSLIB_DIR environment variable
-- 3. --prefix command line argument (which also sets installation location)
-- 4. Alien::HTSlib dependency resolver
-- 5. pkg-config (extra directories can be set in PKG_CONFIG_PATH environment variable)
-- 6. common library locations: /usr /usr/local, /usr/share, /opt/local
-+ 1. --htslib-includedir and --htslib-libdir command line arguments
-+ 2. --htslib command line argument
-+ 3. HTSLIB_DIR environment variable
-+ 4. --prefix command line argument (which also sets installation location)
-+ 5. Alien::HTSlib dependency resolver
-+ 6. pkg-config (extra directories can be set in PKG_CONFIG_PATH environment variable)
-+ 7. common library locations: /usr /usr/local, /usr/share, /opt/local
-+
-+If none of the above succeeds but htslib is registered with pkg-config, the script
-+will try using pkg-config paths (via ExtUtils::PkgConfig) without checking if header
-+and library files exist.
-
- END
-
=====================================
debian/patches/fix_vcf_gt_test.patch
=====================================
@@ -0,0 +1,118 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-21
+Description: Update GT values expected by t/05vcf.t for htslib >= 1.22
+ htslib >= 1.22 fixed the encoding of the first allele of a phased
+ genotype (the phasing bit of the first allele is now set correctly
+ for VCF < 4.4 input and BCF files). The t/05vcf.t test hard-coded
+ the old, incorrect GT values, so it failed with the latest htslib.
+ This patch updates the expected GT values to match the new, spec
+ conformant encoding.
+
+--- a/t/05vcf.t
++++ b/t/05vcf.t
+@@ -138,11 +138,11 @@
+ is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ;
+
+ # format related tests
+- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read');
++ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read');
+ is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read');
+ is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present');
+ is_deeply($row->get_format($h), {
+- GT => [2, 3, 2, 3, 2, 4],
++ GT => [3, 3, 3, 3, 2, 4],
+ HQ => [10, 10, 10, 10, 3, 3]
+ }, "format read");
+
+@@ -164,11 +164,11 @@
+ is_deeply($info_result, {}, 'info read correctly');
+
+ # format related tests
+- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read');
++ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read');
+ is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read');
+ is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format id not present');
+ is_deeply($row->get_format($h), {
+- GT => [2, 3, 2, 3, 2, 4],
++ GT => [3, 3, 3, 3, 2, 4],
+ HQ => [10, 10, 10, 10, 3, 3]
+ }, "format read");
+
+@@ -176,13 +176,13 @@
+ ok $row = $v->next(), "Next row";
+ is $row->chromosome($h), "20", "Chromosome value read" ;
+ is $row->get_format_type($h,"DP"), "Integer", "int format type correct";
+- is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], "format int read");
++ is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], "format int read");
+ is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read');
+ is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read');
+ note "!!! Not sure this is correct !!!";
+ is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read');
+ is_deeply($row->get_format($h), {
+- GT => [2,3,4,3,4,4],
++ GT => [3,3,5,3,4,4],
+ GQ => [48,48,43],
+ DP => [1,8,5],
+ HQ => [51,51,51,51,'-2147483648','-2147483648']
+@@ -191,7 +191,7 @@
+ my $fmt_result = $row->get_genotypes($h) ;
+ isa_ok($fmt_result, 'ARRAY');
+ #TODO resolve how these translate to the strings in htslib
+- is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ;
++ is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ;
+ is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found';
+ is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found';
+ $info_result = $row->get_info($h);
+@@ -310,11 +310,11 @@
+ is $row->get_info_type($h,"NS"), "Integer", "info int type correct" ;
+
+ # format related tests
+- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read');
++ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read');
+ is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read');
+ is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present');
+ is_deeply($row->get_format($h), {
+- GT => [2, 3, 2, 3, 2, 4],
++ GT => [3, 3, 3, 3, 2, 4],
+ HQ => [10, 10, 10, 10, 3, 3]
+ }, "format read");
+
+@@ -336,11 +336,11 @@
+ is_deeply($info_result, {}, 'info read correctly');
+
+ # format related tests
+- is_deeply($row->get_format($h, "GT"), [2, 3, 2, 3, 2, 4], 'format int read');
++ is_deeply($row->get_format($h, "GT"), [3, 3, 3, 3, 2, 4], 'format int read');
+ is_deeply($row->get_format($h, "HQ"), [10, 10, 10, 10, 3, 3], 'format int read');
+ is($row->get_format($h, "INVALID"), "ID_NOT_FOUND", 'format ID not present');
+ is_deeply($row->get_format($h), {
+- GT => [2, 3, 2, 3, 2, 4],
++ GT => [3, 3, 3, 3, 2, 4],
+ HQ => [10, 10, 10, 10, 3, 3]
+ }, "format read");
+
+@@ -348,13 +348,13 @@
+ ok $row = $v->next(), "Next row";
+ is $row->chromosome($h), "20", "Chromosome value read" ;
+ is $row->get_format_type($h,"DP"), "Integer", "int format type correct" ;
+- is_deeply($row->get_format($h, "GT"), [2,3,4,3,4,4], 'format int read');
++ is_deeply($row->get_format($h, "GT"), [3,3,5,3,4,4], 'format int read');
+ is_deeply($row->get_format($h, "GQ"), [48,48,43], 'format int read');
+ is_deeply($row->get_format($h, "DP"), [1,8,5], 'format int read');
+ note "!!! Not sure this is correct !!!";
+ is_deeply($row->get_format($h, "HQ"), [51,51,51,51,'-2147483648','-2147483648'], 'format int read');
+ is_deeply($row->get_format($h), {
+- GT => [2,3,4,3,4,4],
++ GT => [3,3,5,3,4,4],
+ GQ => [48,48,43],
+ DP => [1,8,5],
+ HQ => [51,51,51,51,'-2147483648','-2147483648']
+@@ -363,7 +363,7 @@
+ my $fmt_result = $row->get_genotypes($h) ;
+ isa_ok($fmt_result, 'ARRAY');
+ # TODO resolve how these translate to the strings in htslib
+- is_deeply $fmt_result, [2,3,4,3,4,4], 'genotypes read correctly' ;
++ is_deeply $fmt_result, [3,3,5,3,4,4], 'genotypes read correctly' ;
+ is $row->get_format($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'format id not found';
+ is $row->get_info($h,"IDONTEXIST"), 'ID_NOT_FOUND', 'info id not found';
+ $info_result = $row->get_info($h);
=====================================
debian/patches/remove_rpath.patch
=====================================
@@ -0,0 +1,19 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2026-09-21
+Description: Remove DT_RUNPATH injection from Build.PL
+ Debian builds against the system htslib in the standard library
+ directory, so the -Wl,-rpath linker flag injected by upstream
+ Build.PL points to a default library search path and triggers the
+ lintian error custom-library-search-path. The RUNPATH is not
+ needed in Debian.
+
+--- a/Build.PL
++++ b/Build.PL
+@@ -131,7 +131,6 @@
+ my @linker_dirflags;
+ if ($hts_lib) {
+ push @linker_dirflags, "-L$hts_lib";
+- push @linker_dirflags, "-Wl,-rpath,$hts_lib" unless $static;
+ }
+ $self->extra_linker_flags(@linker_dirflags, '-lhts', '-lpthread', '-lz');
+ }
=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
-# find_htslib.patch
+fix_vcf_gt_test.patch
+remove_rpath.patch
View it on GitLab: https://salsa.debian.org/med-team/libbio-db-hts-perl/-/compare/dcb62ddf67b3817fdc4970739ab89878d103a945...1b1cc575e17d77b4434af32dfabc0849d583c83c
--
View it on GitLab: https://salsa.debian.org/med-team/libbio-db-hts-perl/-/compare/dcb62ddf67b3817fdc4970739ab89878d103a945...1b1cc575e17d77b4434af32dfabc0849d583c83c
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260921/d100d6cf/attachment-0001.htm>
More information about the debian-med-commit
mailing list