[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Enabling Python bindings for jellyfish



On Tuesday, December 29, 2015 12:30:14 AM Andreas Tille wrote:
> Hi,
> 
> I realised that for jellyfish[1] Python bindings can be activated.  I
> tried to do so and configuring and building works fine - but I have no
> idea how to sensibly install the files into the python-jellyfish
> package.  Any idea how to call swig/python/setup.py or do something else
> to install the files into the right location.
> 
> Any help?
> 
> Kind regards
> 
>         Andreas.
> 
> [1] git://anonscm.debian.org/debian-med/jellyfish.git

I haven't been able to actually test this since when I try to build it, I get 
this error:

jellyfish_wrap.cxx:3104:33: fatal error: jellyfish/mer_dna.hpp: No such file or 
directory

I think it should ~work.  Note that these bindings are for python3, not 
python.  I've adjusted things accordingly.  The configure changes I made (so 
that configure wouldn't fail) mean perl bindings don't get built either.  I 
didn't check if that was working before.

Scott K
>From 72a9b63d0d8bf4d64614966aed79025c7c7d0fdf Mon Sep 17 00:00:00 2001
From: Scott Kitterman <scott@kitterman.com>
Date: Tue, 29 Dec 2015 10:45:11 -0500
Subject: [PATCH] python binding fixups

---
 debian/changelog | 11 ++++++++++-
 debian/control   |  9 +++++----
 debian/rules     |  9 ++++++++-
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1af4381..17e56d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,17 @@
 jellyfish (2.2.4-3) UNRELEASED; urgency=medium
 
+  [ Andreas Tille ]
   * Enable Python and Perl bindings
 
- -- Andreas Tille <tille@debian.org>  Mon, 28 Dec 2015 22:42:59 +0100
+  [ Scott Kitterman ]
+  * Rename python-jellyfish to python3-jellyfish
+  * Change python-dev build-dep to python3-all-dev (since this is a python3
+    extension)
+  * Add dh-python to build-depends
+  * Add building with python3
+  * Add call to setup.py in dh_autobuild override
+
+ -- Scott Kitterman <scott@kitterman.com>  Tue, 29 Dec 2015 10:43:40 -0500
 
 jellyfish (2.2.4-2) unstable; urgency=medium
 
diff --git a/debian/control b/debian/control
index 63e1bec..3c3d15f 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,8 @@ Build-Depends: debhelper (>= 9),
                procps,
                valgrind,
                swig,
-               python-dev
+               python3-all-dev,
+               dh-python
 Standards-Version: 3.9.6
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/jellyfish.git
 Vcs-Git: git://anonscm.debian.org/debian-med/jellyfish.git
@@ -87,10 +88,10 @@ Description: count k-mers in DNA sequences (development files of jellyfish)
  This package contains the development files (static library and
  header files)
 
-Package: python-jellyfish
-Architecture: all
+Package: python3-jellyfish
+Architecture: any
 Section: python
-Depends: ${python:Depends},
+Depends: ${python3:Depends},
          ${misc:Depends}
 Description: count k-mers in DNA sequences (Python bindings of jellyfish)
  JELLYFISH is a tool for fast, memory-efficient counting of k-mers in
diff --git a/debian/rules b/debian/rules
index 1d1f78a..960a128 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,14 +1,21 @@
 #!/usr/bin/make -f
 
 DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
+build3vers := $(shell py3versions -sv)
 
 export DH_OPTIONS
 
 %:
-	dh $@ --with autoreconf
+	dh $@ --with autoreconf,python3
 
 override_dh_install:
 	# dh_install -X*.a -X*.la -Xpkgconfig
+	dh_install -ppython3-jellyfish
+	set -e && for i in $(build3vers); do \
+	  cd swig/python \
+	  python$$i ./setup.py install --install-layout=deb --root ../../debian/python3-jellyfish; \
+	done
+
 	dh_install
 	d-shlibmove --commit \
 		    --multiarch \
-- 
1.9.1


Reply to: