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
|
#!/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 python2,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-build/widgetsnbextension/extension.js.map
# See that patch for a description of why this is needed
patch -l -F400 debian/fakewebpack-build/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-build/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-build/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:
# from docs/source/dev_testing.md
nosetests --with-coverage --cover-package=ipywidgets ipywidgets
# no tests in widgetsnbextension
override_dh_compress:
dh_compress -X python-ipywidgets-doc/html
gen_built_using = \
$(MAKE) -C debian -f fakewebpack.mk fakewebpack-build/$(1).packages && \
echo "fakewebpack:Built-Using=$$(cat debian/fakewebpack-build/$(1).packages)" >> debian/$(2).substvars
override_dh_gencontrol:
$(call gen_built_using,docs,python-ipywidgets-doc)
$(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
|