Source: newt
Version: 0.52.24-2
Severity: important
Justification: breaks architecture cross bootstrap
Tags: patch ftbfs

Hi Alastair,

thanks for fixing my bug #1060660 about not properly propagating build
failure. Unfortunately, the nopython support of newt relied on this
behavior and your fix broke the nopython build that now fails.

I looked into it and couldn't resist doing a bit more refactoring. The
Makefile.in defers a bit of conditionals into the shell level ([ -n
...]) and it also does a detection (py3versions) that I think would be
better deferred to configure.ac. My patch thus proposed to lift shell
conditionals into make-level conditionals and it also proposes to revert
the python.patch that you added and instead passing the desired Python
versions via --with-python to configure. I happen to also fix another
instance of not propagating failure in the install-sh target. In
debian/rules, I suggest absorbing the multiple options into a single
variable CONFIGURE_ARGS that can be appended to. I suggest that you look
into the diff and hope that you find it generally improves matters in an
upstreamable way. In case you prefer a more targeted patch, please let
me know.

Helmut
diff --minimal -Nru newt-0.52.24/debian/changelog newt-0.52.24/debian/changelog
--- newt-0.52.24/debian/changelog       2024-01-15 14:32:29.000000000 +0100
+++ newt-0.52.24/debian/changelog       2024-09-29 09:08:02.000000000 +0200
@@ -1,3 +1,10 @@
+newt (0.52.24-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix nopython build profile. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sun, 29 Sep 2024 09:08:02 +0200
+
 newt (0.52.24-2) unstable; urgency=medium
 
   * Ensure make fails if extension build fails. Closes: #1060660
diff --minimal -Nru newt-0.52.24/debian/patches/nopython.patch 
newt-0.52.24/debian/patches/nopython.patch
--- newt-0.52.24/debian/patches/nopython.patch  1970-01-01 01:00:00.000000000 
+0100
+++ newt-0.52.24/debian/patches/nopython.patch  2024-09-29 09:08:02.000000000 
+0200
@@ -0,0 +1,84 @@
+--- newt-0.52.24.orig/Makefile.in
++++ newt-0.52.24/Makefile.in
+@@ -13,8 +13,13 @@
+ SONAME = @SONAME@
+ SOEXT = so
+ 
+-PYTHONVERS = $(shell py3versions --supported)
++PYTHONVERS = @PYTHONVERS@
+ PYTHONDBG := $(addsuffix -dbg, $(PYTHONVERS))
++ifeq ($(PYTHONVERS),)
++SNACKSO =
++else
++SNACKSO = _snack.$(SOEXT)
++endif
+ WHIPTCLLIB = @WHIPTCLLIB@
+ ifneq ($(WHIPTCLLIB),)
+ WHIPTCLSO = $(WHIPTCLLIB).$(SOEXT)
+@@ -66,7 +71,7 @@
+ TARGET=depend $(PROGS)
+ endif
+ 
+-all:  $(TARGET) _snack.$(SOEXT) whiptcl.$(SOEXT)
++all:  $(TARGET) $(SNACKSO) $(WHIPTCLSO)
+ 
+ test: test.o $(LIBNEWT)
+       $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+@@ -83,8 +88,9 @@
+ showkey:      showkey.o $(LIBNEWT)
+       $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
+ 
+-_snack.$(SOEXT):   snack.c $(LIBNEWTSH)
+-      @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) $(PYTHONDBG); do \
++ifneq ($(SNACKSO),)
++$(SNACKSO):   snack.c $(LIBNEWTSH)
++      @for ver in $(PYTHONVERS) $(PYTHONDBG); do \
+               pyconfig=$$ver-config; \
+               mkdir -p $$ver; \
+               PCFLAGS=`$$pyconfig --cflags`; \
+@@ -97,12 +103,15 @@
+               $(CC) --shared -fPIC $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o 
$$ver/_snack.$(SOEXT) $$ver/snack.o -L.  -lnewt $(LIBS); \
+       done
+       touch $@
++endif
+ 
+ whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
+       $(CC) -g -o whiptail $(NDIALOGOBJS) -L. $(LDFLAGS) -lnewt $(LIBS) -lpopt
+ 
+-whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH)
++ifneq ($(WHIPTCLSO),)
++$(WHIPTCLSO): $(WHIPTCLOBJS) $(LIBNEWTSH)
+       $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) 
-L. -lnewt  $(LIBTCL) -lpopt $(LIBS)
++endif
+ 
+ $(LIBNEWT): $(LIBOBJS)
+       ar rv $@ $^
+@@ -139,7 +148,7 @@
+       install -m 644 whiptail.1 $(instroot)/$(man1dir)
+       make -C po datadir=$(instroot)/$(datadir) install
+ 
+-install-sh: sharedlib $(WHIPTCLSO) _snack.$(SOEXT)
++install-sh: sharedlib $(WHIPTCLSO) $(SNACKSO)
+       [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
+       [ -d $(instroot)/$(includedir) ] || install -m 755 -d 
$(instroot)/$(includedir)
+       [ -d $(instroot)/$(pkgconfigdir) ] || install -m 755 -d 
$(instroot)/$(pkgconfigdir)
+@@ -147,12 +156,16 @@
+       install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
+       ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.$(SOEXT)
+       ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME)
+-      [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.$(SOEXT) 
$(instroot)/$(libdir) || :
+-      [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
++ifneq ($(WHIPTCLSO),)
++      install -m 755 whiptcl.$(SOEXT) $(instroot)/$(libdir)
++endif
++ifneq ($(SNACKSO),)
++      for ver in $(PYTHONVERS) ; do \
+          [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 
-d $(instroot)/$(libdir)/$$ver/site-packages ;\
+          install -m 755 $$ver/_snack.$(SOEXT) 
$(instroot)/$(libdir)/$$ver/site-packages ;\
+          install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
+-      done || :
++      done
++endif
+       install -m 644 libnewt.pc $(instroot)/$(pkgconfigdir)
+ 
+ Makefile: configure.ac
diff --minimal -Nru newt-0.52.24/debian/patches/series 
newt-0.52.24/debian/patches/series
--- newt-0.52.24/debian/patches/series  2024-01-15 14:32:29.000000000 +0100
+++ newt-0.52.24/debian/patches/series  2024-09-29 09:08:02.000000000 +0200
@@ -16,3 +16,4 @@
 snack.patch
 whiptail-man.patch
 makefile-fail.patch
+nopython.patch
diff --minimal -Nru newt-0.52.24/debian/rules newt-0.52.24/debian/rules
--- newt-0.52.24/debian/rules   2024-01-15 14:32:29.000000000 +0100
+++ newt-0.52.24/debian/rules   2024-09-29 09:08:02.000000000 +0200
@@ -20,20 +20,23 @@
 
 AM_VERS:=$(strip $(shell dpkg-query -f '$${source:Upstream-Version}' -W 
automake | egrep -o '^[0-9]+\.[0-9]+'))
 
-ifeq ($(DEB_HOST_ARCH_OS),hurd)
-GPMSUPPORT=
+CONFIGURE_ARGS :=
+
+ifneq ($(DEB_HOST_ARCH_OS),hurd)
 else
-GPMSUPPORT= --with-gpm-support
+CONFIGURE_ARGS += --with-gpm-support
 endif
 
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-NOSTRIP=--with-nostrip=no
+CONFIGURE_ARGS += --with-nostrip=$(if $(filter 
notsrip,$(DEB_BUILD_OPTIONS)),yes,no)
+
+CONFIGURE_ARGS += --with-colorsfile=/etc/newt/palette
+
+ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
+CONFIGURE_ARGS += "--with-python=`py3versions --supported`"
 else
-NOSTRIP=--with-nostrip=yes
+CONFIGURE_ARGS += --without-python
 endif
 
-COLORSFILE = --with-colorsfile=/etc/newt/palette
-
 override_dh_auto_clean:
        dh_auto_clean
        # remove autogenerated files
@@ -44,7 +47,7 @@
 override_dh_auto_configure:
        # Nasty hack. why is it necessary?
        cp /usr/share/automake-$(AM_VERS)/install-sh ./install-sh
-       dh_auto_configure  -- $(GPMSUPPORT) $(NOSTRIP) $(COLORSFILE) 
CFLAGS='-I/usr/include/tcl8.6 $(CFLAGS) -DMARCH=\"$(DEB_HOST_MULTIARCH)\" '  \
+       dh_auto_configure  -- $(CONFIGURE_ARGS) CFLAGS='-I/usr/include/tcl8.6 
$(CFLAGS) -DMARCH=\"$(DEB_HOST_MULTIARCH)\" '  \
                CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" FFLAGS="$(FFLAGS)"  
WHIPTCLLIB=whiptcl
 
 override_dh_auto_build:

Reply via email to