File: rules

package info (click to toggle)
sasview 5.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 107,708 kB
  • sloc: python: 95,648; xml: 9,675; cpp: 6,412; sh: 509; javascript: 467; makefile: 184
file content (70 lines) | stat: -rwxr-xr-x 2,553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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

# Enable additional hardening options for the binaries but not PIE since it is
# not wanted for shared libraries.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# 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


%:
	dh $@ --with python3,sphinxdoc,numpy3 --buildsystem=pybuild

execute_after_dh_auto_clean:
	# clean up docs
	rm -rf docs/sphinx-docs/build docs/sphinx-docs/source-temp otherdocs
	# clean up tests
	find test -name logs -type d -exec rm -rf {} +
	rm -rf test/tests.log .cache test/.cache

override_dh_auto_build-indep:
	# build the arch-dep packages to be able to build the docs
	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` \
	  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/

override_dh_auto_test-indep:
	# nothing to do

override_dh_auto_test-arch:
	# Run most of the utests with pytest
	dh_auto_test
	# Run some additional GUI tests
	# they fail upstream at present so run them without failing the build
	PYBUILD_SYSTEM=custom \
	PYBUILD_BEFORE_TEST="cp -r {dir}/src/sas/qtgui {build_dir}" \
	PYBUILD_TEST_ARGS="cd {build_dir}/qtgui; xvfb-run -a --server-args='-screen 0 1024x768x24' python3 GUITests.py" \
	PYBUILD_AFTER_TEST="rm -rf {build_dir}/qtgui" \
	dh_auto_test || true

execute_after_dh_auto_install:
	# remove extra copy of the docs that isn't needed
	rm -rf debian/python3-sasview/usr/lib/python*/dist-packages/doc
	# move the executable into the sasview package
	find debian/python3-sasview \( -name convert\*.sh -o -name convert\*.bat -o -name Thumbs.db \) -delete
	mkdir -p debian/sasview/usr/bin
	mv debian/python3-sasview/usr/bin/sasview debian/sasview/usr/bin/sasview

execute_after_dh_python3:
	rm -rf debian/python3-sasview/usr/lib/python3*/dist-packages/qtgui

execute_after_dh_fixperms:
	find debian/python3-sasview/usr/lib/python*/dist-packages/ -type f -exec chmod a-x {} +