[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1115554: freerdp3 FTCBFS: fails locating native tools



Source: freerdp3
Version: 3.17.1+dfsg-2
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs

freerdp3 fails to cross build from source, because it fails to locate 
generate_argument_manpage. During cross builds, the build system expects 
to be pointed at a prior native build providing this file. I tried 
implementing this as intended, but the native build is difficult to 
strip down. We only need this one file, but we end up compiling half of 
freerdp3. Worse, this requires duplicating half of its Build-Depends 
with a :native annotation.

I am thus proposing to manually build that one generate_argument_manpage 
binary. Doing so is manageable and fast. I'm attaching a patch for your 
convenience. What do you think?

Helmut
diff -Nru freerdp3-3.17.1+dfsg/debian/changelog freerdp3-3.17.1+dfsg/debian/changelog
--- freerdp3-3.17.1+dfsg/debian/changelog	2025-09-06 10:11:19.000000000 +0200
+++ freerdp3-3.17.1+dfsg/debian/changelog	2025-09-15 08:04:38.000000000 +0200
@@ -1,3 +1,10 @@
+freerdp3 (3.17.1+dfsg-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: Emulate native generate_argument_manpage build. (Closes: #-1)
+
+ -- Helmut Grohne <helmut@subdivi.de>  Mon, 15 Sep 2025 08:04:38 +0200
+
 freerdp3 (3.17.1+dfsg-2) unstable; urgency=medium
 
   * d/control: add explicit versioned deps on libwinpr3 for freerdp-dev and
diff -Nru freerdp3-3.17.1+dfsg/debian/clean freerdp3-3.17.1+dfsg/debian/clean
--- freerdp3-3.17.1+dfsg/debian/clean	1970-01-01 01:00:00.000000000 +0100
+++ freerdp3-3.17.1+dfsg/debian/clean	2025-09-15 08:04:38.000000000 +0200
@@ -0,0 +1 @@
+debian/native
diff -Nru freerdp3-3.17.1+dfsg/debian/rules freerdp3-3.17.1+dfsg/debian/rules
--- freerdp3-3.17.1+dfsg/debian/rules	2025-09-06 10:10:17.000000000 +0200
+++ freerdp3-3.17.1+dfsg/debian/rules	2025-09-15 08:04:38.000000000 +0200
@@ -1,6 +1,7 @@
 #!/usr/bin/make -f
 
 include /usr/share/dpkg/default.mk
+include /usr/share/dpkg/buildtools.mk
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DPKG_GENSYMBOLS_CHECK_LEVEL = 4
@@ -119,7 +120,26 @@
 	dh $@
 
 override_dh_auto_configure:
+ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
 	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)
+else
+	# Avoid running cmake natively as it would incur a lot of additional
+	# Build-Depends. Instead craft the desired output manually.
+	mkdir -p debian/native/include/freerdp debian/native/include/winpr
+	touch \
+		debian/native/include/freerdp/config.h \
+		debian/native/include/winpr/config.h
+	${CC_FOR_BUILD} \
+		-o debian/native/generate_argument_manpage \
+		-Idebian/native/include \
+		-Iwinpr/include \
+		client/common/man/generate_argument_manpage.c
+	printf 'add_executable(generate_argument_manpage IMPORTED)\nset_target_properties(generate_argument_manpage PROPERTIES IMPORTED_LOCATION "%s/debian/native/generate_argument_manpage")\n' \
+		'$(CURDIR)' \
+		> debian/native/FindGenerateArgumentManpage.cmake
+	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) \
+		-DCMAKE_MODULE_PATH=$(CURDIR)/debian/native
+endif
 
 # all packages depends on exact same version of libwinpr3-3: link docs to it
 # only do this for arch packages, as arch<=>indep dir_to_symlink is forbidden

Reply to: