[Pkg-sogo-maintainers] Bug#1094306: sogo: FTCBFS: multiple reasons

Yavor Doganov yavor at gnu.org
Mon Jan 27 00:37:48 GMT 2025


Source: sogo
Version: 5.11.2-1
Severity: minor
Tags: patch
Control: block -1 with 1094304
User: debian-cross at lists.debian.org
Usertags: cross-satisfiability ftcbfs

I tried to cross build sogo on amd64 for armhf with multiarch-based
GNUstep and observed the following issues:

  * The build-dependencies gobjc and python3 are uninstallable.
  * The build architecture compiler is used.
  * Upstream's build system hard codes the build architecture
    pkg-config.

Attached are two patches where the fix is identical except
debian/changelog (I wanted to spare you the effort to resolve
conflicts): 0001-Fix-FTCBFS.patch should be applied on top of the
first patch at #1094304 (0001-Fix-FTBFS-with-multiarch.patch) while
0001-Fixes-for-cross-building.patch is for the case when the second
scenario is chosen.
-------------- next part --------------
>From 04f6a4d83715c2a2f5a5ef66f63c1a0d53827506 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Mon, 27 Jan 2025 02:12:35 +0200
Subject: [PATCH] Fix FTCBFS.

---
 debian/changelog             |  8 +++-
 debian/control               |  3 +-
 debian/patches/cross.patch   | 90 ++++++++++++++++++++++++++++++++++++
 debian/patches/libxml2.patch |  4 +-
 debian/patches/series        |  1 +
 debian/rules                 |  1 +
 6 files changed, 101 insertions(+), 6 deletions(-)
 create mode 100644 debian/patches/cross.patch

diff --git a/debian/changelog b/debian/changelog
index ea393e4d6..a80cde384 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,17 @@
 sogo (5.11.2-2) UNRELEASED; urgency=medium
 
   * debian/control (Build-Depends): Bump libsbjson-dev and libsope-dev to
-    ensure the package is rebuilt for the multiarch layout.
-  * debian/rules (override_dh_auto_install): Fix paths when moving files.
+    ensure the package is rebuilt for the multiarch layout.  Remove
+    unnecessary gobjc and annotate python3 with :any.
+  * debian/rules: Include gnustep-make's config.mk
+    (override_dh_auto_install): Fix paths when moving files.
     (execute_before_dh_link): Run dh_gnustep --no-move.
   * debian/sogo.install: Update for multiarch.
   * debain/sogo-activesync.install: Likewise.
   * debian/sogo-common.links: Delete.
   * debian/sogo.links: New file.
+  * debian/patches/libxml2.patch: Don't hard code pkg-config.
+  * debian/patches/cross.patch: New; fix FTCBFS.
 
  -- Yavor Doganov <yavor at gnu.org>  Sun, 26 Jan 2025 04:08:13 +0200
 
diff --git a/debian/control b/debian/control
index a80d3005f..056f6e233 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,6 @@ Maintainer: Debian SOGo Maintainers <pkg-sogo-maintainers at lists.alioth.debian.or
 Uploaders: Jeroen Dekkers <jeroen at dekkers.ch>,
            Jordi Mallach <jordi at debian.org>
 Build-Depends: debhelper-compat (= 13),
- gobjc,
  libcurl4-openssl-dev,
  libgnustep-base-dev,
  liblasso3-dev,
@@ -21,7 +20,7 @@ Build-Depends: debhelper-compat (= 13),
  libytnef-dev,
  libzip-dev,
  pkgconf,
- python3
+ python3:any
 Standards-Version: 4.7.0
 Homepage: https://sogo.nu/
 Vcs-Browser: https://salsa.debian.org/debian/sogo
diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 000000000..b205d8e64
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,90 @@
+Description: Fix FTCBFS.
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2025-01-26
+---
+
+--- sogo.orig/configure
++++ sogo/configure
+@@ -11,6 +11,10 @@
+ 
+ TOPDIR="$(cd `dirname $0`; pwd)"
+ 
++if [ -z "$PKG_CONFIG" ]; then
++    PKG_CONFIG=pkg-config
++fi
++
+ # we ensure that the configure script is run from TOPDIR
+ cd "${TOPDIR}"
+ 
+@@ -408,9 +412,9 @@
+   if test "x$ARG_ENABLE_SAML2" = "x1"; then
+       checkLinking "lasso"   required;
+       if test $? = 0; then
+-          lasso_cflags="`pkg-config lasso --cflags`"
++          lasso_cflags="`$PKG_CONFIG lasso --cflags`"
+           cfgwrite "LASSO_CFLAGS := $lasso_cflags"
+-          lasso_libs="`pkg-config lasso --libs` `pkg-config gobject-2.0 --libs`"
++          lasso_libs="`$PKG_CONFIG lasso --libs` `$PKG_CONFIG gobject-2.0 --libs`"
+           cfgwrite "LASSO_LIBS := $lasso_libs"
+       fi;
+   fi
+--- sogo.orig/ActiveSync/GNUmakefile
++++ sogo/ActiveSync/GNUmakefile
+@@ -5,6 +5,8 @@
+ 
+ BUNDLE_NAME = ActiveSync
+ 
++PKG_CONFIG ?= pkg-config
++
+ ActiveSync_PRINCIPAL_CLASS = ActiveSyncProduct
+ 
+ ActiveSync_OBJC_FILES =			\
+@@ -34,7 +36,7 @@
+ ADDITIONAL_OBJCFLAGS += -Wno-deprecated-declarations
+ ADDITIONAL_INCLUDE_DIRS += -I../SOPE/ -I../SoObjects/
+ ADDITIONAL_LIB_DIRS += -L../SOPE/GDLContentStore/obj/ -L../SOPE/NGCards/obj/
+-ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libwbxml2)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libwbxml2)
+ ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -lwbxml2
+ 
+ -include GNUmakefile.preamble
+--- sogo.orig/SoObjects/SOGo/GNUmakefile.preamble
++++ sogo/SoObjects/SOGo/GNUmakefile.preamble
+@@ -3,6 +3,7 @@
+ SOGo_INCLUDE_DIRS += -I.. -I../../UI 
+ 
+ HOSTNAME ?= $(shell hostname -f)
++PKG_CONFIG ?= pkg-config
+ 
+ ADDITIONAL_CPPFLAGS += \
+         -DSOGO_LIBDIR="\"$(SOGO_LIBDIR)\"" \
+@@ -46,7 +47,7 @@
+ endif
+ 
+ ifeq ($(HAS_LIBRARY_sodium), yes)
+-ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `pkg-config --cflags libsodium`
++ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `$$PKG_CONFIG --cflags libsodium`
+ SOGo_LIBRARIES_DEPEND_UPON += -lsodium
+ endif
+ 
+--- sogo.orig/Tests/Unit/GNUmakefile
++++ sogo/Tests/Unit/GNUmakefile
+@@ -6,6 +6,8 @@
+ include $(GNUSTEP_MAKEFILES)/common.make
+ include ../../Version
+ 
++PKG_CONFIG ?= pkg-config
++
+ TEST_TOOL = sogo-tests
+ $(TEST_TOOL)_INSTALL_DIR = $(SOGO_ADMIN_TOOLS)
+ $(TEST_TOOL)_OBJC_FILES += \
+@@ -51,7 +53,7 @@
+ ADDITIONAL_LDFLAGS += -Wl,--no-as-needed
+ 
+ ifeq ($(HAS_LIBRARY_sodium), yes)
+-ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `pkg-config --cflags libsodium`
++ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `$$PKG_CONFIG --cflags libsodium`
+ endif
+ 
+ 
diff --git a/debian/patches/libxml2.patch b/debian/patches/libxml2.patch
index 99e8184b8..2c46a7798 100644
--- a/debian/patches/libxml2.patch
+++ b/debian/patches/libxml2.patch
@@ -7,7 +7,7 @@ Index: sogo/SoObjects/Mailer/GNUmakefile
  
  ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 -ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags)
-+ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libxml-2.0)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libxml-2.0)
  
  -include GNUmakefile.preamble
  include $(GNUSTEP_MAKEFILES)/wobundle.make
@@ -20,7 +20,7 @@ Index: sogo/UI/MailPartViewers/GNUmakefile
  # make
  
 -ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags)
-+ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libxml-2.0)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libxml-2.0)
  ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/ -L../../SoObjects/Mailer/obj -L../../SoObjects/Appointments/obj
  ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
  
diff --git a/debian/patches/series b/debian/patches/series
index d31cdbf3e..b3bc96c15 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ disable_test_rendering.patch
 0009-Omit-signedViewer-altogether-when-not-using-openssl.patch
 python3.patch
 disable_isIpv4_test.patch
+cross.patch
diff --git a/debian/rules b/debian/rules
index ce258b63b..370240a1b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,7 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 export DH_VERBOSE=1
+include /usr/share/GNUstep/debian/config.mk
 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
 DEB_HOST_ARCH_ENDIAN ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-- 
2.47.2

-------------- next part --------------
>From a993c092b3de4c6055abf4338f25253e3c18791f Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor at gnu.org>
Date: Mon, 27 Jan 2025 00:23:49 +0200
Subject: [PATCH] Fixes for cross building.

---
 debian/changelog             |  8 +++-
 debian/control               |  3 +-
 debian/patches/cross.patch   | 90 ++++++++++++++++++++++++++++++++++++
 debian/patches/libxml2.patch |  4 +-
 debian/patches/series        |  1 +
 debian/rules                 |  1 +
 6 files changed, 101 insertions(+), 6 deletions(-)
 create mode 100644 debian/patches/cross.patch

diff --git a/debian/changelog b/debian/changelog
index 5dad566e2..7bf11061b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
 sogo (5.11.2-2) UNRELEASED; urgency=medium
 
   * debian/control (Build-Depends): Bump libsbjson-dev and libsope-dev to
-    ensure the package is rebuilt for the multiarch layout.
-  * debian/rules (override_dh_auto_install): Fix paths when moving files.
+    ensure the package is rebuilt for the multiarch layout.  Remove
+    unnecessary gobjc; annotate python3 with :any.
+  * debian/rules: Include gnustep-make's config.mk.
+    (override_dh_auto_install): Fix paths when moving files.
     Delete statements handled by dh_gnustep.
     (execute_before_dh_link): Run dh_gnustep --bundle-dir to create
     symlinks and move files to sogo-common.
@@ -11,6 +13,8 @@ sogo (5.11.2-2) UNRELEASED; urgency=medium
   * debian/sogo-common.links: Delete.
   * debian/sogo-common.install: Add usr/lib/*/GNUstep/Libraries.
   * debian/sogo.links: New file.
+  * debian/patches/libxml2.patch: Dont' hard code pkg-config.
+  * debian/patches/cross.patch: New; fix FTCBFS.
 
  -- Yavor Doganov <yavor at gnu.org>  Sun, 26 Jan 2025 19:53:26 +0200
 
diff --git a/debian/control b/debian/control
index a80d3005f..056f6e233 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,6 @@ Maintainer: Debian SOGo Maintainers <pkg-sogo-maintainers at lists.alioth.debian.or
 Uploaders: Jeroen Dekkers <jeroen at dekkers.ch>,
            Jordi Mallach <jordi at debian.org>
 Build-Depends: debhelper-compat (= 13),
- gobjc,
  libcurl4-openssl-dev,
  libgnustep-base-dev,
  liblasso3-dev,
@@ -21,7 +20,7 @@ Build-Depends: debhelper-compat (= 13),
  libytnef-dev,
  libzip-dev,
  pkgconf,
- python3
+ python3:any
 Standards-Version: 4.7.0
 Homepage: https://sogo.nu/
 Vcs-Browser: https://salsa.debian.org/debian/sogo
diff --git a/debian/patches/cross.patch b/debian/patches/cross.patch
new file mode 100644
index 000000000..b205d8e64
--- /dev/null
+++ b/debian/patches/cross.patch
@@ -0,0 +1,90 @@
+Description: Fix FTCBFS.
+Author: Yavor Doganov <yavor at gnu.org>
+Forwarded: no
+Last-Update: 2025-01-26
+---
+
+--- sogo.orig/configure
++++ sogo/configure
+@@ -11,6 +11,10 @@
+ 
+ TOPDIR="$(cd `dirname $0`; pwd)"
+ 
++if [ -z "$PKG_CONFIG" ]; then
++    PKG_CONFIG=pkg-config
++fi
++
+ # we ensure that the configure script is run from TOPDIR
+ cd "${TOPDIR}"
+ 
+@@ -408,9 +412,9 @@
+   if test "x$ARG_ENABLE_SAML2" = "x1"; then
+       checkLinking "lasso"   required;
+       if test $? = 0; then
+-          lasso_cflags="`pkg-config lasso --cflags`"
++          lasso_cflags="`$PKG_CONFIG lasso --cflags`"
+           cfgwrite "LASSO_CFLAGS := $lasso_cflags"
+-          lasso_libs="`pkg-config lasso --libs` `pkg-config gobject-2.0 --libs`"
++          lasso_libs="`$PKG_CONFIG lasso --libs` `$PKG_CONFIG gobject-2.0 --libs`"
+           cfgwrite "LASSO_LIBS := $lasso_libs"
+       fi;
+   fi
+--- sogo.orig/ActiveSync/GNUmakefile
++++ sogo/ActiveSync/GNUmakefile
+@@ -5,6 +5,8 @@
+ 
+ BUNDLE_NAME = ActiveSync
+ 
++PKG_CONFIG ?= pkg-config
++
+ ActiveSync_PRINCIPAL_CLASS = ActiveSyncProduct
+ 
+ ActiveSync_OBJC_FILES =			\
+@@ -34,7 +36,7 @@
+ ADDITIONAL_OBJCFLAGS += -Wno-deprecated-declarations
+ ADDITIONAL_INCLUDE_DIRS += -I../SOPE/ -I../SoObjects/
+ ADDITIONAL_LIB_DIRS += -L../SOPE/GDLContentStore/obj/ -L../SOPE/NGCards/obj/
+-ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libwbxml2)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libwbxml2)
+ ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -lwbxml2
+ 
+ -include GNUmakefile.preamble
+--- sogo.orig/SoObjects/SOGo/GNUmakefile.preamble
++++ sogo/SoObjects/SOGo/GNUmakefile.preamble
+@@ -3,6 +3,7 @@
+ SOGo_INCLUDE_DIRS += -I.. -I../../UI 
+ 
+ HOSTNAME ?= $(shell hostname -f)
++PKG_CONFIG ?= pkg-config
+ 
+ ADDITIONAL_CPPFLAGS += \
+         -DSOGO_LIBDIR="\"$(SOGO_LIBDIR)\"" \
+@@ -46,7 +47,7 @@
+ endif
+ 
+ ifeq ($(HAS_LIBRARY_sodium), yes)
+-ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `pkg-config --cflags libsodium`
++ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `$$PKG_CONFIG --cflags libsodium`
+ SOGo_LIBRARIES_DEPEND_UPON += -lsodium
+ endif
+ 
+--- sogo.orig/Tests/Unit/GNUmakefile
++++ sogo/Tests/Unit/GNUmakefile
+@@ -6,6 +6,8 @@
+ include $(GNUSTEP_MAKEFILES)/common.make
+ include ../../Version
+ 
++PKG_CONFIG ?= pkg-config
++
+ TEST_TOOL = sogo-tests
+ $(TEST_TOOL)_INSTALL_DIR = $(SOGO_ADMIN_TOOLS)
+ $(TEST_TOOL)_OBJC_FILES += \
+@@ -51,7 +53,7 @@
+ ADDITIONAL_LDFLAGS += -Wl,--no-as-needed
+ 
+ ifeq ($(HAS_LIBRARY_sodium), yes)
+-ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `pkg-config --cflags libsodium`
++ADDITIONAL_CPPFLAGS += -DHAVE_SODIUM=1 `$$PKG_CONFIG --cflags libsodium`
+ endif
+ 
+ 
diff --git a/debian/patches/libxml2.patch b/debian/patches/libxml2.patch
index 99e8184b8..2c46a7798 100644
--- a/debian/patches/libxml2.patch
+++ b/debian/patches/libxml2.patch
@@ -7,7 +7,7 @@ Index: sogo/SoObjects/Mailer/GNUmakefile
  
  ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 -ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags)
-+ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libxml-2.0)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libxml-2.0)
  
  -include GNUmakefile.preamble
  include $(GNUSTEP_MAKEFILES)/wobundle.make
@@ -20,7 +20,7 @@ Index: sogo/UI/MailPartViewers/GNUmakefile
  # make
  
 -ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags)
-+ADDITIONAL_INCLUDE_DIRS += $(shell pkg-config --cflags libxml-2.0)
++ADDITIONAL_INCLUDE_DIRS += $(shell $$PKG_CONFIG --cflags libxml-2.0)
  ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/ -L../../SoObjects/Mailer/obj -L../../SoObjects/Appointments/obj
  ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
  
diff --git a/debian/patches/series b/debian/patches/series
index d31cdbf3e..b3bc96c15 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ disable_test_rendering.patch
 0009-Omit-signedViewer-altogether-when-not-using-openssl.patch
 python3.patch
 disable_isIpv4_test.patch
+cross.patch
diff --git a/debian/rules b/debian/rules
index 7e4804beb..c0fdd654c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,7 @@
 #!/usr/bin/make -f
 # -*- makefile -*-
 export DH_VERBOSE=1
+include /usr/share/GNUstep/debian/config.mk
 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
 DEB_HOST_ARCH_ENDIAN ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_ENDIAN)
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-- 
2.47.2



More information about the Pkg-sogo-maintainers mailing list