Bug#919453: mumble FTCBFS: builds for the wrong architecture

2019-01-16 Thread Chris Knadle
Lisandro Damián Nicanor Pérez Meyer:
> Hi everyone!

Greetings again Lisandro. :)

> El miércoles, 16 de enero de 2019 14:53:19 -03 Helmut Grohne escribió:
>> Hi Chris,
>>
> [snip]
>>> I had a chance to review the patch.  The fix hinges on this function call:
>>>PKG_CONFIG = $$pkgConfigExecutable()
>>>
>>> Could you let me know where this function call exists, i.e. what package
>>> it's in so I can look at it?  I haven't been able to find it, and to try
>>> to get a patch upstream I need to understand and be able to explain what
>>> this is for and what it does.
>>
>> Unfortunately, I cannot precisely answer that question. I'll have to
>> defer to Lisandro or Dmitry (both Cced here). In any case, the reason is
>> that your dependencies (aka .pc files) may be present for multiple
>> architectures and for cross building that matters. So you need to
>> somehow specify to pkg-config, which architecture you are interested in.
>> On Debian systems you do that by invoking a different pkg-config.
>> Typically, that's ${DEB_HOST_GNU_TYPE}-pkg-config. So I can tell, what
>> this call does (but not where it comes from): It returns the pkg-config
>> that the user (in this case dh_auto_configure) supplied to the build.
>>
>> A quick codesearch[1] reveals that it is defined somewhere in
>> qtbase-opensource-src, so it should come with any qmake installation
>> based on qt5.
> 
> qmake as a build system has support for using pkgconfig. I have not used this 
> myself (I strongly prefer CMake), but glazing at the code it's just the way 
> qmake passes the path to pkgconfig.

Looking at the code (below), that sounds right.

This is what I was looking for:

root@code-devel:/# fgrep -r pkgConfigExecutable /usr/*
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf:defineReplace(pkgConfigExecutable)
{
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf:pkg_config =
$$pkgConfigExecutable()

root@code-devel:/# dpkg -S
/usr/lib/x85_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf
qt5-qmake:amd64: /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf

So it's part of the qt5-qmake package, thus part of Qt5 itself.  That's most of
what I needed to know.

The code section in qt_functions.prf:

[...]
defineReplace(pkgConfigExecutable) {
isEmpty(PKG_CONFIG) {
!isEmpty(QMAKE_PKG_CONFIG): \
PKG_CONFIG = $$QMAKE_PKG_CONFIG
else: \
PKG_CONFIG = pkg-config

sysroot.name = PKG_CONFIG_SYSROOT_DIR
sysroot.value = $$PKG_CONFIG_SYSROOT_DIR
libdir.name = PKG_CONFIG_LIBDIR
libdir.value = $$PKG_CONFIG_LIBDIR
QT_TOOL_NAME = pkg-config
qtAddToolEnv(PKG_CONFIG, sysroot libdir, SYS)
}

equals(QMAKE_HOST.os, Windows): \
PKG_CONFIG += 2> NUL
else: \
PKG_CONFIG += 2> /dev/null

return($$PKG_CONFIG)
}
[...]

I'm satisfied.  I'll open an issue with Mumble upstream to see if I can get the
patch incorporated for Mumble 1.3.  The build for mumble
1.3.0~git20190114.9fcc588+dfsg-1 hasn't completed for 3 architectures, and I'd
like to wait the 5 days for the package to transition to Testing/Buster -- I
plan to upload a package with the patch after that.

Thanks very much for this work.

   -- Chris

-- 
Chris Knadle
chris.kna...@coredump.us



signature.asc
Description: OpenPGP digital signature


Bug#919453: mumble FTCBFS: builds for the wrong architecture

2019-01-16 Thread Lisandro Damián Nicanor Pérez Meyer
Hi everyone!

El miércoles, 16 de enero de 2019 14:53:19 -03 Helmut Grohne escribió:
> Hi Chris,
> 
[snip]
> > I had a chance to review the patch.  The fix hinges on this function call:
> >PKG_CONFIG = $$pkgConfigExecutable()
> > 
> > Could you let me know where this function call exists, i.e. what package
> > it's in so I can look at it?  I haven't been able to find it, and to try
> > to get a patch upstream I need to understand and be able to explain what
> > this is for and what it does.
> 
> Unfortunately, I cannot precisely answer that question. I'll have to
> defer to Lisandro or Dmitry (both Cced here). In any case, the reason is
> that your dependencies (aka .pc files) may be present for multiple
> architectures and for cross building that matters. So you need to
> somehow specify to pkg-config, which architecture you are interested in.
> On Debian systems you do that by invoking a different pkg-config.
> Typically, that's ${DEB_HOST_GNU_TYPE}-pkg-config. So I can tell, what
> this call does (but not where it comes from): It returns the pkg-config
> that the user (in this case dh_auto_configure) supplied to the build.
> 
> A quick codesearch[1] reveals that it is defined somewhere in
> qtbase-opensource-src, so it should come with any qmake installation
> based on qt5.

qmake as a build system has support for using pkgconfig. I have not used this 
myself (I strongly prefer CMake), but glazing at the code it's just the way 
qmake passes the path to pkgconfig.

Kinds regards, Lisandro.

-- 
"A computer is like an air conditioner. It stops working when you open
windows."

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/


signature.asc
Description: This is a digitally signed message part.


Bug#919453: mumble FTCBFS: builds for the wrong architecture

2019-01-16 Thread Helmut Grohne
Hi Chris,

On Wed, Jan 16, 2019 at 04:52:35PM +, Chris Knadle wrote:
> > mumble fails to cross build from source, because it calls the build
> > architecture qmake. It actually calls qmake twice: Once via
> > dh_auto_configure and once directly from debian/rules. The call via
> > dh_auto_configure uses the right qmake, but the wrong flags. Merging
> > those calls into one fixes this part. Then mumble hard codes the build
> > architecture pkg-config in a lot of places. Making those calls
> > substitutable should be upstreamable and makes mumble cross buildable.
> > Please consider applying the attached patch.
> 
> I was not aware that dh_auto_configure is calling qmake such that there were
> duplicate calls; I'd like to fix that.  I'd also like to have Mumble be cross
> buildable.

dh_auto_configure figures out what kind of build system is to be used
and issues the corresponding call. In your case, it figures that it
should call qmake. My patch stuffs your qmake flags into
dh_auto_configure's qmake call.

> I had a chance to review the patch.  The fix hinges on this function call:
> 
>PKG_CONFIG = $$pkgConfigExecutable()
> 
> Could you let me know where this function call exists, i.e. what package it's 
> in
> so I can look at it?  I haven't been able to find it, and to try to get a 
> patch
> upstream I need to understand and be able to explain what this is for and what
> it does.

Unfortunately, I cannot precisely answer that question. I'll have to
defer to Lisandro or Dmitry (both Cced here). In any case, the reason is
that your dependencies (aka .pc files) may be present for multiple
architectures and for cross building that matters. So you need to
somehow specify to pkg-config, which architecture you are interested in.
On Debian systems you do that by invoking a different pkg-config.
Typically, that's ${DEB_HOST_GNU_TYPE}-pkg-config. So I can tell, what
this call does (but not where it comes from): It returns the pkg-config
that the user (in this case dh_auto_configure) supplied to the build.

A quick codesearch[1] reveals that it is defined somewhere in
qtbase-opensource-src, so it should come with any qmake installation
based on qt5.

Does that help already? If not, please follow up with Lisandro and
Dmitry.

And yes, I specifically tried to write that patch in an upstreamable
manner. If that doesn't work, I'm happy to adapt for future patches.

Helmut

[1] https://codesearch.debian.net/search?q=pkgConfigExecutable



Bug#919453: mumble FTCBFS: builds for the wrong architecture

2019-01-16 Thread Chris Knadle
Helmut Grohne:
> Source: mumble
> Version: 1.3.0~git20190114.9fcc588+dfsg-1
> Tags: patch
> User: helm...@debian.org
> Usertags: rebootstrap
> 
> mumble fails to cross build from source, because it calls the build
> architecture qmake. It actually calls qmake twice: Once via
> dh_auto_configure and once directly from debian/rules. The call via
> dh_auto_configure uses the right qmake, but the wrong flags. Merging
> those calls into one fixes this part. Then mumble hard codes the build
> architecture pkg-config in a lot of places. Making those calls
> substitutable should be upstreamable and makes mumble cross buildable.
> Please consider applying the attached patch.
> 
> Helmut

I was not aware that dh_auto_configure is calling qmake such that there were
duplicate calls; I'd like to fix that.  I'd also like to have Mumble be cross
buildable.

I had a chance to review the patch.  The fix hinges on this function call:

   PKG_CONFIG = $$pkgConfigExecutable()

Could you let me know where this function call exists, i.e. what package it's in
so I can look at it?  I haven't been able to find it, and to try to get a patch
upstream I need to understand and be able to explain what this is for and what
it does.

Thanks
   -- Chris

-- 
Chris Knadle
chris.kna...@coredump.us



Bug#919453: mumble FTCBFS: builds for the wrong architecture

2019-01-15 Thread Helmut Grohne
Source: mumble
Version: 1.3.0~git20190114.9fcc588+dfsg-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

mumble fails to cross build from source, because it calls the build
architecture qmake. It actually calls qmake twice: Once via
dh_auto_configure and once directly from debian/rules. The call via
dh_auto_configure uses the right qmake, but the wrong flags. Merging
those calls into one fixes this part. Then mumble hard codes the build
architecture pkg-config in a lot of places. Making those calls
substitutable should be upstreamable and makes mumble cross buildable.
Please consider applying the attached patch.

Helmut
diff --minimal -Nru mumble-1.3.0~git20190114.9fcc588+dfsg/debian/changelog 
mumble-1.3.0~git20190114.9fcc588+dfsg/debian/changelog
--- mumble-1.3.0~git20190114.9fcc588+dfsg/debian/changelog  2019-01-15 
06:53:33.0 +0100
+++ mumble-1.3.0~git20190114.9fcc588+dfsg/debian/changelog  2019-01-16 
06:24:27.0 +0100
@@ -1,3 +1,12 @@
+mumble (1.3.0~git20190114.9fcc588+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
++ Call qmake once only. Via dh_auto_configure.
++ cross.patch: Do not hard code pkg-config.
+
+ -- Helmut Grohne   Wed, 16 Jan 2019 06:24:27 +0100
+
 mumble (1.3.0~git20190114.9fcc588+dfsg-1) unstable; urgency=medium
 
   * New upstream git snapshot from 2019-01-14
diff --minimal -Nru 
mumble-1.3.0~git20190114.9fcc588+dfsg/debian/patches/cross.path 
mumble-1.3.0~git20190114.9fcc588+dfsg/debian/patches/cross.path
--- mumble-1.3.0~git20190114.9fcc588+dfsg/debian/patches/cross.path 
1970-01-01 01:00:00.0 +0100
+++ mumble-1.3.0~git20190114.9fcc588+dfsg/debian/patches/cross.path 
2019-01-16 06:24:27.0 +0100
@@ -0,0 +1,148 @@
+--- mumble-1.3.0~git20190114.9fcc588+dfsg.orig/main.pro
 mumble-1.3.0~git20190114.9fcc588+dfsg/main.pro
+@@ -11,7 +11,7 @@
+ SUBDIRS *= src/mumble_proto
+ 
+ !CONFIG(no-client) {
+-  unix:!CONFIG(bundled-speex):system(pkg-config --atleast-version=1.2 
speexdsp):system(pkg-config --atleast-version=1.2 speex) {
++  unix:!CONFIG(bundled-speex):system($$PKG_CONFIG --atleast-version=1.2 
speexdsp):system($$PKG_CONFIG --atleast-version=1.2 speex) {
+ CONFIG *= no-bundled-speex
+   }
+   !CONFIG(no-bundled-speex) {
+@@ -21,7 +21,7 @@
+   CONFIG(sbcelt) {
+ SUBDIRS *= 3rdparty/celt-0.7.0-build 3rdparty/sbcelt-lib-build 
3rdparty/sbcelt-helper-build
+   } else {
+-unix:!CONFIG(bundled-celt):system(pkg-config --atleast-version=0.7.0 
celt) {
++unix:!CONFIG(bundled-celt):system($$PKG_CONFIG --atleast-version=0.7.0 
celt) {
+   CONFIG *= no-bundled-celt
+ }
+ !CONFIG(no-bundled-celt) {
+@@ -100,7 +100,7 @@
+ SUBDIRS *= src/murmur/murmur_ice
+   }
+   CONFIG(grpc) {
+-!system(pkg-config --atleast-version=3 protobuf) {
++!system($$PKG_CONFIG --atleast-version=3 protobuf) {
+   error(grpc requires protobuf>=3)
+ }
+ SUBDIRS *= src/murmur_grpcwrapper_protoc_plugin
+--- mumble-1.3.0~git20190114.9fcc588+dfsg.orig/qmake/compiler.pri
 mumble-1.3.0~git20190114.9fcc588+dfsg/qmake/compiler.pri
+@@ -8,6 +8,7 @@
+ include(buildenv.pri)
+ include(builddir.pri)
+ include(cplusplus.pri)
++include(pkgconfig.pri)
+ 
+ CONFIG *= warn_on
+ 
+--- mumble-1.3.0~git20190114.9fcc588+dfsg.orig/qmake/pkgconfig.pri
 mumble-1.3.0~git20190114.9fcc588+dfsg/qmake/pkgconfig.pri
+@@ -3,6 +3,8 @@
+ # that can be found in the LICENSE file at the root of the
+ # Mumble source tree or at .
+ 
++PKG_CONFIG = $$pkgConfigExecutable()
++
+ # must_pkgconfig(pkg)
+ #
+ # This function checks if the passed-in package
+@@ -17,7 +19,7 @@
+ #
+ defineTest(must_pkgconfig) {
+   pkg = $$1
+-  system(pkg-config --exists $$pkg) {
++  system($$PKG_CONFIG --exists $$pkg) {
+   PKGCONFIG *= $$pkg
+   export(PKGCONFIG)
+   } else {
+--- mumble-1.3.0~git20190114.9fcc588+dfsg.orig/src/mumble.pri
 mumble-1.3.0~git20190114.9fcc588+dfsg/src/mumble.pri
+@@ -123,7 +123,7 @@
+ 
+ unix {
+   CONFIG(static) {
+-  PKG_CONFIG = pkg-config --static
++  PKG_CONFIG += --static
+   }
+ 
+   INCLUDEPATH *= "/usr/include/speech-dispatcher"
+--- mumble-1.3.0~git20190114.9fcc588+dfsg.orig/src/mumble/mumble.pro
 mumble-1.3.0~git20190114.9fcc588+dfsg/src/mumble/mumble.pro
+@@ -281,7 +281,7 @@
+   DEFINES *= USE_MANUAL_PLUGIN
+ }
+ 
+-unix:!CONFIG(bundled-speex):system(pkg-config --atleast-version=1.2 
speexdsp):system(pkg-config --atleast-version=1.2 speex) {
++unix:!CONFIG(bundled-speex):system($$PKG_CONFIG --atleast-version=1.2 
speexdsp):system($$PKG_CONFIG --atleast-version=1.2 speex) {
+   CONFIG *= no-bundled-speex
+ }
+ 
+@@ -315,7 +315,7 @@
+   LIBS *= -lcelt -lsbcelt
+   DEFINES *= SBCELT_PREFIX_API SBCELT_COMPAT_API USE_SBCELT
+ } else {
+-  unix:!CONFIG(bundled-celt):system(pkg-config --atleast-version=0.7.0 celt) {
++  unix:!CONFIG(bundled-celt):system($$