#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/buildflags.mk EXTRA_DH_ARGUMENTS = EXTRA_CMAKE_ARGUMENTS = -DPORT=WPE \ -DCMAKE_INSTALL_LIBEXECDIR=lib/$(DEB_HOST_MULTIARCH) \ -DCMAKE_C_FLAGS_RELEASE="" \ -DCMAKE_C_FLAGS_DEBUG="" \ -DCMAKE_CXX_FLAGS_RELEASE="" \ -DCMAKE_CXX_FLAGS_DEBUG="" \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -DENABLE_WPE_QT_API=OFF \ -DUSE_LIBBACKTRACE=OFF \ -DENABLE_MINIBROWSER=ON DH_GENCONTROL_ARGS = # Sacrifice speed in order to make it more likely resource limits # won't be hit. ifeq ($(DEB_BUILD_ARCH_BITS),32) EXTRA_CMAKE_ARGUMENTS += -DFORCE_32BIT=ON LDFLAGS += -Wl,--no-keep-memory endif # The debug packages produced by webkit are huge and cause problems in # most buildds. Use -g1 in all architectures to make them smaller. CFLAGS := $(CFLAGS:-g=-g1) CXXFLAGS := $(CXXFLAGS:-g=-g1) # Don't build with -gsplit-dwarf (see #1016936) EXTRA_CMAKE_ARGUMENTS += -DDEBUG_FISSION=OFF # Use the CLoop Javascript interpreter and disable the JIT. This is # slow but it is the most compatible solution for old (non-SSE2) CPUs. ifneq (,$(filter $(DEB_HOST_ARCH),i386)) EXTRA_CMAKE_ARGUMENTS += -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON endif # See https://bugs.webkit.org/show_bug.cgi?id=197192 ifneq (,$(filter $(DEB_HOST_ARCH),arm64)) EXTRA_CMAKE_ARGUMENTS += -DWTF_CPU_ARM64_CORTEXA53=OFF endif # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93876 # and: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93877 ifneq (,$(filter $(DEB_HOST_ARCH),sh3 sh4)) CFLAGS := $(CFLAGS:-g1=-g0) CFLAGS := $(CFLAGS:-O2=-O1) CXXFLAGS := $(CXXFLAGS:-g1=-g0) CXXFLAGS := $(CXXFLAGS:-O2=-O1) CPPFLAGS += --param ggc-min-expand=10 endif ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) EXTRA_CMAKE_ARGUMENTS += -DUSE_SYSTEM_MALLOC=ON CPPFLAGS += -DRELEASE_WITHOUT_OPTIMIZATIONS endif ifeq (,$(filter %-doc,$(shell dh_listpackages))) EXTRA_CMAKE_ARGUMENTS += -DENABLE_DOCUMENTATION=OFF -DENABLE_INTROSPECTION=OFF else ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) EXTRA_CMAKE_ARGUMENTS += -DENABLE_DOCUMENTATION=OFF -DENABLE_INTROSPECTION=OFF else EXTRA_CMAKE_ARGUMENTS += -DENABLE_DOCUMENTATION=ON endif ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS))) EXTRA_CMAKE_ARGUMENTS += -DCMAKE_BUILD_TYPE=Debug else EXTRA_CMAKE_ARGUMENTS += -DCMAKE_BUILD_TYPE=Release CPPFLAGS += -DNDEBUG -DG_DISABLE_CAST_CHECKS endif # Disable the bubblewrap sandbox if libseccomp-dev is not available ifeq ($(shell pkg-config --exists libseccomp && echo yes),yes) EXTRA_CMAKE_ARGUMENTS += -DENABLE_BUBBLEWRAP_SANDBOX=ON DH_GENCONTROL_ARGS += -Vbwrap:Depends="bubblewrap (>= 0.3.1), xdg-dbus-proxy" else EXTRA_CMAKE_ARGUMENTS += -DENABLE_BUBBLEWRAP_SANDBOX=OFF endif # Lower max parallel jobs on some of Ubuntu's builders ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes) ifneq (,$(filter $(DEB_HOST_ARCH),arm64)) EXTRA_DH_ARGUMENTS += --max-parallel=2 endif endif %: dh $@ --buildsystem=cmake+ninja $(EXTRA_DH_ARGUMENTS) override_dh_gencontrol: dh_gencontrol -- $(DH_GENCONTROL_ARGS) override_dh_auto_configure: dh_auto_configure -- $(EXTRA_CMAKE_ARGUMENTS) override_dh_auto_clean: debian/control dh_auto_clean find Source Tools -type f -name "*.pyc" -exec rm {} \; find Source Tools -depth -type d -name __pycache__ -exec rmdir {} \; # Create dummy doc directories in case the "nodoc" build option is set. override_dh_install-indep: mkdir -p debian/tmp/usr/share/doc/wpe-webkit-2.0 touch debian/tmp/usr/share/doc/wpe-webkit-2.0/index.html mkdir -p debian/tmp/usr/share/doc/wpe-web-process-extension-2.0 touch debian/tmp/usr/share/doc/wpe-web-process-extension-2.0/index.html mkdir -p debian/tmp/usr/share/doc/wpe-javascriptcore-2.0 touch debian/tmp/usr/share/doc/wpe-javascriptcore-2.0/index.html dh_install -i jdupes -rl debian/libwpewebkit-doc/usr override_dh_shlibdeps: dh_shlibdeps -XMiniBrowser override_dh_builddeb: DEB_BUILD_OPTIONS="$(filter-out parallel=%,$(DEB_BUILD_OPTIONS))" \ dh_builddeb override_dh_auto_test: