File: rules

package info (click to toggle)
ipywidgets 6.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,852 kB
  • sloc: python: 2,893; makefile: 126; sh: 76
file content (84 lines) | stat: -rwxr-xr-x 2,959 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
77
78
79
80
81
82
83
84
#!/usr/bin/make -f

#export DH_VERBOSE=1 # can also set this on each debian/rules command line
export LC_ALL=C.UTF-8

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

override_dh_auto_configure:
	dh_auto_configure
	dh_auto_configure -- -d ./widgetsnbextension

override_dh_auto_build:
# fakewebpack
	$(MAKE) -C debian -f fakewebpack.mk all
	touch debian/fakewebpack/widgetsnbextension/extension.js.map
	# See that patch for a description of why this is needed
	#patch -l -F400 debian/fakewebpack/docs/index.js debian/webpack-compat/jquery.patch
# ipywidgets
	dh_auto_build
# widgetsnbextension
	# The below dance is only to satisfy widgetsnbextension/setup.py being
	# extra-picky and is otherwise useless, since we replace all these files
	# with symlinks later in override_dh_auto_install
	mkdir -p widgetsnbextension/widgetsnbextension/static
	cp debian/fakewebpack/widgetsnbextension/* \
	  widgetsnbextension/widgetsnbextension/static/
	dh_auto_build -Dwidgetsnbextension
#ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
# ipywidgets-doc
#	dh_auto_build -Ddocs -Smakefile -- html
#	cp -a debian/fakewebpack/docs docs/build/html/_static/built
#	find docs/build/html/_static/built -type f -empty -delete
#endif

override_dh_auto_install:
	dh_auto_install
	dh_auto_install -- -d ./widgetsnbextension
	set -e; for i in debian/tmp/usr/lib/*/dist-packages/widgetsnbextension/static; do \
	  rm -rf $$i && ln -sfT /usr/share/jupyter/nbextensions/jupyter-js-widgets $$i; \
	done

override_dh_auto_clean:
#ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
# ipywidgets-doc
#	dh_auto_clean -Ddocs -Smakefile -- clean
#endif
# widgetsnbextension
	dh_auto_clean -Dwidgetsnbextension
	rm -rf widgetsnbextension/widgetsnbextension/static
# ipywidgets
	dh_auto_clean
# fakewebpack
	$(MAKE) -C debian -f fakewebpack.mk clean

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# from docs/source/dev_testing.md
	nosetests3 --with-coverage --cover-package=ipywidgets ipywidgets
	# no tests in widgetsnbextension
endif

override_dh_compress:
	dh_compress -X python-ipywidgets-doc/html

gen_built_using = \
	$(MAKE) -C debian -f fakewebpack.mk fakewebpack/$(1).packages && \
	echo "fakewebpack:Built-Using=$$(cat debian/fakewebpack/$(1).packages)" >> debian/$(2).substvars
override_dh_gencontrol:
#ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
#	$(call gen_built_using,docs,python-ipywidgets-doc)
#endif
	$(call gen_built_using,widgetsnbextension,jupyter-nbextension-jupyter-js-widgets)
	dh_gencontrol

override_dh_sphinxdoc:
	dh_sphinxdoc -X_static/mathjax
	# Replace embedded jupyter-sphinx-theme files with symlinks
	set -e; for i in debian/python-ipywidgets-doc/usr/share/doc/python-ipywidgets-doc/html/_static/*; do \
	  if [ -e "/usr/share/jupyter_sphinx_theme/jupyter/static/$$(basename "$$i")" ]; then \
	    rm -rf "$$i"; \
	    ln -sfT "/usr/share/jupyter_sphinx_theme/jupyter/static/$$(basename "$$i")" "$$i"; \
	  fi; \
	done