File: rules

package info (click to toggle)
sasview 6.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 215,288 kB
  • sloc: python: 52,263; cpp: 6,412; makefile: 187; javascript: 173; sh: 121; xml: 40
file content (76 lines) | stat: -rwxr-xr-x 2,938 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
71
72
73
74
75
76
#!/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/