#!/usr/bin/make -f # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. #export DH_VERBOSE = 1 export PYBUILD_NAME=sasview # SasView insists on writing to ~/sasview.log export HOME = $(CURDIR)/build/ # Force pdflatex to use SOURCE_DATE_EPOCH for \today too export FORCE_SOURCE_DATE = 1 # Skip test that needs unpackaged external library export PYBUILD_TEST_ARGS = -v -s -k "not test_debye_impl" test %: dh $@ --with python3,sphinxdoc,numpy3 --buildsystem=pybuild execute_after_dh_auto_clean: # clean up tests find test -name logs -type d -exec rm -rf {} + execute_before_dh_auto_build: cp -r /usr/lib/python3/dist-packages/sasdata/example_data/* src/sas/example_data/ # help setuptools find the data files (this should not be necessary) for d in `find src/sas/ -type d`; do \ if [ ! -f $$d/__init__.py ]; then \ touch $$d/__init__.py; \ if ! grep -q $$d/__init__.py debian/clean; then \ echo $$d/__init__.py >> debian/clean; \ fi; \ fi; \ done execute_after_dh_auto_build: # reassemble the docs from dependent packages to make the overall ./debian/fetchdocs mkdir build SASVIEW_BUILD=`pybuild --print build_dir -i python3` \ PYTHONPATH=`pybuild --print build_dir -i python3` \ xvfb-run -a --server-args='-screen 0 1024x768x24' \ python3 setup.py docs update # Strip absolute build paths from HTML documentation mkdir -p docs/sphinx-docs/build/html/_static/ find -type f -name '*.html' -print0 | \ xargs -0r sed -i -e "s@$(CURDIR)/`echo build/lib.*`@path/to@g" ln -sf /usr/share/javascript/mathjax/ docs/sphinx-docs/build/html/_static/ # execute_after_dh_auto_test: # SKIP: these test currently hang (v6.0.0) # # Run some additional GUI tests # # they fail upstream at present so run them without failing the build # PYBUILD_SYSTEM=custom \ # PYBUILD_BEFORE_TEST="cp {dir}/src/sas/sasview/test/1d_data/beam\ profile.DAT {build_dir}/sas/qtgui/beam_profile.DAT" \ # PYBUILD_TEST_ARGS="xvfb-run -a --server-args='-screen 0 1024x768x24' python3 -m pytest --ignore=src/sas/webfit src/" \ # dh_auto_test || true execute_after_dh_auto_install: # tidy up some items that creep into the module but should not rm -rf debian/python3-sasview/usr/lib/python*/dist-packages/doc find debian/python3-sasview \( -name convert\*.sh -o -name convert\*.bat -o -name Thumbs.db \) -delete # move the executable into the sasview package mkdir -p debian/sasview/usr/bin mv debian/python3-sasview/usr/bin/sasview debian/sasview/usr/bin/sasview execute_after_dh_installdocs: cp -r docs/sphinx-docs/source-temp debian/sasview-doc/usr/share/doc/sasview/doc-source find debian/sasview-doc/usr/share/doc/sasview -name __pycache__ -exec rm -rf {} + execute_after_dh_fixperms: find debian/python3-sasview/usr/lib/python*/dist-packages/ -type f -exec chmod a-x {} + override_dh_compress: dh_compress -X usr/share/doc/sasview/doc-source/