| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d @"$(SOURCE_DATE_EPOCH)") |
| 4 |
export PYBUILD_DESTDIR=debian/black/ |
| 5 |
export PYBUILD_TEST_ARGS=--run-optional no_jupyter,no_blackd -k "not (incompatible_with_mypyc or test_simple_format)" |
| 6 |
export PYBUILD_BUILD_ARGS=--verbose |
| 7 |
export HATCH_BUILD_HOOKS_ENABLE=1 |
| 8 |
export HATCH_VERBOSE=3 |
| 9 |
|
| 10 |
# hatch-mypyc builds in a temporary directory. Make this reproducible. |
| 11 |
export PYBUILD_BEFORE_BUILD := rm -rf debian/hatch-tmp; mkdir -p debian/hatch-tmp |
| 12 |
export HATCH_MYPYC_BUILD_DIR := $(CURDIR)/debian/hatch-tmp |
| 13 |
|
| 14 |
%: |
| 15 |
dh $@ --buildsystem=pybuild --with bash-completion |
| 16 |
|
| 17 |
execute_after_dh_auto_build: |
| 18 |
make -C docs/ html PYTHONPATH="..:../src/" SPHINXBUILD="/usr/share/sphinx/scripts/python3/sphinx-build" SPHINXOPTS="-j 4 -D today=\"$(BUILD_DATE)\"" |
| 19 |
|
| 20 |
execute_after_dh_auto_install: |
| 21 |
rm debian/black/usr/bin/blackd |
| 22 |
|
| 23 |
execute_before_dh_installman: |
| 24 |
rst2man debian/manpage.rst > debian/black.1 |
| 25 |
rst2man debian/manpage2.rst > debian/black-primer.1 |
| 26 |
|
| 27 |
execute_after_dh_clean: |
| 28 |
find src -name *.so -delete |