[med-svn] [blasr] 02/02: WIP: build bax2bam and bam2bax

Afif Elghraoui afif at moszumanska.debian.org
Tue Nov 1 07:25:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

afif pushed a commit to branch topic/more-utils
in repository blasr.

commit d3a29b581606ffa56518d76a305c8d58db85dd47
Author: Afif Elghraoui <afif at debian.org>
Date:   Tue Nov 1 00:24:19 2016 -0700

    WIP: build bax2bam and bam2bax
    
    These two programs have their own build systems, so somewhat
    complicate the packaging. bam2bax in particular requires
    pbseqlib to be compiled with pbbam.
---
 debian/control                     |  2 ++
 debian/install                     |  2 ++
 debian/patches/cmake-utils.patch   | 22 ++++++++++++++++++++
 debian/patches/disable-gtest.patch | 22 ++++++++++++++++++++
 debian/patches/series              |  2 ++
 debian/rules                       | 42 ++++++++++++++++++++++++++++++++------
 6 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/debian/control b/debian/control
index 4a848b7..1ca7be4 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,8 @@ Uploaders: Afif Elghraoui <afif at debian.org>
 Build-Depends:
 	debhelper (>= 9),
 	python,
+	cmake,
+	libboost-dev,
 	libhdf5-dev,
 	zlib1g-dev,
 	libblasr-dev,
diff --git a/debian/install b/debian/install
index 5bc54f4..35c29dc 100644
--- a/debian/install
+++ b/debian/install
@@ -7,3 +7,5 @@ utils/samFilter		usr/bin
 utils/toAfg		usr/bin
 utils/sawriter		usr/bin
 utils/sdpMatcher	usr/bin
+utils/bax2bam/bin/*	usr/bin
+utils/bam2bax/bin/*	usr/bin
diff --git a/debian/patches/cmake-utils.patch b/debian/patches/cmake-utils.patch
new file mode 100644
index 0000000..1d48d4f
--- /dev/null
+++ b/debian/patches/cmake-utils.patch
@@ -0,0 +1,22 @@
+--- blasr.orig/utils/bax2bam/makefile
++++ blasr/utils/bax2bam/makefile
+@@ -7,7 +7,7 @@
+ all: ${CURDIR}/src/* ${CURDIR}/tests/src/*
+ 	@mkdir -p ${CURDIR}/build && \
+ 	 cd ${CURDIR}/build && \
+-		cmake -DBOOST_ROOT=${BOOST_ROOT} \
++		cmake -DBoost_INCLUDE_DIRS=${BOOST_INC} \
+           -DPacBioBAM_INCLUDE_DIRS=${PBBAM_INC} \
+           -DHTSLIB_INCLUDE_DIRS=${HTSLIB_INC} \
+           -DPacBioBAM_LIBRARIES=${PBBAM_LIB}/libpbbam${SH_LIB_EXT} \
+--- blasr.orig/utils/bam2bax/makefile
++++ blasr/utils/bam2bax/makefile
+@@ -7,7 +7,7 @@
+ all: ${CURDIR}/src/*.cpp ${CURDIR}/src/*.h  ${CURDIR}/tests/src/*.cpp ${CURDIR}/tests/src/*.h
+ 	@mkdir -p ${CURDIR}/build && \
+ 	 cd ${CURDIR}/build && \
+-		cmake -DBOOST_ROOT=${BOOST_ROOT} \
++		cmake -DBoost_INCLUDE_DIRS=${BOOST_INC} \
+           -DPacBioBAM_INCLUDE_DIRS=${PBBAM_INC} \
+           -DHTSLIB_INCLUDE_DIRS=${HTSLIB_INC} \
+           -DPacBioBAM_LIBRARIES=${PBBAM_LIB}/libpbbam${SH_LIB_EXT} \
diff --git a/debian/patches/disable-gtest.patch b/debian/patches/disable-gtest.patch
new file mode 100644
index 0000000..d11549f
--- /dev/null
+++ b/debian/patches/disable-gtest.patch
@@ -0,0 +1,22 @@
+--- blasr.orig/utils/bam2bax/CMakeLists.txt
++++ blasr/utils/bam2bax/CMakeLists.txt
+@@ -14,7 +14,7 @@
+ )
+ 
+ # build-time options
+-option(Bam2Bax_build_tests "Build Bam2Bax's unit tests." ON)
++option(Bam2Bax_build_tests "Build Bam2Bax's unit tests." OFF)
+ 
+ # main project paths
+ set(Bam2Bax_RootDir       ${Bam2Bax_SOURCE_DIR})
+--- blasr.orig/utils/bax2bam/CMakeLists.txt
++++ blasr/utils/bax2bam/CMakeLists.txt
+@@ -14,7 +14,7 @@
+ )
+ 
+ # build-time options
+-option(Bax2BAM_build_tests "Build Bax2BAM's unit tests." ON)
++option(Bax2BAM_build_tests "Build Bax2BAM's unit tests." OFF)
+ 
+ # main project paths
+ set(Bax2Bam_RootDir       ${Bax2Bam_SOURCE_DIR})
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..0f16b2d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+disable-gtest.patch
+cmake-utils.patch
diff --git a/debian/rules b/debian/rules
index eb33f93..823ec30 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,14 +2,26 @@
 
 include /usr/share/dpkg/default.mk
 
+export VERBOSE=1 # for cmake
+export SH_LIB_EXT=.so
+
 export HDF5_INC=/usr/include/hdf5/serial
 export HDF5_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
-
-PBSEQ_BASE=/usr/include/pbseq
-export LIBBLASR_INC=$(PBSEQ_BASE)/alignment
-export LIBPBDATA_INC=$(PBSEQ_BASE)/pbdata
-export LIBPBIHDF_INC=$(PBSEQ_BASE)/hdf
-
+export BOOST_INC=/usr/include/boost
+export HTSLIB_INC=/usr/include/htslib
+export HTSLIB_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)
+export PBBAM_INC=/usr/include
+export PBBAM_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)
+export PBDATA_ROOT_DIR=/usr/include/pbseq
+export LIBBLASR_INC=$(PBDATA_ROOT_DIR)/alignment
+export LIBBLASR_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)
+export LIBPBDATA_INC=$(PBDATA_ROOT_DIR)/pbdata
+export LIBPBDATA_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)
+export LIBPBIHDF_INC=$(PBDATA_ROOT_DIR)/hdf
+export LIBPBIHDF_LIB=/usr/lib/$(DEB_HOST_MULTIARCH)
+
+# CPPFLAGS apparently aren't exported for bam2bax/bax2bam
+export DEB_CXXFLAGS_MAINT_PREPEND = $(CPPFLAGS) -I$(PBDATA_ROOT_DIR)
 
 %:
 	dh $@ --parallel
@@ -17,10 +29,28 @@ export LIBPBIHDF_INC=$(PBSEQ_BASE)/hdf
 override_dh_auto_configure:
 	./configure.py --shared
 
+override_dh_auto_build: main bax2bam bam2bax;
+
+.PHONY: main
+main:
+	dh_auto_build
+
+.PHONY: bax2bam
+bax2bam: utils/bax2bax/bin/bax2bam
+utils/bax2bax/bin/bax2bam:
+	$(MAKE) -C utils/bax2bam
+
+.PHONY: bam2bax
+bam2bax: utils/bam2bax/bin/bam2bax
+utils/bam2bax/bin/bam2bax:
+	$(MAKE) -C utils/bam2bax
+
 # Tests require data not available in the source distribution
 override_dh_auto_test: ;
 
 override_dh_auto_clean: override_dh_auto_configure
 	$(MAKE) clean
+	$(MAKE) -C utils/bam2bax clean
+	$(MAKE) -C utils/bax2bam clean
 	# This is created by configure.py
 	$(RM) defines.mk

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/blasr.git



More information about the debian-med-commit mailing list