diff options
author | Nikhil R <nikhilar2410@gmail.com> | 2023-07-10 16:49:47 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-07-22 16:24:17 -1000 |
commit | 7ac47c90cc9191abaa70abd9245c3e67248ac74d (patch) | |
tree | deb9e0b97e1aa3ee5ae4409c29bdf910d8c64e31 | |
parent | 5de95d9c29ecd7cc634f173efa2b4e8a79bcca6d (diff) | |
download | poky-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.inc | 1 | ||||
-rw-r--r-- | meta/recipes-multimedia/libpng/files/run-ptest | 29 | ||||
-rw-r--r-- | meta/recipes-multimedia/libpng/libpng_1.6.37.bb | 15 |
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 | |||
3 | set -eux | ||
4 | |||
5 | ./pngfix pngtest.png &> log.txt 2>&1 | ||
6 | |||
7 | if grep -i "OK" log.txt 2>&1 ; then | ||
8 | echo "PASS: pngfix passed" | ||
9 | else | ||
10 | echo "FAIL: pngfix failed" | ||
11 | fi | ||
12 | rm -f log.txt | ||
13 | |||
14 | ./pngtest pngtest.png &> log.txt 2>&1 | ||
15 | |||
16 | if grep -i "PASS" log.txt 2>&1 ; then | ||
17 | echo "PASS: pngtest passed" | ||
18 | else | ||
19 | echo "FAIL: pngtest failed" | ||
20 | fi | ||
21 | rm -f log.txt | ||
22 | |||
23 | for 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 | ||
29 | done | ||
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 | ||
11 | LIBV = "16" | 11 | LIBV = "16" |
12 | 12 | ||
13 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz" | 13 | SRC_URI = "\ |
14 | ${SOURCEFORGE_MIRROR}/${BPN}/${BPN}${LIBV}/${BP}.tar.xz \ | ||
15 | file://run-ptest \ | ||
16 | " | ||
14 | SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9" | 17 | SRC_URI[md5sum] = "015e8e15db1eecde5f2eb9eb5b6e59e9" |
15 | SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" | 18 | SRC_URI[sha256sum] = "505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca" |
16 | 19 | ||
@@ -20,7 +23,7 @@ UPSTREAM_CHECK_URI = "http://libpng.org/pub/png/libpng.html" | |||
20 | 23 | ||
21 | BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config" | 24 | BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config" |
22 | 25 | ||
23 | inherit autotools binconfig-disabled pkgconfig | 26 | inherit autotools binconfig-disabled pkgconfig ptest |
24 | 27 | ||
25 | # Work around missing symbols | 28 | # Work around missing symbols |
26 | EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}" | 29 | EXTRA_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 |
35 | CVE_CHECK_WHITELIST += "CVE-2019-17371" | 38 | CVE_CHECK_WHITELIST += "CVE-2019-17371" |
39 | |||
40 | do_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 | } | ||