Apply patches suggested by Steve Langasek
authorAndreas Tille <tille@debian.org>
Sat, 29 Jul 2017 06:30:28 +0000 (08:30 +0200)
committerAndreas Tille <tille@debian.org>
Sat, 29 Jul 2017 06:30:28 +0000 (08:30 +0200)
debian/changelog
debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch [new file with mode: 0644]
debian/patches/htslib-external-config.patch [deleted file]
debian/patches/no-usage-test-without-tty.patch [new file with mode: 0644]
debian/patches/pysam_stdout_linkage.patch [new file with mode: 0644]
debian/patches/rpath.patch [deleted file]
debian/patches/series

index 31951a446ca0262649752bbca01c174bdfb36c25..2dad5e4af20d7ef1c1f90f434f6b751a2df944f5 100644 (file)
@@ -1,8 +1,13 @@
 python-pysam (0.11.2.2+ds-1) UNRELEASED; urgency=medium
 
+  [ Afif Elghraoui ]
   * Imported Upstream version 0.11.2.2+ds
   * Update patches
 
+  [ Andreas Tille ]
+  * Apply patches suggested by Steve Langasek (thanks for this Steve)
+    Closes: #867017, LP: #1701268
+
  -- Afif Elghraoui <afif@debian.org>  Sun, 02 Jul 2017 04:09:14 -0400
 
 python-pysam (0.10.0+ds-2) unstable; urgency=medium
diff --git a/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch b/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
new file mode 100644 (file)
index 0000000..33f4a22
--- /dev/null
@@ -0,0 +1,29 @@
+Description: Exclude test tyring to access remote ftpserver
+Bug-Debian: https://bugs.debian.org/861496
+Author: Andreas Tille <tille@debian.org>
+Last-Update: Thu, 04 May 2017 12:50:22 +0200
+
+--- a/tests/faidx_test.py
++++ b/tests/faidx_test.py
+@@ -216,21 +216,5 @@ class TestFastxFileWithEmptySequence(uni
+         self.assertEqual(ref_num, l)
+-class TestRemoteFileFTP(unittest.TestCase):
+-    '''test remote access.
+-    '''
+-
+-    url = "ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/technical/reference/GRCh38_reference_genome/GRCh38_full_analysis_set_plus_decoy_hla.fa"
+-
+-
+-    def testFTPView(self):
+-        if not checkURL(self.url):
+-            return
+-        with pysam.Fastafile(self.url) as f:
+-            self.assertEqual(
+-                len(f.fetch("chr1", 0, 1000)),
+-                1000)
+-
+-
+ if __name__ == "__main__":
+     unittest.main()
diff --git a/debian/patches/htslib-external-config.patch b/debian/patches/htslib-external-config.patch
deleted file mode 100644 (file)
index cf4915f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Description: Do not use internal htslib library
-Author: Afif Elghraoui <afif@debian.org>
-Forwarded: not-needed
-Last-Update: 2017-01-26
---- python-pysam.orig/setup.py
-+++ python-pysam/setup.py
-@@ -263,7 +263,7 @@
- suffix = sysconfig.get_config_var('EXT_SUFFIX')
- if not suffix:
-     suffix = sysconfig.get_config_var('SO')
--internal_htslib_libraries = [os.path.splitext("chtslib{}".format(suffix))[0]]
-+internal_htslib_libraries = []
- internal_tools_libraries = [
-     os.path.splitext("csamtools{}".format(suffix))[0],
diff --git a/debian/patches/no-usage-test-without-tty.patch b/debian/patches/no-usage-test-without-tty.patch
new file mode 100644 (file)
index 0000000..1f95b29
--- /dev/null
@@ -0,0 +1,19 @@
+Description: skip usage() tests on autobuilders
+ The usage() functions check whether stdin is a tty before displaying usage
+ information.  Therefore, we should not test this code when running on an
+ autobuilder without a tty.
+ .
+ Clever allocation of a pty from within the test suite itself for purposes
+ of testing this path is left as an exercise for the reader.
+Author: Steve Langasek <steve.langasek@canonical.com>
+
+--- a/tests/samtools_test.py
++++ b/tests/samtools_test.py
+@@ -245,6 +245,7 @@ class SamtoolsTest(unittest.TestCase):
+             self.check_statement(statement)
+     @unittest.skipIf(sys.platform == "darwin", "not supported, pattern does not match")
++    @unittest.skipIf(not sys.stdin.isatty(), "skipping usage tests, stdin is not a tty")
+     def testUsage(self):
+         if self.executable == "bcftools":
+             # bcftools usage messages end with exit(1)
diff --git a/debian/patches/pysam_stdout_linkage.patch b/debian/patches/pysam_stdout_linkage.patch
new file mode 100644 (file)
index 0000000..9e9b54e
--- /dev/null
@@ -0,0 +1,28 @@
+Description: fix missing symbols in libcsamtools and libcbcftools libraries
+ Building on Ubuntu fails because a couple of the .sos wind up with
+ unresolved references to symbols found elsewhere in the tree.  Fix their
+ linkage so that they load cleanly.
+Author: Steve Langasek <steve.langasek@canonical.com>
+Last-Update: Fri, 28 Jul 2017 10:45:42 -0700
+Bug-Debian: https://bugs.debian.org/867017
+
+--- a/setup.py
++++ b/setup.py
+@@ -463,6 +463,7 @@ cutils = Extension(
+ csamtools = Extension(
+     "pysam.libcsamtools",
+     [source_pattern % "samtools"] +
++    ["pysam/pysam_util.c"] +
+     glob.glob(os.path.join("samtools", "*.pysam.c")) +
+     htslib_sources +
+     os_c_files,
+@@ -484,7 +485,8 @@ cbcftools = Extension(
+     library_dirs=["pysam"] + htslib_library_dirs,
+     include_dirs=["bcftools", "pysam", "."] +
+     include_os + htslib_include_dirs,
+-    libraries=external_htslib_libraries + internal_htslib_libraries,
++    libraries=external_htslib_libraries + internal_htslib_libraries + \
++    [os.path.splitext("csamtools{}".format(suffix))[0]],
+     language="c",
+     extra_compile_args=extra_compile_args,
+     define_macros=define_macros
diff --git a/debian/patches/rpath.patch b/debian/patches/rpath.patch
deleted file mode 100644 (file)
index 9d68920..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Disable setting rpath
-Author: Afif Elghraoui <afif@debian.org>
-Forwarded: not-needed
-Last-Update: 2016-03-05
---- python-pysam.orig/cy_build.py
-+++ python-pysam/cy_build.py
-@@ -57,7 +57,7 @@
-             ext._init_func(ext)
-         if not self.inplace:
--            ext.library_dirs.append(os.path.join(self.build_lib, "pysam"))
-+            pass
-         if sys.platform == 'darwin':
-             relative_module_path = ext.name.replace(".", os.sep) + get_config_vars()["SO"]
-@@ -85,6 +85,5 @@
-             if not ext.extra_link_args:
-                 ext.extra_link_args = []
--            ext.extra_link_args += ['-Wl,-rpath,$ORIGIN']
-                                     
-         build_ext.build_extension(self, ext)
index af88631bc1c353ed3a4d1b207a2dd00e11f4cb61..0aa298facd50dde6cab63438cb78ac63fb58de4b 100644 (file)
@@ -1,2 +1,2 @@
-rpath.patch
-htslib-external-config.patch
+pysam_stdout_linkage.patch
+no-usage-test-without-tty.patch