Commit 01c6541c authored by Liubov Chuprikova's avatar Liubov Chuprikova
Browse files

Modify debian/rules

parent edaf725c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@ Build-Depends: debhelper (>= 11~),
               python3-setuptools,
               default-jdk,
               bowtie2,
               freebayes,
               ncbi-blast+,
               pilon,
               racon,
+12 −19
Original line number Diff line number Diff line
@@ -2,7 +2,16 @@

# DH_VERBOSE := 1

export PYBUILD_NAME=unicycler
# NOTE: All build steps are described in setup.py:UnicyclerInstall

# copy all nacessary data before testing and make clean after the testing
export PYBUILD_BEFORE_TEST=cp -a unicycler-runner.py {build_dir}; \
	cp -a unicycler/cpp_functions.so {build_dir}/unicycler; \
	cp -r sample_data {build_dir}
export PYBUILD_AFTER_TEST=rm {build_dir}/unicycler-runner.py; \
	rm -r {build_dir}/sample_data; \
	rm -r {build_dir}/unicycler/__pycache__


# Build time tests are flaky
export DH_BUILD_MAINT_OPTIONS=nocheck
@@ -15,27 +24,11 @@ include /usr/share/dpkg/default.mk
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_clean:
	echo "Avoid:  command 'UnicyclerClean' has no such option 'all'"
	find . -name "*.o" -delete
	find . -name "*.so" -delete
	find . -name __pycache__ -type d | xargs rm -rf
	rm -rf .pybuild unicycler.egg-info
	make distclean

override_dh_auto_build:
	dh_auto_build
	# building the dynamic library requires extra make call
	make
	# for some reason it also needs to be manually moved
	cp -a unicycler/cpp_functions.so `dirname $$(find .pybuild -name cpp_wrappers.py)`

override_dh_auto_test:
	BUILDPATH=$(shell pybuild --print build_dir --interpreter python3) ; \
	for bp in .pybuild/cpython*$(DEB_SOURCE)/build ; do \
	    ln -s $(CURDIR)/sample_data $${bp} ; \
	    ln -s $(CURDIR)/unicycler-runner.py $${bp} ; \
	    cp -a unicycler/*.so $${bp}/$(PYBUILD_NAME) ; \
	done ; \
	PYTHONPATH=$${BUILDPATH}/$(PYBUILD_NAME) dh_auto_test # || true
	dh_auto_build

override_dh_link:
	dh_link