[Python-modules-team] Bug#989304: lirc FTCBFS: multiple reasons

Vagrant Cascadian vagrant at reproducible-builds.org
Thu Nov 30 18:45:20 GMT 2023


On 2021-05-31, Helmut Grohne wrote:
> lirc fails to cross build from source for a number of reasons. I've
> understood a pile and am presenting solutions here:
>
> 1. Its Build-Depends are not satisfiable. python3-dev asks (among other
>    things), for the host architecture Python interpreter, which fails to
>    install. A python(.*)-dev dependency should usually be written as
>    python$1-dev:any, libpython$1-dev. Beyond this, python3-yaml also
>    requests the host architecture Python interpreter. It is meant to be
>    run during build though, so it should be annotated :native.
>
>    Once fixing these, a cross build can be attempted.
>
> 2. configure uses AC_RUN_IFELSE to check for existence of /dev/input. In
>    principle, this is correct. For file existence however, there is a
>    better check: AC_CHECK_FILE. During a cross build, this check also
>    fails and consults the cache variable ac_cv__dev_input. A builder may
>    supply this variable to make the check pass. It also gets a lot
>    simpler by using AC_CHECK_FILE.
>
> 3. debian/rules also confuses the build architecture with the host
>    architecture in two occasions. Please refer to man dpkg-architecture
>    for a precise definition.
>
> 4. In order to make setup.py perform a cross build, one is supposed to
>    export _PYTHON_SYSCONFIGDATA_NAME. When using the pybuild
>    buildsystem, debhelper takes care of that, but here setup.py is run
>    from inside autoconf+make and debhelper cannot know. Thus it needs to
>    be exported explicitly.
>
> 5. When fixing all of the above, what remains is this error:
>
>        /usr/bin/install: cannot stat './python-pkg/dist/lirc-0.10.1.tar.gz': No such file or directory
>
>    I have no clue why this file is created during a regular build but
>    missing during a cross build. Unfortunately, the build hides compiler
>    invocations and such, so we cannot see the relevant commands. I don't
>    have a solution for this issue.
...
> --- lirc-0.10.1/debian/control
> +++ lirc-0.10.1/debian/control
> @@ -18,6 +18,7 @@
>   kmod [linux-any],
>   libasound2-dev [linux-any kfreebsd-any],
>   libftdi1-dev,
> + libpython3-dev (>= 3.5),
>   libsystemd-dev [linux-any],
>   libudev-dev [linux-any],
>   libusb-1.0-0-dev [!kfreebsd-any],
> @@ -26,9 +27,9 @@
>   man2html-base,
>   pkg-config,
>   portaudio19-dev,
> - python3-dev (>= 3.5),
> + python3-dev:any (>= 3.5),
>   python3-setuptools,
> - python3-yaml,
> + python3-yaml:native,
>   socat [!hurd-any],
>   systemd [linux-any],
>   xsltproc
> --- lirc-0.10.1/debian/patches/cross.patch
> +++ lirc-0.10.1/debian/patches/cross.patch
> @@ -0,0 +1,33 @@
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -291,29 +291,12 @@
> + fi
> + 
> + AC_MSG_CHECKING(for devinput)
> +-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
> +-  #include <unistd.h>
> +-]],[[
> +-  return access("/dev/input", R_OK) == 0 ? 0 : 1;
> +-]])],[
> ++AC_CHECK_FILE([/dev/input],[
> +   have_devinput="yes"
> +   AC_MSG_RESULT(yes)
> + ],[
> +   AC_MSG_RESULT(no)
> +   have_devinput="no"
> +-],[
> +-  AS_IF([test x$DEVINPUT_HEADER = x -a x$enable_devinput = xyes], [
> +-    AC_MSG_ERROR([
> +-      cannot cross-compile with devinput without DEVINPUT_HEADER
> +-      defined, giving up
> +-    ])
> +-  ])
> +-  if test -n "$DEVINPUT_HEADER" ; then
> +-    have_devinput="yes"
> +-  else
> +-    have_devinput="no"
> +-  fi
> +-  AC_MSG_RESULT(yes)
> + ])
> + 
> + 
> --- lirc-0.10.1/debian/patches/series
> +++ lirc-0.10.1/debian/patches/series
> @@ -5,3 +5,4 @@
>  0005-systemd-support-Notify-systemd-on-successful-startup.patch
>  lirc-gpio-ir-0.10.patch
>  python3.8.diff
> +cross.patch
> --- lirc-0.10.1/debian/rules
> +++ lirc-0.10.1/debian/rules
> @@ -4,6 +4,7 @@
>  
>  export DEB_BUILD_MAINT_OPTIONS      = hardening=+all
>  export DEB_LDFLAGS_MAINT_APPEND     = -Wl,--as-needed
> +export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)
>  
>  %:
>  	dh $@ --with python3
> @@ -40,7 +41,7 @@
>  	find debian/tmp -name *.la -delete
>  	rm -f debian/tmp/usr/share/doc/lirc/lirc.org/api-docs/api-docs
>  	chmod 755 debian/tmp/usr/share/lirc/python-pkg/lirc/lirctool
> -ifeq ($(DEB_BUILD_ARCH_OS), linux)
> +ifeq ($(DEB_HOST_ARCH_OS), linux)
>  	mkdir -p debian/tmp/usr/lib/tmpfiles.d
>  	echo "d /run/lirc  0755  root  root  10d" \
>  	    > debian/tmp/usr/lib/tmpfiles.d/lirc.conf
> @@ -63,7 +64,7 @@
>  endif
>  
>  override_dh_installsystemd:
> -ifeq ($(DEB_BUILD_ARCH_OS), linux)
> +ifeq ($(DEB_HOST_ARCH_OS), linux)
>  	dh_installsystemd -p lirc lircd.socket
>  	dh_installsystemd -p lirc --no-enable --no-start lircd.service
>  	dh_installsystemd -p lirc --no-enable --no-start irexec.service


I tried this patch against the current sources, but now it fails at
dh_auto_configure.

Build log attached for cross-building i386 (also tried arm64 and armhf
with the same basic issue).

live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lirc_0.10.1-7.3~1cross0_i386-2023-11-29T23:06:48Z.build
Type: application/octet-stream
Size: 253995 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20231130/7d658076/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20231130/7d658076/attachment-0001.sig>


More information about the Python-modules-team mailing list