#!/usr/bin/make -f include /usr/share/dpkg/default.mk ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS))) export DH_VERBOSE = 1 endif export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 DPKG_EXPORT_BUILDFLAGS = 1 CFLAGS += $(CPPFLAGS) -DNDEBUG CXXFLAGS += $(CPPFLAGS) -DNDEBUG empty := DEB_CMAKE_EXTRA_FLAGS = \ -DCMAKE_INSTALL_INCLUDEDIR=include/$(DEB_HOST_MULTIARCH) \ -DCMAKE_SKIP_RPATH=FALSE \ -DCMAKE_SKIP_INSTALL_RPATH=TRUE \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWITH_DEBUG_ALL=OFF \ -DBUILD_TESTING=OFF \ -DWITH_CHANNELS=ON \ -DWITH_SERVER=ON \ -DWITH_PROXY=ON \ -DWITH_PROXY_MODULES=ON \ -DWITH_CLIENT_INTERFACE=OFF \ -DWITH_CLIENT_SDL=ON \ -DWITH_SDL_IMAGE_DIALOGS=ON \ -DWITH_WEBVIEW=OFF \ -DWITH_PULSE=ON \ -DWITH_ICU=ON \ -DWITH_CUPS=ON \ -DWITH_PCSC=ON \ -DWITH_JPEG=ON \ -DWITH_KERBEROS=ON \ -DWITH_CLANG_FORMAT=OFF \ -DWITH_OPUS=ON \ -DWITH_SAMPLE=OFF \ -DWITH_OPENSC_PKCS11_LINKED=OFF \ -DWITH_VAAPI=OFF \ -DWITH_WINPR_UTILS_IMAGE_JPEG=ON \ -DWITH_WINPR_UTILS_IMAGE_PNG=ON \ -DWITH_WINPR_UTILS_IMAGE_WEBP=ON \ -DWITH_SMARTCARD_EMULATE=ON \ -DRDTK_FORCE_STATIC_BUILD=ON \ -DUWAC_FORCE_STATIC_BUILD=ON \ -DWITH_BINARY_VERSIONING=ON \ -DWITH_VERBOSE_WINPR_ASSERT=OFF \ $(empty) ifneq (,$(filter armel,$(DEB_HOST_ARCH))) DEB_CMAKE_EXTRA_FLAGS += \ -DWITH_NEON=OFF \ $(empty) endif ifneq (,$(filter armel armhf,$(DEB_HOST_ARCH))) # https://github.com/FreeRDP/FreeRDP/issues/10353 # gcc/glibc does not provide _URC_NORMAL_STOP etc definitions in # on armel armhf # it's proabbly be better to perform a build-time check instead # -DWITH_UNWIND=OFF does not work in version 3.6 DEB_CMAKE_EXTRA_FLAGS += \ -DWINPR_HAVE_UNWIND_H=OFF \ $(empty) endif ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS))) DEB_CMAKE_EXTRA_FLAGS += \ -DCHANNEL_URBDRC=ON \ -DCHANNEL_URBDRC_CLIENT=ON \ -DWITH_WAYLAND=ON \ $(empty) else DEB_CMAKE_EXTRA_FLAGS += \ -DCHANNEL_URBDRC=OFF \ -DCHANNEL_URBDRC_CLIENT=OFF \ $(empty) DEB_CMAKE_EXTRA_FLAGS += \ -DWITH_ALSA=OFF \ -DWITH_LIBSYSTEMD=OFF \ -DWITH_WAYLAND=OFF \ $(empty) endif # Ubuntu can't have ffmpeg in main # Ubuntu doesn't yet have cjson or pkcs11-helper # or uriparser in main ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes) DEB_CMAKE_EXTRA_FLAGS += \ -DWITH_JSON_DISABLED=ON \ -DWITH_FFMPEG=OFF \ -DWITH_GSM=OFF \ -DWITH_CAIRO=ON \ -DWITH_PKCS11=OFF \ -DWITH_SWSCALE=OFF \ -DWITH_URIPARSER=OFF \ $(empty) else DEB_CMAKE_EXTRA_FLAGS += \ -DWITH_GSM=ON \ -DWITH_SWSCALE=ON \ -DWITH_DSP_FFMPEG=ON \ -DSWScale_INCLUDE_DIRS=/usr/include/$(DEB_HOST_MULTIARCH) \ -DWITH_CAIRO=OFF \ $(empty) endif %: dh $@ # char 026 (0x16) is seemed to be safe separator for sed "s" command; # idea taken from Debian src:nginx/debian/dh_nginx. # (however, they're using 0x17) xSEDx :=$(shell printf '\026') override_dh_auto_configure: dh_auto_configure --builddirectory=debian/testtmp -- $(DEB_CMAKE_EXTRA_FLAGS) -DBUILD_TESTING=ON dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) # mangle CFLAGS value stored in buildflags.h. # fixes build path leakage. o='-f(debug|file)-prefix-map' ; \ sed -E -i \ -e "s$(xSEDx)$${o}=[^=]+=\. $(xSEDx)$(xSEDx)g;" \ -e "s$(xSEDx) $${o}=[^=]+=\.$(xSEDx)$(xSEDx)g;" \ obj-$(DEB_HOST_GNU_TYPE)/include/freerdp/buildflags.h sed -E -i \ -e "s$(xSEDx)$${o}=[^=]+=\. $(xSEDx)$(xSEDx)g;" \ -e "s$(xSEDx) $${o}=[^=]+=\.$(xSEDx)$(xSEDx)g;" \ obj-$(DEB_HOST_GNU_TYPE)/winpr/include/winpr/buildflags.h execute_after_dh_auto_build: dh_auto_build --builddirectory=debian/testtmp execute_after_dh_auto_test: dh_auto_test --builddirectory=debian/testtmp # NB debhelper 13+: convert to execute_before_dh_install override_dh_install: TMP_LIB = debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) override_dh_install: rm -rf $(TMP_LIB)/*.a mkdir -p $(TMP_LIB)/freerdp/ dh_install # NB debhelper 13+: remove override override_dh_missing: dh_missing --fail-missing get-orig-source: uscan --noconf --force-download --rename --download-current-version --destdir=..