Bug#1110345: lomiri-location-service FTCBFS: Multiple reasons
Package: lomiri-location-service
Version: 3.3.0-2
Tags: patch
User: debian-cross@lists.debian.org
Usertags: ftcbfs
X-Debbugs-Cc: debian-cross@lists.debian.org
Dear Maintainer,
lomiri-location-service fails to cross-build due to multiple reasons.
1. In d/rules, "CC" and "CXX" are used with dh_auto_configure without importing
include /usr/share/dpkg/buildtools.mk which will set it to correct triplet
prefixed var.
2. The lomiri-location-service-tests package misses a !nocheck build profile due
to which cross-builds were trying to build for test package as well
3. CMakeLists.txt lack an option to not compile build time tests and documentation.
I've attempted to fix all 3 issues and attached a patch. Please consider to review and apply.
Best,
Nilesh
From 53e574c074f966c813886623308bab3160687240 Mon Sep 17 00:00:00 2001
From: Nilesh Patra <nilesh@debian.org>
Date: Sun, 3 Aug 2025 19:31:29 +0530
Subject: [PATCH] Get lomiri-location-service cross-building
---
CMakeLists.txt | 12 +++++--
debian/control | 1 +
...02_add-opts-for-disabling-tests-docs.patch | 32 +++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 9 ++++++
5 files changed, 53 insertions(+), 2 deletions(-)
create mode 100644 debian/patches/2002_add-opts-for-disabling-tests-docs.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45e6d70..0512759 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,10 @@ set(LOMIRI_LOCATION_SERVICE_VERSION_PATCH 0)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
+# Add flag for Build time tests
+option(BUILD_TESTS "Build the tests at build time" ON)
+# Add flag for Docs
+option(BUILD_DOCS "Build the documentation at build time" ON)
message(STATUS "${CMAKE_PROJECT_NAME} ${LOMIRI_LOCATION_SERVICE_VERSION_MAJOR}.${LOMIRI_LOCATION_SERVICE_VERSION_MINOR}.${LOMIRI_LOCATION_SERVICE_VERSION_PATCH}")
@@ -153,12 +157,16 @@ if(ENABLE_TRUST_STORE)
endif(ENABLE_TRUST_STORE)
add_subdirectory(data)
-add_subdirectory(doc)
+if(BUILD_DOCS)
+ add_subdirectory(doc)
+endif(BUILD_DOCS)
add_subdirectory(examples)
add_subdirectory(include)
add_subdirectory(po)
add_subdirectory(src)
-add_subdirectory(tests)
+if(BUILD_TESTS)
+ add_subdirectory(tests)
+endif(BUILD_TESTS)
add_subdirectory(qt)
# There's no nice way to format this. Thanks CMake.
diff --git a/debian/control b/debian/control
index 31f4962..db124b0 100644
--- a/debian/control
+++ b/debian/control
@@ -69,6 +69,7 @@ Package: lomiri-location-service-tests
Architecture: any
Depends: ${misc:Depends},
${shlibs:Depends},
+Build-Profiles: <!nocheck>
Description: Lomiri Location Service test executables
Aggregates position/velocity/heading updates and exports them over DBus.
.
diff --git a/debian/patches/2002_add-opts-for-disabling-tests-docs.patch b/debian/patches/2002_add-opts-for-disabling-tests-docs.patch
new file mode 100644
index 0000000..1493714
--- /dev/null
+++ b/debian/patches/2002_add-opts-for-disabling-tests-docs.patch
@@ -0,0 +1,32 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,6 +11,10 @@
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ # Instruct CMake to run moc automatically when needed.
+ set(CMAKE_AUTOMOC ON)
++# Add flag for Build time tests
++option(BUILD_TESTS "Build the tests at build time" ON)
++# Add flag for Docs
++option(BUILD_DOCS "Build the documentation at build time" ON)
+
+ message(STATUS "${CMAKE_PROJECT_NAME} ${LOMIRI_LOCATION_SERVICE_VERSION_MAJOR}.${LOMIRI_LOCATION_SERVICE_VERSION_MINOR}.${LOMIRI_LOCATION_SERVICE_VERSION_PATCH}")
+
+@@ -153,12 +157,16 @@
+ endif(ENABLE_TRUST_STORE)
+
+ add_subdirectory(data)
+-add_subdirectory(doc)
++if(BUILD_DOCS)
++ add_subdirectory(doc)
++endif(BUILD_DOCS)
+ add_subdirectory(examples)
+ add_subdirectory(include)
+ add_subdirectory(po)
+ add_subdirectory(src)
+-add_subdirectory(tests)
++if(BUILD_TESTS)
++ add_subdirectory(tests)
++endif(BUILD_TESTS)
+ add_subdirectory(qt)
+
+ # There's no nice way to format this. Thanks CMake.
diff --git a/debian/patches/series b/debian/patches/series
index 4556b3e..ecc8795 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
2001_skip-boost-ptree-settings-tests.patch
1002_typo-fixes.patch
1003_not-build-dir-in-doc-files.patch
+2002_add-opts-for-disabling-tests-docs.patch
diff --git a/debian/rules b/debian/rules
index dbdb92e..24487f3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,12 +14,20 @@ NULL =
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
+-include /usr/share/dpkg/buildtools.mk
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
+EXTRA_CMAKE_OPTS =
include /usr/share/dpkg/default.mk
+ifneq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
+EXTRA_CMAKE_OPTS += -DBUILD_DOCS=OFF
+endif
+ifneq ($(filter nocheck,$(DEB_BUILD_PROFILES)),)
+EXTRA_CMAKE_OPTS += -DBUILD_TESTS=OFF
+endif
%:
dh $@
@@ -46,6 +54,7 @@ override_dh_auto_configure:
-DENABLE_TRUST_STORE=OFF \
-DLOCATION_SERVICE_ENABLE_GPS_PROVIDER=OFF \
-DLOCATION_SERVICE_ENABLE_GEOCLUE_PROVIDER=ON \
+ $(EXTRA_CMAKE_OPTS) \
$(NULL)
override_dh_auto_test:
--
2.47.2
Reply to: