File: rules

package info (click to toggle)
qtwebengine-opensource-src 5.11.3+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 1,551,728 kB
  • sloc: cpp: 10,064,052; ansic: 3,832,841; asm: 590,489; python: 455,759; xml: 261,729; sh: 90,157; objc: 77,089; perl: 71,296; makefile: 27,042; cs: 23,492; yacc: 14,360; tcl: 12,756; php: 4,714; lex: 4,028; pascal: 3,741; ml: 3,543; ruby: 1,497; lisp: 1,490; awk: 183; csh: 117; sed: 54
file content (203 lines) | stat: -rwxr-xr-x 9,496 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export NINJA_PATH=/usr/bin/ninja
export NINJAFLAGS=-v
include /usr/share/dpkg/default.mk

DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)

# TODO: properly integrate with the other debug setting
ifeq (32,$(DEB_HOST_ARCH_BITS))
       export DEB_CFLAGS_MAINT_APPEND = -g1
       export DEB_CXXFLAGS_MAINT_APPEND = -g1
endif

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
export QT_SELECT := qt5

VERSION_CLEAN_UPSTREAM = $(call dpkg_late_eval,VERSION_CLEAN_UPSTREAM,echo '$(DEB_VERSION_UPSTREAM)' | sed -e 's/\(~\|+\).*//')

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

gstab_architectures :=
fulldebug_architectures :=
disabled_jit_architectures := armel mips mipsel
disabled_pch_architectures := amd64 powerpc s390x

small_architectures := armhf mipsel
no_gold_architectures := arm64 armhf mipsel

config_args = -proprietary-codecs \
              -feature-webengine-system-libvpx \
              -system-ffmpeg \
              -system-opus \
              -system-webp \
              -system-webengine-icu

touch_files = src/3rdparty/chromium/third_party/analytics/google-analytics-bundle.js \
	      src/3rdparty/chromium/third_party/web-animations-js/sources/web-animations.min.js \
	      src/3rdparty/chromium/third_party/web-animations-js/sources/web-animations-next-lite.min.js \
	      src/3rdparty/chromium/third_party/web-animations-js/sources/web-animations-next.min.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/audits2_worker/lighthouse/lighthouse-background.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/diff/diff_match_patch.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/acorn.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/gonzales/gonzales-scss.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/network/NetworkConfigView.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/terminal/xterm.js/build/xterm.css \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/terminal/xterm.js/build/xterm.js \
	      src/3rdparty/chromium/ui/webui/resources/js/jstemplate_compiled.js

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_clean:
	dh_auto_clean
	rm -f .qmake.cache
	rm -f config.tests/.qmake.cache
	rm -f qtwebengine-config.h

	rm -rf $(CURDIR)/test_root
	rm -rf $(CURDIR)/docs
	rm -rf $(CURDIR)/.local
	rm -f $(CURDIR)/src/3rdparty/chromium/third_party/jstemplate/jstemplate_compiled.js
	rm -f $(CURDIR)/src/3rdparty/chromium/third_party/mocha/mocha.js
	rm -f $(CURDIR)/examples/webenginewidgets/contentmanipulation/jquery*.js
	rm -f $(CURDIR)/examples/webenginewidgets/markdowneditor/resources/3rdparty/marked*.js
	rm -f $(CURDIR)/examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked*.js

	for fname in $(touch_files); do \
		rm -f $(CURDIR)/$${fname}; \
	done

override_dh_auto_configure:
	# Run qmake once to create .qmake.conf and be sure to append the following values.
	qmake QT_BUILD_PARTS+=tests QMAKE_EXTRA_ARGS+="$(config_args)"

# Enable gstabs debugging symbols only on gstab_architectures.
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(gstab_architectures)))
	echo "QMAKE_CXXFLAGS -= -g" >> .qmake.conf
	echo "QMAKE_CXXFLAGS += -gstabs" >> .qmake.conf
# Enable normal debugging symbols only on fulldebug_architectures.
else ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(fulldebug_architectures)))
	echo "QMAKE_CXXFLAGS_DEBUG += -fdebug-types-section" >> .qmake.conf
	echo "QMAKE_CXXFLAGS += -fdebug-types-section" >> .qmake.conf
	echo "QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -fdebug-types-section" >> .qmake.conf
	echo "QMAKE_CXXFLAGS_RELEASE += -fdebug-types-section" >> .qmake.conf
	echo "QMAKE_LFLAGS += -fdebug-types-section" >> .qmake.conf
else
# Disable debugging symbols in all the other archs.
	echo "QMAKE_CFLAGS -= -g" >> .qmake.conf
	echo "QMAKE_CFLAGS -= -gstabs" >> .qmake.conf
	echo "QMAKE_CXXFLAGS -= -g" >> .qmake.conf
	echo "QMAKE_CXXFLAGS -= -gstabs" >> .qmake.conf
	echo "QT_CONFIG -= force_debug_info" >> .qmake.conf
	echo "QT_CONFIG -= separate_debug_info" >> .qmake.conf
endif

# Disable JIT on selected architectures
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(disabled_jit_architectures)))
	echo "QMAKE_CXXFLAGS += -DENABLE_JIT=0" >> .qmake.conf
endif

# Disable header precompliation as it creates invalid includes on certain
# architectures causing build failure. LP: 1395661
ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(disabled_pch_architectures)))
	echo "CONFIG -= precompile_header" >> .qmake.conf
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(small_architectures)))
	echo "QMAKE_CXXFLAGS += --param ggc-min-expand=20" >> .qmake.conf
	echo "QMAKE_CFLAGS += --param ggc-min-expand=20" >> .qmake.conf
	echo "QMAKE_LFLAGS -= Wl,--gc-sections" >> .qmake.conf
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(no_gold_architectures)))
	# Do not use ld.gold
	echo "QMAKE_LFLAGS -= -fuse-ld=gold" >> .qmake.conf
	echo "QMAKE_LFLAGS += -fuse-ld=bfd" >> .qmake.conf
endif

	# Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase.
	echo "QMAKE_LFLAGS += -Wl,--no-keep-memory" >> .qmake.conf

	# Missing hardening flag detected by blhc
	echo "QMAKE_LFLAGS += -Wl,-z,now" >> .qmake.conf

	# Run qmake again now with the proper values.
	qmake QT_BUILD_PARTS+=tests QMAKE_EXTRA_ARGS+="$(config_args)"

	# Create js files, that are needed for building step for arch and indep builds
	cd $(CURDIR)/src/3rdparty/chromium/third_party/jstemplate/; \
		closure-compiler --compilation_level ADVANCED_OPTIMIZATIONS \
		--js util.js \
		--js jsevalcontext.js \
		--js jstemplate.js \
		--js exports.js \
		--js_output_file jstemplate_compiled.js

	>examples/webenginewidgets/contentmanipulation/jquery.js cat debian/missing-sources/jquery-*.js
	yui-compressor --type js "examples/webenginewidgets/contentmanipulation/jquery.js" -o "examples/webenginewidgets/contentmanipulation/jquery.min.js"
	>examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js tar xaf debian/missing-sources/marked*.tar.gz --wildcards --to-stdout '*/marked.js'
	>examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js tar xaf debian/missing-sources/marked*.tar.gz --wildcards --to-stdout '*/marked.js'
	>src/3rdparty/chromium/third_party/mocha/mocha.js tar xaf debian/missing-sources/mocha*.tar.gz --wildcards --to-stdout '*/mocha.js'
	yui-compressor --type js "examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js" -o "examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.min.js"
	yui-compressor --type js "examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.js" -o "examples/webengine/recipebrowser/resources/pages/assets/3rdparty/marked.min.js"


	set -ex; for fname in $(touch_files); do \
		mkdir -p $(CURDIR)/$$(dirname $${fname}); \
		touch $(CURDIR)/$${fname}; \
	done

override_dh_auto_build-arch:
	dh_auto_build -- -Onone

#we also need the resources.pak files, so we need the normal build.
override_dh_auto_build-indep: override_dh_auto_build-arch
	dh_auto_build -- docs

override_dh_auto_install-arch:
	dh_auto_install

	# Remove rpath from the offending binaries
	chrpath -d $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/libexec/QtWebEngineProcess

	# Fix wrong path in pkgconfig files
	find $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig -type f -name '*.pc' \
	-exec sed -i -e 's/$(DEB_HOST_MULTIARCH)\/$(DEB_HOST_MULTIARCH)/$(DEB_HOST_MULTIARCH)/g' {} \;

	# Remove libtool-like files
	rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la

override_dh_auto_install-indep: override_dh_auto_install-arch
	dh_auto_build -- INSTALL_ROOT=$(CURDIR)/debian/tmp install_docs

override_dh_install-arch:
	dh_install --fail-missing

override_dh_link:
	dh_link --package=qtwebengine5-examples \
		usr/share/javascript/jquery/jquery.min.js usr/lib/$(DEB_HOST_MULTIARCH)/qt5/examples/webenginewidgets/contentmanipulation/jquery.min.js \
		usr/share/javascript/marked/marked.min.js usr/lib/$(DEB_HOST_MULTIARCH)/qt5/examples/webenginewidgets/markdowneditor/resources/marked.min.js
	dh_link --package=qtwebengine5-dev-tools \
		usr/lib/qt5/bin/qwebengine_convert_dict usr/lib/$(DEB_HOST_MULTIARCH)/qt5/bin/qwebengine_convert_dict

	dh_link --remaining-packages

override_dh_auto_test-arch:
	$(MAKE) install -Csrc/core INSTALL_ROOT=$(CURDIR)/test_root
	-QTWEBENGINEPROCESS_PATH=$(CURDIR)/libexec/QtWebEngineProcess xvfb-run -a \
		-s "-screen 0 1024x768x24 +extension RANDR +extension RENDER +extension GLX" \
		dh_auto_test --no-parallel -- -k \
		QML2_IMPORT_PATH=$(CURDIR)/test_root/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/qml \
		LD_LIBRARY_PATH=$(CURDIR)/lib \
		HOME=$(CURDIR)

override_dh_auto_test-indep:
	# Do not attempt to run anything to make build-indep work