From e0b33c1f5003a8aac3858f8c1d7491c7dbdf0f37 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Fri, 7 Mar 2025 19:58:46 +0100 Subject: [PATCH] package/setserial: simplify patching The original commit (aaa2b660a9f9 ("setserial: convert to autotargets and fix manpages install") wasn't entirely clear why we went for a removal of a patch from the tarball we get from Debian. It is assumed the original patch mainly only wanted to remove the strip and make sure the directories are created before files are installed in there. But doing only that made my build fail because the linker doesn't find @CXXFLAGS@. After undoing the addition of this variable (and its use) from 01_makefile.patch it now compiles just fine. Therefore, instead of removing the patch from the tarball we get from Debian, simply update the patch we carry in the tree to remove what's necessary and simplify the patching logic. This could also help identify notable differences between the 01_makefile.patch from two different versions whenever we upgrade. Signed-off-by: Quentin Schulz Signed-off-by: Thomas Petazzoni (cherry picked from commit c688a1a8a833a89e9e6fcef70f183766e341e11d) Signed-off-by: Thomas Perale --- package/setserial/0001-build-system-fix.patch | 33 ++++++++++++++++--- package/setserial/setserial.mk | 2 -- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/package/setserial/0001-build-system-fix.patch b/package/setserial/0001-build-system-fix.patch index eec7993d19..06f2201bd4 100644 --- a/package/setserial/0001-build-system-fix.patch +++ b/package/setserial/0001-build-system-fix.patch @@ -3,7 +3,19 @@ sure that the directories (especially the manpages directory) are created before installing files to them. This is similar to what automake does. +Also remove CXXFLAGS and its use since the linker errors out with: + + cannot find @CXXFLAGS@: No such file or directory + +Additionally, remove the strip command made on the wrong file. + Signed-off-by: Thomas Petazzoni +[rebased on top of Debian's setserial_2.17-57.debian.tar.xz instead of relying + on deletion of 01_makefile.patch] +[extend commit log to explain why CXXFLAGS is removed and also that strip is + removed on purpose, c.f. original commit aaa2b660a9f9 ("setserial: convert to + autotargets and fix manpages install")] +Signed-off-by: Quentin Schulz --- Makefile.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) @@ -12,17 +24,30 @@ Index: setserial-2.17/Makefile.in =================================================================== --- setserial-2.17.orig/Makefile.in +++ setserial-2.17/Makefile.in -@@ -26,9 +26,10 @@ setserial.cat: setserial.8 +@@ -15,7 +15,6 @@ RM = rm -f + CFLAGS = @CFLAGS@ + LDFLAGS = @LDFLAGS@ + CPPFLAGS = @CPPFLAGS@ +-CXXFLAGS = @CXXFLAGS@ + DEFS = @DEFS@ + INCS = -I. + TAR = tar +@@ -23,14 +22,15 @@ TAR = tar + all: setserial setserial.cat + + setserial: setserial.c +- $(CC) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DEFS) $(INCS) setserial.c -o setserial ++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DEFS) $(INCS) setserial.c -o setserial + + setserial.cat: setserial.8 nroff -man setserial.8 > setserial.cat install: setserial setserial.8 - $(INSTALL_PROGRAM) setserial $(DESTDIR)/bin - $(STRIP) $(DESTDIR)/bin/setserial -- $(INSTALL_DATA) setserial.8 $(DESTDIR)/usr/man/man8 + mkdir -p $(DESTDIR)/usr/bin + $(INSTALL_PROGRAM) setserial $(DESTDIR)/usr/bin + mkdir -p $(DESTDIR)/usr/share/man/man8 -+ $(INSTALL_DATA) setserial.8 $(DESTDIR)/usr/share/man/man8 + $(INSTALL_DATA) setserial.8 $(DESTDIR)/usr/share/man/man8 clean: - $(RM) setserial setserial.o setserial.cat *~ diff --git a/package/setserial/setserial.mk b/package/setserial/setserial.mk index 5bce05056a..9beee349c8 100644 --- a/package/setserial/setserial.mk +++ b/package/setserial/setserial.mk @@ -29,8 +29,6 @@ define SETSERIAL_APPLY_DEBIAN_PATCHES # - Apply patches in the order listed in debian/patches/series if [ -d $(@D)/debian/patches ]; then \ touch $(@D)/gorhack.h; \ - rm $(@D)/debian/patches/01_makefile.patch; \ - sed -i '/01_makefile.patch/d' $(@D)/debian/patches/series; \ $(APPLY_PATCHES) $(@D) $(@D)/debian/patches series; \ fi endef