Files
rpi-buildroot/package/setserial/setserial.mk
Quentin Schulz c688a1a8a8 package/setserial: simplify patching
The original commit (aaa2b660a9 ("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 <quentin.schulz@cherry.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-08-18 22:58:27 +02:00

39 lines
1.3 KiB
Makefile

################################################################################
#
# setserial
#
################################################################################
SETSERIAL_VERSION = 2.17
SETSERIAL_SOURCE = setserial_$(SETSERIAL_VERSION).orig.tar.gz
SETSERIAL_SITE = https://snapshot.debian.org/archive/debian/20250307T084701Z/pool/main/s/setserial
SETSERIAL_EXTRA_DOWNLOADS = setserial_$(SETSERIAL_VERSION)-57.debian.tar.xz
SETSERIAL_LICENSE = GPL-2.0
SETSERIAL_LICENSE_FILES = debian/copyright
# make all also builds setserial.cat which needs nroff
SETSERIAL_MAKE_OPTS = setserial
SETSERIAL_AUTORECONF = YES
# Extract the Debian tarball inside the sources
define SETSERIAL_DEBIAN_EXTRACT
$(call suitable-extractor,$(notdir $(SETSERIAL_EXTRA_DOWNLOADS))) \
$(SETSERIAL_DL_DIR)/$(notdir $(SETSERIAL_EXTRA_DOWNLOADS)) | \
$(TAR) -C $(@D) $(TAR_OPTIONS) -
endef
SETSERIAL_POST_EXTRACT_HOOKS += SETSERIAL_DEBIAN_EXTRACT
define SETSERIAL_APPLY_DEBIAN_PATCHES
# - Touching gorhack.h is needed for the Debian patch 18 to work
# - Apply patches in the order listed in debian/patches/series
if [ -d $(@D)/debian/patches ]; then \
touch $(@D)/gorhack.h; \
$(APPLY_PATCHES) $(@D) $(@D)/debian/patches series; \
fi
endef
SETSERIAL_PRE_PATCH_HOOKS += SETSERIAL_APPLY_DEBIAN_PATCHES
$(eval $(autotools-package))