~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
export QT_SELECT := qt5
export CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
DEB_HOST_MULTI_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_SERIES ?= $(shell lsb_release -c -s)

# Skip tests on the archs they are known to be flaky  with current configuration
testskip_architectures := arm64 powerpc ppc64el s390x
testskip_series := 

override_dh_auto_configure:
	qmake -r CONFIG+=debian_build

%:
	dh $@ --parallel

override_dh_auto_test:
	echo TRACE_TEST
	echo $(DEB_HOST_SERIES)
	echo $(testskip_series)
ifneq ($(DEB_HOST_SERIES),$(findstring $(DEB_HOST_SERIES), $(testskip_series)))
ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(testskip_architectures)))
ifneq ("$(DEB_HOST_ARCH)$(DEB_HOST_SERIES)","arm64vivid")
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	mkdir -p debian/tmp/home/run
	chmod +x tests/xvfb.sh
	tests/xvfb.sh dh_auto_test || exit $?
endif
endif
endif
endif

override_dh_build:
	dh_auto_build --parallel
	dh_auto_build --parallel -- docs

override_dh_install:
	mkdir -p debian/tmp/`qmake -query QT_INSTALL_DOCS`/qch
	mkdir -p debian/tmp/usr/share/ubuntu-ui-toolkit/doc
	cp -r $(CURDIR)/documentation/*qch debian/tmp/`qmake -query QT_INSTALL_DOCS`/qch
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la
	# FIXME: Due to autopilot not being in the archive we ship docs for now
	# sphinx-build -b singlehtml documentation/autopilot-helpers documentation/autopilot-helpers/_build/html
	# sphinx-build -b json documentation/autopilot-helpers documentation/autopilot-helpers/_build/json
	# Drop QML types used to test apicheck only
	rm -f debian/tmp/usr/lib/*/qt5/qml/Extinct/Animals/*
	dh_install --fail-missing