File: rules

package info (click to toggle)
qtwebengine-opensource-src 5.7.1+dfsg-6.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,028,096 kB
  • ctags: 1,436,736
  • sloc: cpp: 5,960,176; ansic: 3,477,727; asm: 395,492; python: 320,633; sh: 96,504; perl: 69,449; xml: 42,977; makefile: 28,408; objc: 9,962; yacc: 9,847; tcl: 5,430; lex: 2,259; ruby: 1,053; lisp: 522; awk: 497; pascal: 310; cs: 249; sed: 53
file content (216 lines) | stat: -rwxr-xr-x 9,210 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
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/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

defines+=use_system_expat=1 \
         use_system_ffmpeg=1 \
         use_system_flac=1 \
         use_system_harfbuzz=1 \
         use_system_jsoncpp=1 \
         use_system_libevent=1 \
         use_system_libjpeg=1 \
         use_system_libpng=1 \
         use_system_libusb=1 \
         use_system_libwebp=1 \
         use_system_libxml=1 \
         use_system_libxslt=1 \
         use_system_opus=1 \
         use_system_re2=1 \
         use_system_snappy=1 \
         use_system_speex=1 \
         use_system_v8 \
         use_system_xdg_utils=1 \
         use_system_yasm=1 \
         use_system_zlib=1 \
         use_system_protobuf
         # use_system_libxnvctrl=1 \
         # use_system_sqlite=1 \
         # use_system_libvpx=1 \
         # use_system_icu=1 \

replace_gyp_args = $(foreach define,$(defines),-D$(define))

defines += use_proprietary_codecs use_system_ffmpeg

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(small_architectures)))
	defines += reduce_binary_size
endif

touch_files = src/3rdparty/chromium/third_party/analytics/google-analytics-bundle.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/acorn/acorn.js \
	      src/3rdparty/chromium/third_party/WebKit/Source/devtools/front_end/diff/diff_match_patch.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.min.js \
	      src/3rdparty/chromium/third_party/web-animations-js/sources/web-animations-next-lite.min.js

%:
	dh $@ --with pkgkde_symbolshelper

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(CURDIR)/test_root
	rm -rf $(CURDIR)/docs
	rm -rf $(CURDIR)/.local
	rm -rf $(CURDIR)/src/3rdparty/chromium/third_party/jstemplate/jstemplate_compiled.js
	rm -rf $(CURDIR)/examples/webenginewidgets/contentmanipulation/jquery*.js
	rm -rf $(CURDIR)/examples/webenginewidgets/markdowneditor/resources/marked*.js
	
	for fname in $(touch_files); do \
		rm -rf $(CURDIR)/$${fname}; \
	done

override_dh_auto_configure:
	src/3rdparty/chromium/build/linux/unbundle/replace_gyp_files.py $(replace_gyp_args)
	# Run qmake once to create .qmake.conf and be sure to append the following values.
	qmake WEBENGINE_CONFIG+="$(defines)" QT_BUILD_PARTS+=" tests"

# 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
	echo "QMAKE_LFLAGS -= -use-ld=gold" >> .qmake.conf
	echo "QMAKE_LFLAGS += -use-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  WEBENGINE_CONFIG+="$(defines)" QT_BUILD_PARTS+=" tests"

	# 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/marked.js tar xaf debian/missing-sources/marked*.tar.gz --wildcards --to-stdout '*/marked.js'
	yui-compressor --type js "examples/webenginewidgets/markdowneditor/resources/marked.js" -o "examples/webenginewidgets/markdowneditor/resources/marked.min.js"
	
	for fname in $(touch_files); do \
		touch $(CURDIR)/$${fname}; \
	done

override_dh_auto_build-arch:
	dh_auto_build

#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 private headers
	rm -rfv debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/qt5/QtWebEngine/${VERSION_CLEAN_UPSTREAM}
	rm -rfv debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/qt5/QtWebEngineCore/${VERSION_CLEAN_UPSTREAM}
	rm -rfv debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/qt5/QtWebEngineWidgets/${VERSION_CLEAN_UPSTREAM}
	# And associated files
	rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/modules/qt_lib_webengine_private.pri
	rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/modules/qt_lib_webenginecore_private.pri
	rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri
	rm -fv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt5/mkspecs/modules/qt_lib_webenginewidgets_private.pri
	
	# 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=qt5webengine-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 --remaining-packages

override_dh_auto_test-arch:
	$(MAKE) install -Csrc/core INSTALL_ROOT=$(CURDIR)/test_root
	-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