Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Uncomment this to turn on verbose mode.
4 export DH_VERBOSE=1
5
6 # see FEATURE AREAS in dpkg-buildflags(1)
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto
8
9 include /usr/share/dpkg/architecture.mk
10
11 # Used in the python3 binding (setup.py)
12 export OPENCC_BUILD_DIR = obj-$(DEB_BUILD_GNU_TYPE)
13
14
15 # Disable parallel build to circumvent some random build error
16 # (needs further investigation)
17 %:
18 dh $@ --buildsystem=cmake
19
20
21 # Python build handled separately in pyproject.toml and setup.py
22 BUILD_OPTIONS = \
23 -DCMAKE_INSTALL_PREFIX=/usr \
24 -DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
25 -DCMAKE_BUILD_TYPE=Release \
26 -DBUILD_OPENCC_JIEBA_PLUGIN=ON \
27 -DBUILD_PYTHON=OFF \
28 -DUSE_SYSTEM_DARTS=OFF \
29 -DUSE_SYSTEM_GTEST=ON \
30 -DUSE_SYSTEM_MARISA=ON \
31 -DUSE_SYSTEM_PYBIND11=ON \
32 -DUSE_SYSTEM_RAPIDJSON=ON \
33 -DUSE_SYSTEM_TCLAP=ON
34
35 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
36 BUILD_OPTIONS += -DBUILD_DOCUMENTATION=ON
37 else
38 BUILD_OPTIONS += -DBUILD_DOCUMENTATION=OFF
39 endif
40
41 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
42 BUILD_OPTIONS += -DENABLE_GTEST=ON
43 else
44 BUILD_OPTIONS += -DENABLE_GTEST=OFF
45 endif
46
47 override_dh_auto_configure:
48 dh_auto_configure -- $(BUILD_OPTIONS)
49
50 execute_after_dh_auto_build:
51 dh_auto_build -O--buildsystem=pybuild -- -s pyproject
52
53 execute_after_dh_auto_test:
54 # The testsuite needs the package to be installed.
55 # The python extension carries no RPATH on purpose (see patch 0009),
56 # so point it at the freshly built libopencc for the test run.
57 -LD_LIBRARY_PATH=$(CURDIR)/$(OPENCC_BUILD_DIR)/src$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
58 dh_auto_test -O--buildsystem=pybuild -- -s pyproject
59
60 execute_after_dh_auto_install:
61 dh_auto_install -O--buildsystem=pybuild -- -s pyproject
62 for i in debian/tmp/usr/lib/*/dist-packages/opencc/clib/; do \
63 mkdir -p $$i/share/; \
64 ln -sf ../../../../../../share/opencc $$i/share/; \
65 done
66
67 execute_after_dh_auto_clean:
68 find . -name *.pyc -delete
69
70 execute_after_dh_installdocs-indep:
71 ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
72 dh_doxygen --indep
73 endif
74
75 override_dh_installdocs:
76 dh_installdocs -plibopencc-doc --doc-main-package=opencc
77 dh_installdocs --remaining-packages
78
79 override_dh_installchangelogs:
80 dh_installchangelogs -k NEWS.md