[Debian-med-packaging] Bug#867017: src:python-pysam: FTBFS during rebuild for python3.6 transition

Steve Langasek steve.langasek at canonical.com
Fri Jul 28 17:45:42 UTC 2017


Package: python-pysam
Version: 0.10.0+ds-2
Followup-For: Bug #867017
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Hi folks,

I've looked into updating python-pysam to the new upstream version to
correct the issue with htslib 1.4 compatibility.  The existing patches
against upstream can/must all be dropped, but an additional patch is needed
for the new upstream to ensure proper linkage of all the .so's.

Please find attached a debdiff against the packaging to allow an update to
pysam 0.11.2.  I have uploaded this debdiff to Ubuntu, where it is now
building.

By way of explanation, here is the accompanying changelog for that upload:

  * New upstream release.
    - Fixes compatibility with htslib 1.4.  Closes: #867017, LP: #1701268.
  * debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch:
    drop, fixed upstream.
  * debian/patches/rpath.patch: drop, this actually now breaks the libraries
    which need to find one another on the path.
  * debian/patches/htslib-external-config.patch: drop, the
    HTSLIB_MODE=external already ensures we aren't using the internal copy.
  * debian/patches/pysam_stdout_linkage.patch: fix missing symbols in
    libcsamtools and libcbcftools libraries.

Hope that helps,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru python-pysam-0.10.0+ds/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch python-pysam-0.11.2.2/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch
--- python-pysam-0.10.0+ds/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch	2017-05-04 06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/exclude_test_tyring_to_access_remote_ftpserver.patch	1969-12-31 16:00:00.000000000 -0800
@@ -1,29 +0,0 @@
-Description: Exclude test tyring to access remote ftpserver
-Bug-Debian: https://bugs.debian.org/861496
-Author: Andreas Tille <tille at 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 -Nru python-pysam-0.10.0+ds/debian/patches/htslib-external-config.patch python-pysam-0.11.2.2/debian/patches/htslib-external-config.patch
--- python-pysam-0.10.0+ds/debian/patches/htslib-external-config.patch	2017-05-04 06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/htslib-external-config.patch	1969-12-31 16:00:00.000000000 -0800
@@ -1,15 +0,0 @@
-Description: Do not use internal htslib library
-Author: Afif Elghraoui <afif at debian.org>
-Forwarded: not-needed
-Last-Update: 2017-01-26
---- python-pysam.orig/setup.py
-+++ python-pysam/setup.py
-@@ -255,7 +255,7 @@
- else:
-     raise ValueError("unknown HTSLIB value '%s'" % HTSLIB_MODE)
- 
--internal_htslib_libraries = [os.path.splitext("chtslib{}".format(sysconfig.get_config_var('SO')))[0]]
-+internal_htslib_libraries = []
- 
- # build config.py
- with open(os.path.join("pysam", "config.py"), "w") as outf:
diff -Nru python-pysam-0.10.0+ds/debian/patches/pysam_stdout_linkage.patch python-pysam-0.11.2.2/debian/patches/pysam_stdout_linkage.patch
--- python-pysam-0.10.0+ds/debian/patches/pysam_stdout_linkage.patch	1969-12-31 16:00:00.000000000 -0800
+++ python-pysam-0.11.2.2/debian/patches/pysam_stdout_linkage.patch	2017-07-28 10:12:35.000000000 -0700
@@ -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 at canonical.com>
+
+Index: python-pysam-0.11.2.2/setup.py
+===================================================================
+--- python-pysam-0.11.2.2.orig/setup.py
++++ python-pysam-0.11.2.2/setup.py
+@@ -463,6 +463,7 @@
+ 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 @@
+     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 -Nru python-pysam-0.10.0+ds/debian/patches/rpath.patch python-pysam-0.11.2.2/debian/patches/rpath.patch
--- python-pysam-0.10.0+ds/debian/patches/rpath.patch	2017-05-04 06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/rpath.patch	1969-12-31 16:00:00.000000000 -0800
@@ -1,32 +0,0 @@
-Description: Disable setting rpath
-Author: Afif Elghraoui <afif at 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)
---- python-pysam.orig/setup.py
-+++ python-pysam/setup.py
-@@ -353,7 +353,6 @@
-     shared_htslib_sources +
-     os_c_files,
-     library_dirs=htslib_library_dirs,
--    runtime_library_dirs=htslib_library_dirs,
-     include_dirs=["pysam", "."] + include_os + htslib_include_dirs,
-     libraries=external_htslib_libraries,
-     language="c",
diff -Nru python-pysam-0.10.0+ds/debian/patches/series python-pysam-0.11.2.2/debian/patches/series
--- python-pysam-0.10.0+ds/debian/patches/series	2017-05-04 06:06:21.000000000 -0700
+++ python-pysam-0.11.2.2/debian/patches/series	2017-07-27 23:49:17.000000000 -0700
@@ -1,3 +1 @@
-rpath.patch
-htslib-external-config.patch
-exclude_test_tyring_to_access_remote_ftpserver.patch
+pysam_stdout_linkage.patch


More information about the Debian-med-packaging mailing list