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

Bug#991213: syncmaildir FTCBFS -- uses pkg-config of build architecture



Package: syncmaildir
Version: 1.3.0-1.1
Severity: normal
User: debian-cross@lists.debian.org
Usertags: ftcbfs
X-Debbugs-Cc: nilesh@debian.org, debian-cross@lists.debian.org

Tags: patch

Dear Maintainer,

1. syncmaildir hardcodes pkg-config in Makefile, due to which the
pkg-config prefixed with the triplet of the host architecture (which
debhelper passes by default) does not propagate.

2. Other than that, the d/rules file uses $(MAKE) which can simply be
replaced by dh_auto_build to directly propagate needed flags

3. Also, since the buildsystem in Makefile based, it makes sense to add in
--buildsystem=makefile to dh $@

4. Finally, the application of patches in d/patches seems a bit weird,
since it seems that they are _applied and committed_ to the project's source directory and then
uploaded. While that is fine in practice, but adding new patches with
quilt 
IMO, there should be some

$ git apply -R debian/patches/replace-use-of-grep--wc-with-grep--c-for.patch
$ echo $?
0
$ git commit -am 'Remove applied patch from root'

done before uploading.

Anyways, I've implemented changes in points 1,2,3 and made a patch,
please consider to apply this.

Nilesh

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages syncmaildir depends on:
ii  libc6           2.31-3
ii  libglib2.0-0    2.66.0-2
pn  lua5.1          <none>
ii  openssh-client  1:8.4p1-5
ii  xdelta          1.1.3-9.3

syncmaildir recommends no packages.

syncmaildir suggests no packages.
diff -Nru syncmaildir-1.3.0/debian/patches/cross_build.patch syncmaildir-1.3.0/debian/patches/cross_build.patch
--- syncmaildir-1.3.0/debian/patches/cross_build.patch	1970-01-01 00:00:00.000000000 +0000
+++ syncmaildir-1.3.0/debian/patches/cross_build.patch	2021-04-21 14:05:47.000000000 +0000
@@ -0,0 +1,39 @@
+diff --git a/Makefile b/Makefile
+index ee2704e..e536007 100644
+--- a/Makefile
++++ b/Makefile
+@@ -42,6 +42,7 @@ LUAV=5.1
+ LUA=lua$(LUAV)
+ CFLAGS=-O2 -Wall -Wextra -Wcast-align -g
+ PKG_FLAGS=
++PKG_CONFIG?=pkg-config
+ 
+ # ----------------------------------------------------------------------------
+ # Rules follow...
+@@ -81,12 +82,12 @@ smd-applet.c: smd-applet.vala smd-config.vapi
+ mddiff: mddiff.c smd-config.h
+ 	@echo CC $<
+ 	$H $(CC) $(CFLAGS) $< -o $@ \
+-		`pkg-config $(PKG_FLAGS) --cflags --libs glib-2.0` $(LDFLAGS)
++		`$(PKG_CONFIG) $(PKG_FLAGS) --cflags --libs glib-2.0` $(LDFLAGS)
+ 
+ smd-applet: $(SMD_APPLET_C) smd-config.h
+ 	@echo CC $<
+ 	$H $(CC) $(CFLAGS) -w $< -o $@ \
+-		`pkg-config $(PKG_FLAGS) --cflags --libs $(PKGS_VALA)` \
++		`$(PKG_CONFIG) $(PKG_FLAGS) --cflags --libs $(PKGS_VALA)` \
+ 		$(LDFLAGS)
+ 
+ $(GSCHEMAS_COMPILED): $(GSCHEMAS)
+@@ -98,9 +99,9 @@ $(GSCHEMAS_COMPILED): $(GSCHEMAS)
+ 		echo WARN: export XDG_DATA_DIRS=\$$XDG_DATA_DIRS:xdg/
+ 
+ check-build: check-w-gcc check-w-$(VALAC) check-w-glib-compile-schemas
+-	$H pkg-config $(PKGCONFIG_CHECK_GLIB_VERSION) || \
++	$H $(PKG_CONFIG) $(PKGCONFIG_CHECK_GLIB_VERSION) || \
+ 		(echo glib version too old: \
+-			`pkg-config $(PKGCONFIG_GLIB_VERSION)`; \
++			`$(PKG_CONFIG) $(PKGCONFIG_GLIB_VERSION)`; \
+ 		 echo required version: $(TARGET_GLIB); \
+ 		 false)
+ 
diff -Nru syncmaildir-1.3.0/debian/patches/series syncmaildir-1.3.0/debian/patches/series
--- syncmaildir-1.3.0/debian/patches/series	2021-04-21 14:05:47.000000000 +0000
+++ syncmaildir-1.3.0/debian/patches/series	2021-04-21 14:05:47.000000000 +0000
@@ -1,2 +1,3 @@
 #link-against-gthread2
 replace-use-of-grep--wc-with-grep--c-for.patch
+cross_build.patch
diff -Nru syncmaildir-1.3.0/debian/rules syncmaildir-1.3.0/debian/rules
--- syncmaildir-1.3.0/debian/rules	2021-04-21 14:05:47.000000000 +0000
+++ syncmaildir-1.3.0/debian/rules	2021-04-21 14:05:47.000000000 +0000
@@ -1,7 +1,7 @@
 #! /usr/bin/make -f
 
 %:
-	dh $@
+	dh $@ --buildsystem=makefile
 
 # I think this makes the application more robust in face of badly set
 # PATH, since external programs are looked up with absolute paths. 
@@ -9,7 +9,7 @@
 FLAVOUR=abspath/
 
 override_dh_auto_build:
-	$(MAKE) $(FLAVOUR)all PREFIX=usr H= \
+	dh_auto_build -- $(FLAVOUR)all PREFIX=usr H= \
 		CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
 		LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
 
@@ -20,7 +20,9 @@
 	$(MAKE) $(FLAVOUR)install DESTDIR=debian/tmp PREFIX=usr H=
 
 override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	VALGRIND=" " $(MAKE) --no-print-directory $(FLAVOUR)test PREFIX=usr H=
+endif
 
 override_dh_auto_clean:
 	dh_auto_clean

Reply to: