@@ -95,6 +95,7 @@ PTESTS_SLOW = "\
glib-2.0 \
gnutls \
gstreamer1.0 \
+ less \
libevent \
libgcrypt \
libmodule-build-perl \
new file mode 100644
@@ -0,0 +1,28 @@
+From 6499e388a0af8c4531f845ccc58f30ffb1a03c51 Mon Sep 17 00:00:00 2001
+From: Julien Stephan <jstephan@baylibre.com>
+Date: Tue, 4 Jul 2023 11:43:14 +0200
+Subject: [PATCH 1/2] lesstest: Makefile: allow CFLAGS to be overitten
+
+use weak assignment for CFLAGS so user can set its CFLAGS and still have
+a sane default value
+
+Upstream-Status: Submitted [https://github.com/gwsw/less/pull/398]
+
+Signed-off-by: Julien Stephan <jstephan@baylibre.com>
+---
+ lesstest/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lesstest/Makefile b/lesstest/Makefile
+index 387b7ae..a231900 100644
+--- a/lesstest/Makefile
++++ b/lesstest/Makefile
+@@ -1,5 +1,5 @@
+ CC ?= gcc
+-CFLAGS = -Wall -O2
++CFLAGS ?= -Wall -O2
+ TERMLIB = -lncurses
+
+ all: lesstest lt_screen
+--
+2.41.0
new file mode 100644
@@ -0,0 +1,41 @@
+From e7a0b9cce9c2b9e90b25f502c272e63de37e7def Mon Sep 17 00:00:00 2001
+From: Julien Stephan <jstephan@baylibre.com>
+Date: Tue, 4 Jul 2023 11:48:52 +0200
+Subject: [PATCH 2/2] lesstest: Makefile: add LDFLAGS support
+
+add LDFLAGS support. By default LDFLAGS will be empty so no functionnal
+change is expected
+
+Upstream-Status: Submitted [https://github.com/gwsw/less/pull/398]
+
+Signed-off-by: Julien Stephan <jstephan@baylibre.com>
+---
+ lesstest/Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/lesstest/Makefile b/lesstest/Makefile
+index a231900..8fc0d49 100644
+--- a/lesstest/Makefile
++++ b/lesstest/Makefile
+@@ -1,16 +1,17 @@
+ CC ?= gcc
+ CFLAGS ?= -Wall -O2
++LDFLAGS ?=
+ TERMLIB = -lncurses
+
+ all: lesstest lt_screen
+
+ LESSTEST_OBJ = display.o env.o lesstest.o parse.o pipeline.o log.o run.o term.o wchar.o
+ lesstest: $(LESSTEST_OBJ)
+- $(CC) $(CFLAGS) -o lesstest $(LESSTEST_OBJ) $(TERMLIB)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o lesstest $(LESSTEST_OBJ) $(TERMLIB)
+
+ LT_SCREEN_OBJ = lt_screen.o unicode.o wchar.o
+ lt_screen: $(LT_SCREEN_OBJ)
+- $(CC) $(CFLAGS) -o lt_screen $(LT_SCREEN_OBJ)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o lt_screen $(LT_SCREEN_OBJ)
+
+ *.o: lesstest.h lt_types.h wchar.h
+
+--
+2.41.0
new file mode 100644
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+fail=0
+pass=0
+
+for i in lt/*; do
+ ./runtest -l /usr/bin/less -t lesstest $i &> /dev/null
+
+ if [[ $? -eq 0 ]]; then
+ echo "PASS: $(basename $i)"
+ pass=$((pass+1))
+ else
+ echo "FAIL: $(basename $i)"
+ fail=$((fail+1))
+ fi
+done
+
+echo "============================================================================"
+echo Testsuite summary for less
+echo "============================================================================"
+echo "# TOTAL: $((fail+pass))"
+echo "# PASS: $pass"
+echo "# FAIL: $fail"
+echo "============================================================================"
+
@@ -25,12 +25,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
"
DEPENDS = "ncurses groff-native"
-SRC_URI = "git://github.com/gwsw/less.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/gwsw/less.git;protocol=https;branch=master \
+ file://run-ptest \
+ file://0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch \
+ file://0002-lesstest-Makefile-add-LDFLAGS-support.patch \
+ "
SRCREV = "0d7ca880375bde651313f03f7115d26921b43722"
S = "${WORKDIR}/git"
-inherit autotools update-alternatives
+inherit autotools ptest update-alternatives
+
+EXTRA_OEMAKE += " LESSTEST=1"
# According to the README of the project when getting code from git we should run
# the following command before running the configure script
@@ -40,9 +46,23 @@ do_configure:prepend () {
cd -
}
+do_compile_ptest () {
+ cd ${S}/lesstest
+ oe_runmake
+}
+
do_install () {
oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
}
+do_install_ptest () {
+ cp ${S}/lesstest/lesstest ${D}${PTEST_PATH}
+ cp ${S}/lesstest/runtest ${D}${PTEST_PATH}
+ cp ${S}/lesstest/lt_screen ${D}${PTEST_PATH}
+ cp -r ${S}/lesstest/lt ${D}${PTEST_PATH}
+}
+
+RDEPENDS:${PN}-ptest:append = " perl-module-getopt-std perl-module-cwd"
+
ALTERNATIVE:${PN} = "less"
ALTERNATIVE_PRIORITY = "100"
add ptest support for less [YOCTO #15073] Signed-off-by: Julien Stephan <jstephan@baylibre.com> --- .../distro/include/ptest-packagelists.inc | 1 + ...akefile-allow-CFLAGS-to-be-overitten.patch | 28 +++++++++++++ ...esstest-Makefile-add-LDFLAGS-support.patch | 41 +++++++++++++++++++ meta/recipes-extended/less/files/run-ptest | 25 +++++++++++ meta/recipes-extended/less/less_633.bb | 24 ++++++++++- 5 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-extended/less/files/0001-lesstest-Makefile-allow-CFLAGS-to-be-overitten.patch create mode 100644 meta/recipes-extended/less/files/0002-lesstest-Makefile-add-LDFLAGS-support.patch create mode 100644 meta/recipes-extended/less/files/run-ptest