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
|
#!/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 =
# Skia strongly recommends using clang
# https://skia.org/docs/user/build/#supported-and-preferred-compilers
# armhf is not listed here because the build fails with clang 20 and 21
# https://bugs.webkit.org/show_bug.cgi?id=290167
ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 armel i386 ppc64el riscv64 s390x))
EXTRA_CMAKE_ARGUMENTS += \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
endif
# The WebKit build scripts look at the CPU to detect the architecture.
# This is a problem if we e.g. build for i386 on an amd64 machine.
# Forcing a 32-bit build solves this.
ifeq ($(DEB_HOST_ARCH_BITS),32)
EXTRA_CMAKE_ARGUMENTS += -DFORCE_32BIT=ON
endif
# Sacrifice speed in order to make it more likely resource limits
# won't be hit.
ifeq ($(DEB_BUILD_ARCH_BITS),32)
LDFLAGS += -Wl,--no-keep-memory
endif
# Additional flags to reduce memory usage on some 32-bit
# architectures (#1125347).
ifneq (,$(filter $(DEB_HOST_ARCH),armhf hppa m68k powerpc sh4))
CPPFLAGS += -no-integrated-cpp
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
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104703
ifneq (,$(filter $(DEB_HOST_ARCH),arm64))
CFLAGS := $(patsubst -mbranch-protection=%,-mbranch-protection=pac-ret,$(CFLAGS))
CXXFLAGS := $(patsubst -mbranch-protection=%,-mbranch-protection=pac-ret,$(CXXFLAGS))
endif
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101547
ifneq (,$(filter $(DEB_HOST_ARCH),alpha))
CPPFLAGS += -mlarge-data -mlarge-text
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
# Release tarballs don't ship the files needed to run tests
override_dh_auto_test:
# dwz breaks the build (#1016936 and #1081000)
override_dh_dwz:
|