#!/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) # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949621 LDFLAGS += -Wl,--reduce-memory-overheads # 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 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085312 ifneq (,$(filter $(DEB_HOST_ARCH),loong64)) EXTRA_CMAKE_ARGUMENTS += -DUSE_SKIA=OFF 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 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 %: 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: override_dh_dwz: