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
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export PYBUILD_NAME=jupyterlab
export JUPYTERLAB_DIR=$(CURDIR)/debian/jupyterlab/usr/share/jupyter/lab
PYVERS=$(shell python3 -c 'import sysconfig;print (sysconfig.get_python_version())')
BUILD_EXTENSIONS=galata/extension
export YARNCOMMAND=pkgjs
# Limit memory consumption to 2/3 of available RAM
NODE_MEM=$(shell if test -e /proc/meminfo; then echo $$((`grep MemTotal /proc/meminfo|sed -e 's/[^0-9]//g'` / 1536 )); else echo 2048; fi)
export NODE_OPTIONS=--max_old_space_size=$(NODE_MEM)
export NODE_ENV=production
%:
dh $@
override_dh_auto_configure:
dh_auto_configure --buildsystem=nodejs
dh_auto_configure --buildsystem=pybuild
override_dh_auto_build:
# Replace html-loader preprocessing
grep -lr '<%= require(.html-loader'|./debian/html-loader.pl
# Update build links
ln -s ../../packages/fileeditor-extension node_modules/@jupyterlab/ || true
# Build duplicate-package-checker-webpack-plugin
cd duplicate-package-checker-webpack-plugin && sh -ex ../debian/nodejs/duplicate-package-checker-webpack-plugin/build
# Build @jupyterlab/* libraries
# activating the next line
# dh_auto_build --buildsystem=nodejs
# produce this error during the build
# dh_auto_build: warning: Max loop command exceed, aborting
# dh_auto_build: warning: Max loop command exceed, aborting
# instead call directly the nodejs build script
sh -ex debian/nodejs/build
dh_auto_build --buildsystem=pybuild
override_dh_auto_install:
dh_auto_install --buildsystem=nodejs
dh_auto_install --buildsystem=pybuild
execute_after_dh_install:
# move /usr/etc files into /etc
mv -f debian/jupyterlab/usr/etc debian/jupyterlab/
# add the missing .js.map files ???
cp -f debian/jupyterlab/usr/lib/python3/dist-packages/jupyterlab/staging/build/*.js.map \
debian/jupyterlab/usr/share/jupyter/lab/static
# link instead of copy (to save space)
rm -rf /usr/lib/python3/dist-packages/jupyterlab/static
dh_link -p jupyterlab /usr/share/jupyter/lab/static /usr/lib/python3/dist-packages/jupyterlab/static
rm -rf /usr/lib/python3/dist-packages/jupyterlab/schemas
dh_link -p jupyterlab /usr/share/jupyter/lab/schemas /usr/lib/python3/dist-packages/jupyterlab/schemas
rm -rf /usr/lib/python3/dist-packages/jupyterlab/themes
dh_link -p jupyterlab /usr/share/jupyter/lab/themes /usr/lib/python3/dist-packages/jupyterlab/themes
# remove unwanted files
find debian/jupyterlab -name build_log.json -delete
rm -rf debian/jupyterlab/usr/lib/python3/dist-packages/jupyterlab/staging/build
rm -rf debian/jupyterlab/usr/lib/python3/dist-packages/jupyterlab/staging/node_modules
override_dh_auto_test:
@echo "Tests disabled because of missing depends"
override_dh_installdocs:
dh_installdocs
dh_nodejs_autodocs auto_dispatch
override_dh_auto_clean:
# Restore html-loader.pl modified files
grep -lr '<%= require(.html-loader' debian|debian/restore-html-loader.pl
dh_auto_clean -O--buildsystem=pybuild || true
dh_auto_clean -O--buildsystem=nodejs || true
|