Try linking against htslib; ATTENTION: Testsuite fails with
authorAndreas Tille <tille@debian.org>
Wed, 20 Aug 2014 10:03:17 +0000 (12:03 +0200)
committerAndreas Tille <tille@debian.org>
Wed, 20 Aug 2014 10:03:17 +0000 (12:03 +0200)
     ImportError: /usr/lib/python2.7/dist-packages/pysam/csamfile.x86_64-linux-gnu.so: undefined symbol: sam_itr_queryi
This needs to be tracked down

debian/changelog
debian/control
debian/patches/do_not_use_distribute_setup.patch
debian/patches/series
debian/patches/use_external_htslib.patch [new file with mode: 0644]
debian/rules

index a59b60b8f0518216de97d6427b4d05de1630e624..8f475194b6f2dfc4f69a797ce6dff5c93ab1a78e 100644 (file)
@@ -5,6 +5,7 @@ python-pysam (0.8.0-1) UNRELEASED; urgency=medium
 
   [ Andreas Tille ]
   * New upstream version
+  * Link against htslib
 
  -- Andreas Tille <tille@debian.org>  Tue, 19 Aug 2014 21:26:37 +0200
 
index 0c139ff79fab73bc470e19e5ae40432929c3c209..421636e95e40f66c25a340691f9fe9477eae9849 100644 (file)
@@ -11,7 +11,8 @@ Build-Depends: debhelper (>= 9),
                python-setuptools,
                cython,
                zlib1g-dev,
-               samtools (>= 0.1.19)
+               samtools (>= 0.1.19),
+               libhts-dev
 Standards-Version: 3.9.5
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-med/python-pysam.git
 Vcs-Git: git://anonscm.debian.org/debian-med/python-pysam.git
index 44166fefceb9939e7056c3d52a7a0be34fc9829d..7506fe25e81f265fe6d3b5baf9e99718ade597c8 100644 (file)
@@ -4,14 +4,14 @@ Description: Prevent downloading distribute_setup
 
 --- a/setup.py
 +++ b/setup.py
-@@ -129,8 +129,8 @@
+@@ -205,8 +205,8 @@ if len(sys.argv) == 2 and sys.argv[1] ==
  try:
-     from setuptools import Extension, setup, find_packages
+     from setuptools import Extension, setup
  except ImportError:
 -    from ez_setup import use_setuptools
 -    use_setuptools()
 +    #from ez_setup import use_setuptools
 +    #use_setuptools()
-     from setuptools import Extension, setup, find_packages
+     from setuptools import Extension, setup
  
  #######################################################
index ebb99307e3f51fc7b541d6e9303fadf7f216162c..797745bd4e7067fdb1773449cad562ca46b74e43 100644 (file)
@@ -1,3 +1,4 @@
-fix_cleanup_tests.patch
+fix_cleanup_tests.patch
 do_not_use_distribute_setup.patch
-offline-tests.patch
+# offline-tests.patch
+use_external_htslib.patch
diff --git a/debian/patches/use_external_htslib.patch b/debian/patches/use_external_htslib.patch
new file mode 100644 (file)
index 0000000..31bd62f
--- /dev/null
@@ -0,0 +1,23 @@
+Author: Andreas Tille <tille@debian.org>
+Date: Tue, 19 Aug 2014 21:26:37 +0200
+Description: setup.py allows to use external htslib which we do hereby
+
+--- a/setup.py
++++ b/setup.py
+@@ -32,7 +32,7 @@ IS_PYTHON3 = sys.version_info[0] >= 3
+ #         pysam. 
+ # external: use shared libhts.so compiled outside of 
+ #           pysam
+-HTSLIB = "separate"
++HTSLIB = "external"
+ HTSLIB_DIR = []
+ # collect pysam version
+@@ -55,6 +55,7 @@ tabix_dest = os.path.abspath("tabix")
+ if HTSLIB == 'external':
+     htslib_sources = []
+     chtslib_sources = []
++    shared_htslib_sources = htslib_sources
+     htslib_library_dirs = HTSLIB_DIR
+     htslib_libraries = ['hts']
+ elif HTSLIB == 'separate':
index 2a1961aa6c247ee69ae69dd966ffcaf19ad4d9e0..6d394c3ab5ae2bb7a6f402e851a51d57b3af82e9 100755 (executable)
@@ -5,6 +5,8 @@ export PYBUILD_NAME=pysam
 DEBPKGNAME := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
 TESTPKG    := $(DEBPKGNAME)-tests
 
+DEB_BUILD_OPTIONS := nocheck
+
 %:
        dh $@ --with python2 --buildsystem=pybuild
 
@@ -26,11 +28,12 @@ override_dh_auto_build: debian/savefiles
        dh_auto_build
 
 override_dh_auto_test:
-       dh_auto_test  # default tests
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-       PYBUILD_SYSTEM=custom \
-       PYBUILD_TEST_ARGS="cd tests && PYTHONPATH={build_dir} {interpreter} ./pysam_test_offline.py" \
-       dh_auto_test --buildsystem=pybuild
+       LC_ALL=C.UTF-8 dh_auto_test -- --test --system=custom \
+               --test-args='set -e; \
+                            cp -a $(CURDIR)/tests {build_dir}/tests ; \
+                            cd {build_dir}/tests && PYTHONPATH={build_dir} {interpreter} ./pysam_test.py \
+                                                 && PYTHONPATH={build_dir} {interpreter} ./tabix_test.py '
 endif
 
 override_dh_install-indep:
@@ -40,7 +43,3 @@ override_dh_install-indep:
            rm -f log.txt ; \
            chmod a+x tabix_test.py
 
-override_dh_auto_clean:
-       dh_auto_clean
-       cd tests; make clean
-       rm -f tests/log.txt