File: rules

package info (click to toggle)
open3d 0.9.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 101,800 kB
  • sloc: cpp: 65,788; ansic: 6,818; python: 5,593; sh: 906; javascript: 213; makefile: 195; ruby: 52
file content (69 lines) | stat: -rwxr-xr-x 2,675 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
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=+all future=+lfs
export PYBUILD_NAME=open3d

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

# -faligned-new is needed on some architectures to support 16 byte alignment
# of Eigen types
# -Wno-psabi silences the note about an ABI change in GCC 7.1, which comes
# from STL code
export DEB_CFLAGS_MAINT_APPEND = -faligned-new -Wno-psabi
export DEB_CXXFLAGS_MAINT_APPEND = -faligned-new -Wno-psabi

BUILD_UNIT_TESTS = $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)

%:
	dh $@ --with=python3,sphinxdoc,pkgkde_symbolshelper

override_dh_auto_clean:
	dh_auto_clean -Scmake -Bobj

override_dh_auto_configure:
	dh_auto_configure -Scmake -Bobj -- \
		-DBUILD_SHARED_LIBS=ON \
		-DWITH_OPENMP=ON \
		-DBUILD_CPP_EXAMPLES=OFF \
		-DBUILD_UNIT_TESTS=$(BUILD_UNIT_TESTS) \
		-DBUILD_PYTHON_MODULE=OFF
	mkdir -p .pybuild-src/open3d
	sed -e "s#@TOPDIR@#$(CURDIR)#g" -e "s#@PROJECT_VERSION@#$(DEB_VERSION_UPSTREAM)#g" -e "s#@ARCH@#$(DEB_TARGET_MULTIARCH)#g" debian/python/setup.py.in > .pybuild-src/setup.py
	sed -e "s#@PROJECT_VERSION@#$(DEB_VERSION_UPSTREAM)#g" debian/python/__init__.py.in > .pybuild-src/open3d/__init__.py

override_dh_auto_build:
	dh_auto_build -Scmake -Bobj

override_dh_auto_install:
	dh_auto_install -Scmake -Bobj
	# Remove unused Azure Kinect headers
	rm -r debian/tmp/usr/include/Open3D/IO/Sensor/AzureKinect
	# Build Python module for all relevant Python versions
	dh_auto_configure -Spybuild -D.pybuild-src
	dh_auto_build -Spybuild -D.pybuild-src
	dh_auto_install -Spybuild -D.pybuild-src
	# Remove empty directories
	find debian/tmp -type d -empty -delete

execute_before_dh_installdocs-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	# Build documentation
	mkdir -p debian/open3d-doc/usr/share/doc/open3d-doc/python
	cp -v debian/python3-open3d/usr/lib/python*/dist-packages/open3d/*.so .pybuild-src/open3d
	rm -rf docs/_out
	cd docs && LC_ALL=C LD_LIBRARY_PATH=../obj/lib:$$LD_LIBRARY_PATH PYTHONPATH=../.pybuild-src python3 make_docs.py --sphinx --is_release
	cp -r docs/_out/html debian/open3d-doc/usr/share/doc/open3d-doc/python
	mkdir -p debian/open3d-doc/usr/share/doc/open3d-doc/cpp
	rm -rf docs/_out
	cd docs && LD_LIBRARY_PATH=../obj/lib:$$LD_LIBRARY_PATH PYTHONPATH=../.pybuild-src python3 make_docs.py --doxygen --is_release
	cp -r docs/_out/html/cpp_api debian/open3d-doc/usr/share/doc/open3d-doc/cpp/html
	# Fix file duplicates
	jdupes -rl debian/open3d-doc/usr/share/doc/open3d-doc
	# Fix doxygen docs
	dh_doxygen
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	./obj/bin/unitTests || true
endif