Your message dated Sat, 14 Oct 2017 18:33:58 +0000
with message-id <[email protected]>
and subject line Bug#841761: fixed in cdbs 0.4.155
has caused the Debian Bug report #841761,
regarding cdbs: improve cross compilation with makefile and cmake classes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
841761: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841761
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cdbs
Version: 0.4.148
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: rebootstrap
Control: affects -1 + src:cmt src:duma src:freerdp src:hydrogen

Cross building debian packages that use cdbs does not work as well as it
could work. Recent improvements in debhelper have made a significant
chunk of packages cross build without modification. Maybe we can
replicate that for cdbs? I have a number of small and larger issues:

In 1/class/cmake.mk, the DEB_BUILDDIR variable uses DEB_BUILD_GNU_TYPE.
That sounds wrong as building things for the build architecture is not a
common thing to do. I suggest to change this to DEB_HOST_GNU_TYPE and
note that in the vast majority of uses, this is only an aesthetic
change.

When using cmake for cross compilation, one needs to pass a number of
variables such as CMAKE_SYSTEM_NAME or CMAKE_SYSTEM_PROCESSOR. I think
that cdbs is the right place to add them (as did debhelper) and propose
adding a new variables DEB_CMAKE_CROSS_ARGS to 1/class/cmake.mk to hold
these.

The cmake class defaults to passing $(CC) as CMAKE_C_COMPILER.
Unfortunately, CC defaults to cc and cdbs does nothing to fix that. I
propose that 1/class/langcore.mk changes CC and CXX such that if they
are still at their default values, it will go and substitute
triplet-prefixed versions. Note that for doing so, it should in
principle include 1/rules/buildvars.mk which sets up DEB_HOST_GNU_TYPE
(not done in patch). I wasn't sure whether that is ok, and didn't add
it in my patch. If it is, add the include and drop the "ifneq
($(DEB_HOST_GNU_TYPE),)".

When using the makefile class, it only sets up CC for cross compilation,
but CXX (and PKG_CONFIG) is often needed as well. It also doesn't honour
a user preference for CC.

I note that debhelper's makefile buildsystem doesn't pass CC and friends
via environment but via the make command line, because many Makefiles
set broken defaults (not covered in patch).

I also note that 1/rules/buildvars.mk wonders when to stop setting
DEB_{BUILD,HOST}_* variables. The correct answer is never, because we do
not mandate the use of dpkg-buildpackage. Building a package should
remain possible by invoking "./debian/rules binary". It would be far
better to just include /usr/share/dpkg/architecture.mk though (not
covered in patch).

Most of the issues listed above are addressed in the attached patch.
Aspects messing with includes aren't. Please consider it as a basis for
discussing cross improvements for cdbs and taking the parts that look
like immediate improvements.

Helmut
diff --minimal -Nru cdbs-0.4.148/1/class/cmake.mk.in 
cdbs-0.4.148+nmu1/1/class/cmake.mk.in
--- cdbs-0.4.148/1/class/cmake.mk.in    2016-06-10 12:36:00.000000000 +0200
+++ cdbs-0.4.148+nmu1/1/class/cmake.mk.in       2016-10-23 11:34:31.000000000 
+0200
@@ -29,9 +29,9 @@
 
 # FIXME: Restructure to allow early override (or lowercase the variable!)
 ifdef _cdbs_tarball_dir
-DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_BUILD_GNU_TYPE)
+DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_HOST_GNU_TYPE)
 else
-DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
+DEB_BUILDDIR = obj-$(DEB_HOST_GNU_TYPE)
 endif
 
 # Overriden from makefile-vars.mk
@@ -41,6 +41,18 @@
 
 DEB_MAKE_INSTALL_TARGET ?= install DESTDIR=$(DEB_DESTDIR)
 
+ifneq (,$(cdbs_crossbuild))
+_system_name_map_linux = Linux
+_system_name_map_kfreebsd = FreeBSD
+_system_name_map_hurd = GNU
+ifneq (,$(_system_name_map_$(DEB_HOST_ARCH_OS)))
+DEB_CMAKE_CROSS_ARGS ?= \
+       -DCMAKE_SYSTEM_NAME=$(_system_name_map_$(DEB_HOST_ARCH_OS)) \
+       -DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_GNU_CPU) \
+       -DPKG_CONFIG_EXECUTABLE=/usr/bin/$(DEB_HOST_GNU_TYPE)-pkg-config
+endif
+endif
+
 CMAKE ?= cmake
 DEB_CMAKE_INSTALL_PREFIX ?= /usr
 DEB_CMAKE_CFLAGS ?= $(CFLAGS) $(CPPFLAGS)
@@ -64,6 +76,7 @@
        $(strip cd $(DEB_BUILDDIR) && \
        $(CMAKE) $(CURDIR)/$(DEB_SRCDIR) \
                $(DEB_CMAKE_NORMAL_ARGS) \
+               $(DEB_CMAKE_CROSS_ARGS) \
                $(DEB_CMAKE_EXTRA_FLAGS))
 
 cleanbuilddir::
diff --minimal -Nru cdbs-0.4.148/1/class/langcore.mk.in 
cdbs-0.4.148+nmu1/1/class/langcore.mk.in
--- cdbs-0.4.148/1/class/langcore.mk.in 2016-06-10 12:36:00.000000000 +0200
+++ cdbs-0.4.148+nmu1/1/class/langcore.mk.in    2016-10-23 11:24:56.000000000 
+0200
@@ -43,6 +43,15 @@
 -include debian/_cdbs_buildflags.mk
 $(shell rm -f debian/_cdbs_buildflags.mk)
 
+ifneq ($(DEB_HOST_GNU_TYPE),)
+ifeq ($(origin CC),default)
+CC := $(DEB_HOST_GNU_TYPE)-gcc
+endif
+ifeq ($(origin CXX),default)
+CXX := $(DEB_HOST_GNU_TYPE)-g++
+endif
+endif
+
 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
        DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter 
parallel=%,$(DEB_BUILD_OPTIONS)))
 endif
diff --minimal -Nru cdbs-0.4.148/1/class/makefile-vars.mk.in 
cdbs-0.4.148+nmu1/1/class/makefile-vars.mk.in
--- cdbs-0.4.148/1/class/makefile-vars.mk.in    2016-06-10 12:36:00.000000000 
+0200
+++ cdbs-0.4.148+nmu1/1/class/makefile-vars.mk.in       2016-10-23 
11:19:43.000000000 +0200
@@ -25,7 +25,7 @@
 
 #DEB_MAKE_MAKEFILE =
 DEB_MAKE_ENVVARS ?= $(if $(cdbs_crossbuild),\
-       CC="$(DEB_HOST_GNU_TYPE)-gcc")
+       CC="$(CC)" CXX="$(CXX)" PKG_CONFIG="$(DEB_HOST_GNU_TYPE)-pkg-config")
 DEB_MAKE_PARALLEL ?= $(and $(DEB_BUILD_PARALLEL),$(DEB_PARALLEL_JOBS),\
        -j$(DEB_PARALLEL_JOBS))
 
diff --minimal -Nru cdbs-0.4.148/debian/changelog 
cdbs-0.4.148+nmu1/debian/changelog
--- cdbs-0.4.148/debian/changelog       2016-09-16 10:40:37.000000000 +0200
+++ cdbs-0.4.148+nmu1/debian/changelog  2016-10-23 11:13:08.000000000 +0200
@@ -1,3 +1,10 @@
+cdbs (0.4.148+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross compilation cmake and makefile classes. Closes: #-1.
+
+ -- Helmut Grohne <[email protected]>  Sun, 23 Oct 2016 11:00:44 +0200
+
 cdbs (0.4.148) unstable; urgency=medium
 
   * Fix license-miner.

--- End Message ---
--- Begin Message ---
Source: cdbs
Source-Version: 0.4.155

We believe that the bug you reported is fixed in the latest version of
cdbs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <[email protected]> (supplier of updated cdbs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 14 Oct 2017 19:26:51 +0200
Source: cdbs
Binary: cdbs
Architecture: source all
Version: 0.4.155
Distribution: unstable
Urgency: medium
Maintainer: CDBS Hackers <[email protected]>
Changed-By: Jonas Smedegaard <[email protected]>
Description:
 cdbs       - common build system for Debian packages
Closes: 841761
Changes:
 cdbs (0.4.155) unstable; urgency=medium
 .
   * Fix conditionally set crossbuild compiler.
     Closes: Bug#841761. Thanks to Helmut Grohne.
Checksums-Sha1:
 800512b860eabfa13d70c6779facdcfc7cab3c09 1867 cdbs_0.4.155.dsc
 c7f39d2467af6c9550cd2f9db980f814842b10fa 204952 cdbs_0.4.155.tar.xz
 c8b65503b0da065bdfc75cbbeffe45ee00fb96b5 83104 cdbs_0.4.155_all.deb
 0acc6ab869f2e1b062864a5a586792b2b29777dd 8056 cdbs_0.4.155_amd64.buildinfo
Checksums-Sha256:
 6411b8969db373f5b00e739c1091cff18285f84a0889d3101fa7d2dabc902493 1867 
cdbs_0.4.155.dsc
 26f109169a4538f109ab5ae67edef6e11d276ef27a42ff61cbb7b0c55bf72a40 204952 
cdbs_0.4.155.tar.xz
 2f30aac5d248bc639031cbc5e359b02c9edf27b423dc8992423f8defb0ac92a4 83104 
cdbs_0.4.155_all.deb
 c32c495622f3cbe3375093f3e695d01b8550816e06ae654519c6e9cbe9400bfa 8056 
cdbs_0.4.155_amd64.buildinfo
Files:
 747fe7ca75eaddc424b96b2267e770de 1867 devel optional cdbs_0.4.155.dsc
 ab2b374c813704de38ac1f7b173c473b 204952 devel optional cdbs_0.4.155.tar.xz
 3b8b83ffdbdfa368ccbbbaa6a5a47a66 83104 devel optional cdbs_0.4.155_all.deb
 63f4c6819299fb125996db9be4285fac 8056 devel optional 
cdbs_0.4.155_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAlniVUUACgkQLHwxRsGg
ASGgcBAAh41K6qjzLZU/y/pvfVnYFiR97ikt7HP0BZpTa4LyNEc7G/S97zTI8S+Q
D9tyYthxNu3VoXDo1yf77oW1bTHuZtTzLXeTWR1Dr/KQSgLaYyWuH3sofnWpRsBR
J1cBEPhENGfP2A60J4tjBiY87y65gt7PQrXAeGcFn/AF8YpFa8n6j+3q913L0KMR
LCmmPnSvQ2HMWR6fesLoOT2Mz+GjXpOD8aX12AEnrL2qawkr7I2TUMUwxVcvzN2E
KqQRi06LtkXIlO+f2YIpJfUsr23IXLSIf03Aw4zdeOpKYdfo353Moyc48eW1RorQ
z0DbT/ZtCXPK3tYQkZiRM6ll1lei4pirkBQ6/fmcOhEa3u9MBPVP4yH0t+Z84dUE
PDUsB9k3Rf6gqlV4C6aZl+vC4qI3cMN6ouNnUHlDUtmJ9OO7W2GVjs8c3VnGKbfO
emadTKfgTEBZJiAsukg7lolsenSBywwpBc2BWWAWaDTd939lEFzm689qGbBep49h
h0seQeDoJ3ifmmD8zQCVdsaL7oynMyU+8osXLd101ImYSxzfTRzej+g/exxIe1Uj
ej/LHGwz8mZy7lGjd1Kd49+GwtyWmRXzBXyZ4DIvvWf47aYbpvv/C56b6uWA46VD
GxPVBfNSEOBG+jCERo0PMWVC9Qn8Aq/2I+eVraTY+gWE95nT3dc=
=mjRt
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to