summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikhil R <nikhilar2410@gmail.com>2023-07-10 16:49:47 +0530
committerSteve Sakoman <steve@sakoman.com>2023-07-22 16:24:17 -1000
commit7ac47c90cc9191abaa70abd9245c3e67248ac74d (patch)
treedeb9e0b97e1aa3ee5ae4409c29bdf910d8c64e31
parent5de95d9c29ecd7cc634f173efa2b4e8a79bcca6d (diff)
downloadpoky-7ac47c90cc9191abaa70abd9245c3e67248ac74d.tar.gz
libpng: Add ptest for libpng
libpng is a platform-independent library which supports all PNG features. This ptest executes the below binaries, parses the png image and prints the image features. 1. pngfix - provides information about PNG image copyrights details. 2. pngtest - tests, optimizes and optionally fixes the zlib header in PNG files. 3. pngstest - verifies the integrity of PNG image by dumping chunk level information. 4. timepng - provides details about PNG image chunks. (From OE-Core rev: 843803bcc248b18cdefb29d610a1371e32e815ce) Signed-off-by: Nikhil R <nikhil.r@kpit.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/conf/distro/include/ptest-packagelists.inc1
-rw-r--r--meta/recipes-multimedia/libpng/files/run-ptest29
-rw-r--r--meta/recipes-multimedia/libpng/libpng_1.6.37.bb15
3 files changed, 43 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index badfd69325..3fb7ec2657 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -26,6 +26,7 @@ PTESTS_FAST = "\
26 liberror-perl-ptest \ 26 liberror-perl-ptest \
27 libmodule-build-perl-ptest \ 27 libmodule-build-perl-ptest \
28 libpcre-ptest \ 28 libpcre-ptest \
29 libpng-ptest \
29 libtimedate-perl-ptest \ 30 libtimedate-perl-ptest \
30 libtest-needs-perl-ptest \ 31 libtest-needs-perl-ptest \
31 liburi-perl-ptest \ 32 liburi-perl-ptest \
diff --git a/meta/recipes-multimedia/libpng/files/run-ptest b/meta/recipes-multimedia/libpng/files/run-ptest
new file mode 100644
index 0000000000..9ab5d0c1f4
--- /dev/null
+++ b/meta/recipes-multimedia/libpng/files/run-ptest
@@ -0,0 +1,29 @@
1#!/bin/sh
2
3set -eux
4
5./pngfix pngtest.png &> log.txt 2>&1
6
7if grep -i "OK" log.txt 2>&1 ; then
8 echo "PASS: pngfix passed"
9else
10 echo "FAIL: pngfix failed"
11fi
12rm -f log.txt
13
14./pngtest pngtest.png &> log.txt 2>&1
15
16if grep -i "PASS" log.txt 2>&1 ; then
17 echo "PASS: pngtest passed"
18else
19 echo "FAIL: pngtest failed"
20fi
21rm -f log.txt
22
23for i in pngstest timepng; do
24 if "./${i}" pngtest.png 2>&1; then
25 echo "PASS: $i"
26 else
27 echo "FAIL: $i"
28 fi
29done
diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.37.bb b/meta/recipes-multimedia/libpng/libpng_1.6.37.bb
index 3c46fa3302..9387fc8e2e 100644
--- a/meta/recipes-multimedia/libpng/libpng_1.6.37.bb
+++ b/meta/recipes-multimedia/libpng/libpng_1.6.37.bb
@@ -10,7 +10,10 @@ DEPENDS = "zlib"
10 10
11LIBV = "16" 11LIBV = "16"
12 12
13SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz" 13SRC_URI = "\
14 ${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz \
15 file://run-ptest \
16 "
14SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9" 17SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9"
15SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" 18SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca"
16 19
@@ -20,7 +23,7 @@ UPSTREAM_CHECK_URI = "http://libpng.org/pub/png/libpng.html"
20 23
21BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config" 24BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
22 25
23inherit autotools binconfig-disabled pkgconfig 26inherit autotools binconfig-disabled pkgconfig ptest
24 27
25# Work around missing symbols 28# Work around missing symbols
26EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}" 29EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
@@ -33,3 +36,11 @@ BBCLASSEXTEND = "native nativesdk"
33 36
34# CVE-2019-17371 is actually a memory leak in gif2png 2.x 37# CVE-2019-17371 is actually a memory leak in gif2png 2.x
35CVE_CHECK_WHITELIST += "CVE-2019-17371" 38CVE_CHECK_WHITELIST += "CVE-2019-17371"
39
40do_install_ptest() {
41 install -m644 "${S}/pngtest.png" "${D}${PTEST_PATH}"
42 install -m755 "${B}/.libs/pngfix" "${D}${PTEST_PATH}"
43 install -m755 "${B}/.libs/pngtest" "${D}${PTEST_PATH}"
44 install -m755 "${B}/.libs/pngstest" "${D}${PTEST_PATH}"
45 install -m755 "${B}/.libs/timepng" "${D}${PTEST_PATH}"
46}