Pino Toscano d17a5cf9d6 drop -march=native from CXXFLAGS
TL;DR: never ever use -march=native in CXXFLAGS for distro builds.

-march=native optimizes the build for the specific hardware it is
built on; this means that, for example, newer hardware features such
as AVX on x86_64, may be used, rendering the resulting binaries
completely unusable on hardware without the build-time bits used.
Because of this, -march=native is a giant no-no in distribution builds,
as you never want to optimize something based on the specific buildd
used, but rather make sure it will work on the architecture in general,
in a way compatible with the architecture baseline.
2022-07-16 13:14:53 +02:00

96 lines
3.1 KiB
Makefile
Executable File

#!/usr/bin/make -f
#export DH_VERBOSE = 1
# Use already defined DEB_HOST_* variables.
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
sslpkgname := $(shell dpkg-query --show '--showformat=$${Depends}' libssl-dev | cut -d ' ' -f1)
ifneq (,$(filter libqt6sql6-ibase,$(shell dh_listpackages)))
extra_cmake_args += -DFEATURE_sql_ibase=ON
else
extra_cmake_args += -DFEATURE_sql_ibase=OFF
endif
ifeq ($(DEB_HOST_ARCH_OS),linux)
extra_cmake_args += -DFEATURE_sctp=ON
else
extra_cmake_args += -DFEATURE_sctp=OFF
endif
%:
dh $@ --with pkgkde_symbolshelper --buildsystem=cmake+ninja
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
-DCMAKE_INSTALL_PREFIX=/usr \
-DINSTALL_BINDIR=lib/qt6/bin \
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
-DINSTALL_LIBEXECDIR=lib/qt6/libexec \
-DINSTALL_ARCHDATADIR=lib/$(DEB_HOST_MULTIARCH)/qt6 \
-DINSTALL_EXAMPLESDIR=lib/$(DEB_HOST_MULTIARCH)/qt6/examples \
-DINSTALL_DATADIR=share/qt6 \
-DINSTALL_HOSTDATADIR=lib/$(DEB_HOST_MULTIARCH)/qt6 \
-DINSTALL_DOCDIR=share/qt6/doc \
-DINSTALL_SYSCONFDIR=/etc/xdg \
-DINSTALL_INCLUDEDIR=include/$(DEB_HOST_MULTIARCH)/qt6 \
-DINSTALL_PLUGINDIR=lib/$(DEB_HOST_MULTIARCH)/qt6/plugins \
-DINSTALL_TRANSLATIONDIR=share/qt6/translations \
-DINSTALL_MKSPECSDIR=lib/$(DEB_HOST_MULTIARCH)/qt6/mkspecs \
-DINSTALL_PUBLICBINDIR=bin \
-DBUILD_EXAMPLES=ON \
-DFEATURE_mimetype_database=OFF \
-DFEATURE_dbus_linked=ON \
-DFEATURE_accessibility=ON \
-DFEATURE_doubleconversion=ON \
-DFEATURE_glib=ON \
-DFEATURE_icu=ON \
-DFEATURE_pcre2=ON \
-DFEATURE_system_pcre2=ON \
-DFEATURE_zlib=ON \
-DFEATURE_ssl=ON \
-DFEATURE_libproxy=ON \
-DFEATURE_system_proxies=ON \
-DFEATURE_cups=ON \
-DFEATURE_fontconfig=ON \
-DFEATURE_freetype=ON \
-DFEATURE_harfbuzz=ON \
-DFEATURE_gtk=ON \
-DFEATURE_directfb=OFF \
-DFEATURE_sql_odbc=ON \
-DFEATURE_sql_mysql=ON \
-DFEATURE_sql_psql=ON \
-DFEATURE_sql_sqlite=ON \
-DFEATURE_system_sqlite=ON \
-DFEATURE_jpeg=ON \
-DFEATURE_system_jpeg=ON \
-DFEATURE_png=ON \
-DFEATURE_system_png=ON \
-DFEATURE_system_libb2=ON \
-DFEATURE_rpath=OFF \
-DFEATURE_relocatable=OFF \
$(extra_cmake_args)
execute_after_dh_auto_install:
# Policy § 10.4. Remove this if https://bugs.debian.org/904409 gets fixed.
sed -i 's,bin/env perl,bin/perl,' debian/tmp/usr/lib/qt6/libexec/*.pl \
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt6/mkspecs/features/data/unix/findclasslist.pl
# Reproducible builds: remove build paths from .prl files
sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libQt6*.prl
# Specifies parameters to pass to the platform plugin.
mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt6
sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/' debian/qt.conf.in \
> debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/qt6/qt6.conf
override_dh_makeshlibs:
dh_makeshlibs -XlibQt6EglFSDeviceIntegration -XlibQt6EglFsKmsGbmSupport -XlibQt6EglFsKmsSupport -XlibQt6XcbQpa
execute_after_dh_shlibdeps-arch:
echo libssl:Depends=$(sslpkgname) >> debian/libqt6network6.substvars