Bug#1060093: lirc: FTBFS on hurd-i386

2024-01-08 Thread Gianfranco Costamagna

Hello,


> > We do want modinfo on the linux platform, please make this os-
> > specific.
> 


Thanks for having a look, feel free to NMU when you agree on the patch.

Alec might be overbusy, I'm pretty sure he doesn't mind some extra help :)

G.



Bug#1060093: lirc: FTBFS on hurd-i386

2024-01-05 Thread Samuel Thibault
Svante Signell, le ven. 05 janv. 2024 23:20:54 +0100, a ecrit:
> On Fri, 2024-01-05 at 21:58 +0100, Samuel Thibault wrote:
> > Svante Signell, le ven. 05 janv. 2024 21:14:19 +0100, a ecrit:
> > > --- a/debian/rules  2023-12-16 18:35:11.0 +0100
> > > +++ b/debian/rules  2024-01-02 12:49:12.0 +0100
> > > @@ -4,7 +4,14 @@
> > >  include /usr/share/dpkg/pkg-info.mk
> > >  
> > >  export DEB_BUILD_MAINT_OPTIONS  = hardening=+all
> > > -export
> > > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DE
> > > B_HOST_MULTIARCH)
> > > +
> > > +ifeq ($(DEB_HOST_ARCH_OS), hurd)
> > > +#FIXME: Replace gnu0 with either gnu or hurd in python3.11!
> > > +#/usr/lib/python3.11/__pycache__/_sysconfigdata__gnu0_i386-
> > > gnu.cpython-311.pyc
> > > +   export
> > > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__gnu0_$(DEB_HOST_MULTIARC
> > > H)
> > > +else
> > > +   export
> > > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DE
> > > B_HOST_MULTIARCH)
> > 
> > Probably better just ask python itself:
> > 
> > export _PYTHON_SYSCONFIGDATA_NAME:=_sysconfigdata__$(shell python3 -c
> > 'import os; print(os.sys.platform)')_$(DEB_HOST_MULTIARCH)
> 
> Why does the os.sys.platform report gnu0? It should be gnu or
> preferrably hurd??

Well, here this question does not matter: it reports what it should
report, i.e. what is used to name the sysconfig data file.

If the string should be changed, that should be discussed with upstream
python, not this package in particular (and this package should just
adapt to whatever os.sys.platform comes to expose).

> > > @@ -33,7 +40,7 @@
> > >  else
> > > dh_auto_configure -- \
> > >     SH_PATH=/bin/sh \
> > > -   MODINFO=/sbin/modinfo \
> > > +   MODINFO= \
> > >     --disable-uinput --disable-devinput
> > 
> > We do want modinfo on the linux platform, please make this os-
> > specific.
> 
> Note the else:
> ifeq ($(DEB_HOST_ARCH_OS), linux)
> dh_auto_configure -- \
> SH_PATH=/bin/sh \
> MODINFO=/sbin/modinfo \
> --enable-uinput --enable-devinput
> else
> dh_auto_configure -- \
> SH_PATH=/bin/sh \
> MODINFO= \
> --disable-uinput --disable-devinput
> endif

Ah, ok, I didn't have the broader context in the patch.

Samuel



Bug#1060093: lirc: FTBFS on hurd-i386

2024-01-05 Thread Svante Signell
On Fri, 2024-01-05 at 21:58 +0100, Samuel Thibault wrote:
> Hello,
> 
> Thanks for your patches.
> 
> Svante Signell, le ven. 05 janv. 2024 21:14:19 +0100, a ecrit:
> > --- a/debian/rules  2023-12-16 18:35:11.0 +0100
> > +++ b/debian/rules  2024-01-02 12:49:12.0 +0100
> > @@ -4,7 +4,14 @@
> >  include /usr/share/dpkg/pkg-info.mk
> >  
> >  export DEB_BUILD_MAINT_OPTIONS  = hardening=+all
> > -export
> > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DE
> > B_HOST_MULTIARCH)
> > +
> > +ifeq ($(DEB_HOST_ARCH_OS), hurd)
> > +#FIXME: Replace gnu0 with either gnu or hurd in python3.11!
> > +#/usr/lib/python3.11/__pycache__/_sysconfigdata__gnu0_i386-
> > gnu.cpython-311.pyc
> > +   export
> > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__gnu0_$(DEB_HOST_MULTIARC
> > H)
> > +else
> > +   export
> > _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DE
> > B_HOST_MULTIARCH)
> 
> Probably better just ask python itself:
> 
> export _PYTHON_SYSCONFIGDATA_NAME:=_sysconfigdata__$(shell python3 -c
> 'import os; print(os.sys.platform)')_$(DEB_HOST_MULTIARCH)

Why does the os.sys.platform report gnu0? It should be gnu or
preferrably hurd??

> > @@ -33,7 +40,7 @@
> >  else
> > dh_auto_configure -- \
> >     SH_PATH=/bin/sh \
> > -   MODINFO=/sbin/modinfo \
> > +   MODINFO= \
> >     --disable-uinput --disable-devinput
> 
> We do want modinfo on the linux platform, please make this os-
> specific.

Note the else:
ifeq ($(DEB_HOST_ARCH_OS), linux)
dh_auto_configure -- \
SH_PATH=/bin/sh \
MODINFO=/sbin/modinfo \
--enable-uinput --enable-devinput
else
dh_auto_configure -- \
SH_PATH=/bin/sh \
MODINFO= \
--disable-uinput --disable-devinput
endif



Bug#1060093: lirc: FTBFS on hurd-i386

2024-01-05 Thread Samuel Thibault
Hello,

Thanks for your patches.

Svante Signell, le ven. 05 janv. 2024 21:14:19 +0100, a ecrit:
> --- a/debian/rules2023-12-16 18:35:11.0 +0100
> +++ b/debian/rules2024-01-02 12:49:12.0 +0100
> @@ -4,7 +4,14 @@
>  include /usr/share/dpkg/pkg-info.mk
>  
>  export DEB_BUILD_MAINT_OPTIONS  = hardening=+all
> -export 
> _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)
> +
> +ifeq ($(DEB_HOST_ARCH_OS), hurd)
> +#FIXME: Replace gnu0 with either gnu or hurd in python3.11!
> +#/usr/lib/python3.11/__pycache__/_sysconfigdata__gnu0_i386-gnu.cpython-311.pyc
> + export 
> _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__gnu0_$(DEB_HOST_MULTIARCH)
> +else
> + export 
> _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_ARCH_OS)_$(DEB_HOST_MULTIARCH)

Probably better just ask python itself:

export _PYTHON_SYSCONFIGDATA_NAME:=_sysconfigdata__$(shell python3 -c 'import 
os; print(os.sys.platform)')_$(DEB_HOST_MULTIARCH)


> @@ -33,7 +40,7 @@
>  else
>   dh_auto_configure -- \
>   SH_PATH=/bin/sh \
> - MODINFO=/sbin/modinfo \
> + MODINFO= \
>   --disable-uinput --disable-devinput

We do want modinfo on the linux platform, please make this os-specific.

Samuel



Bug#1060093: lirc: FTBFS on hurd-i386

2024-01-05 Thread Svante Signell
Source: lirc
Version: 0.10.2-0.2
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-h...@lists.debian.org

Hi,

lirc FTBFS on hurd-i386. (Built in the past, last successful build
version was 0.10.1-5.2)

This is due to usage of __u32 (and __u16,__u64) in
include/media/lirc.h, which is not defined on GNU/Hurd. Additionally
inclusion of header files is ifdef-ed and config.h is included.

Moreover, MODINFO is not available on GNU/Hurd since Hurd does not use
modules at all. This change is reflected in the second patch for
debian/rules.

The two patches enabling a successful build on GNU/Hurd (and
GNU/Linux)are attached in next mail:
- include/media/lirc.h
- debian_rules.patch.

I'm sending this bug report to Debian instead of upstream since this
package has been NMU-ed several times, and the second patch is Debian-
specific.

Thanks!

Index: lirc-0.10.2/include/media/lirc.h
===
--- lirc-0.10.2.orig/include/media/lirc.h
+++ lirc-0.10.2/include/media/lirc.h
@@ -6,8 +6,27 @@
 #ifndef _LINUX_LIRC_H
 #define _LINUX_LIRC_H
 
+#include "config.h"
+
+#ifdef HAVE_STDINT_H
+#include 
+#endif
+
+#ifdef HAVE_LINUX_TYPES_H
 #include 
+#endif
+
+#ifdef HAVE_LINUX_IOCTL_H
 #include 
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include 
+#endif
+
+#ifdef __GNU__
+#include 
+#endif
 
 #define PULSE_BIT   0x0100
 #define PULSE_MASK  0x00FF
@@ -93,55 +112,55 @@
 
 /*** IOCTL commands for lirc driver ***/
 
-#define LIRC_GET_FEATURES  _IOR('i', 0x, __u32)
+#define LIRC_GET_FEATURES  _IOR('i', 0x, uint32_t)
 
-#define LIRC_GET_SEND_MODE _IOR('i', 0x0001, __u32)
-#define LIRC_GET_REC_MODE  _IOR('i', 0x0002, __u32)
-#define LIRC_GET_REC_RESOLUTION_IOR('i', 0x0007, __u32)
+#define LIRC_GET_SEND_MODE _IOR('i', 0x0001, uint32_t)
+#define LIRC_GET_REC_MODE  _IOR('i', 0x0002, uint32_t)
+#define LIRC_GET_REC_RESOLUTION_IOR('i', 0x0007, uint32_t)
 
-#define LIRC_GET_MIN_TIMEOUT   _IOR('i', 0x0008, __u32)
-#define LIRC_GET_MAX_TIMEOUT   _IOR('i', 0x0009, __u32)
+#define LIRC_GET_MIN_TIMEOUT   _IOR('i', 0x0008, uint32_t)
+#define LIRC_GET_MAX_TIMEOUT   _IOR('i', 0x0009, uint32_t)
 
 /* code length in bits, currently only for LIRC_MODE_LIRCCODE */
-#define LIRC_GET_LENGTH_IOR('i', 0x000f, __u32)
+#define LIRC_GET_LENGTH_IOR('i', 0x000f, uint32_t)
 
-#define LIRC_SET_SEND_MODE _IOW('i', 0x0011, __u32)
-#define LIRC_SET_REC_MODE  _IOW('i', 0x0012, __u32)
+#define LIRC_SET_SEND_MODE _IOW('i', 0x0011, uint32_t)
+#define LIRC_SET_REC_MODE  _IOW('i', 0x0012, uint32_t)
 /* Note: these can reset the according pulse_width */
-#define LIRC_SET_SEND_CARRIER  _IOW('i', 0x0013, __u32)
-#define LIRC_SET_REC_CARRIER   _IOW('i', 0x0014, __u32)
-#define LIRC_SET_SEND_DUTY_CYCLE   _IOW('i', 0x0015, __u32)
-#define LIRC_SET_TRANSMITTER_MASK  _IOW('i', 0x0017, __u32)
+#define LIRC_SET_SEND_CARRIER  _IOW('i', 0x0013, uint32_t)
+#define LIRC_SET_REC_CARRIER   _IOW('i', 0x0014, uint32_t)
+#define LIRC_SET_SEND_DUTY_CYCLE   _IOW('i', 0x0015, uint32_t)
+#define LIRC_SET_TRANSMITTER_MASK  _IOW('i', 0x0017, uint32_t)
 
 /*
  * when a timeout != 0 is set the driver will send a
  * LIRC_MODE2_TIMEOUT data packet, otherwise LIRC_MODE2_TIMEOUT is
  * never sent, timeout is disabled by default
  */
-#define LIRC_SET_REC_TIMEOUT   _IOW('i', 0x0018, __u32)
+#define LIRC_SET_REC_TIMEOUT   _IOW('i', 0x0018, uint32_t)
 
 /* 1 enables, 0 disables timeout reports in MODE2 */
-#define LIRC_SET_REC_TIMEOUT_REPORTS   _IOW('i', 0x0019, __u32)
+#define LIRC_SET_REC_TIMEOUT_REPORTS   _IOW('i', 0x0019, uint32_t)
 
 /*
  * if enabled from the next key press on the driver will send
  * LIRC_MODE2_FREQUENCY packets
  */
-#define LIRC_SET_MEASURE_CARRIER_MODE	_IOW('i', 0x001d, __u32)
+#define LIRC_SET_MEASURE_CARRIER_MODE	_IOW('i', 0x001d, uint32_t)
 
 /*
  * to set a range use LIRC_SET_REC_CARRIER_RANGE with the
  * lower bound first and later LIRC_SET_REC_CARRIER with the upper bound
  */
-#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x001f, __u32)
+#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x001f, uint32_t)
 
-#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x0023, __u32)
+#define LIRC_SET_WIDEBAND_RECEIVER _IOW('i', 0x0023, uint32_t)
 
 /*
  * Return the recording timeout, which is either set by
  * the ioctl LIRC_SET_REC_TIMEOUT or by the kernel after setting the protocols.
  */
-#define LIRC_GET_REC_TIMEOUT	   _IOR('i', 0x0024, __u32)
+#define LIRC_GET_REC_TIMEOUT	   _IOR('i', 0x0024, uint32_t)
 
 /**
  * struct