From 29d55170fffc22364265b9d019fdb8e9d5cbb2c2 Mon Sep 17 00:00:00 2001 From: Stuart Auld Date: Mon, 12 Aug 2024 19:42:30 +1000 Subject: [PATCH] feat(24.04): Add slice definitions for libgif7, libpng16-16t64 and metapixel (#302) Co-authored-by: Cristovao Cordeiro --- slices/libgif7.yaml | 16 ++++++++++++ slices/libjpeg8.yaml | 15 +++++++++++ slices/libpng16-16t64.yaml | 17 +++++++++++++ slices/metapixel.yaml | 24 ++++++++++++++++++ tests/spread/integration/libgif7/tables.mxt | 1 + tests/spread/integration/libgif7/task.yaml | 16 ++++++++++++ tests/spread/integration/libgif7/test.gif | Bin 0 -> 62 bytes tests/spread/integration/libgif7/test.gif.png | Bin 0 -> 69 bytes tests/spread/integration/libjpeg8/task.yaml | 9 +++++++ .../integration/libpng16-16t64/tables.mxt | 1 + .../integration/libpng16-16t64/task.yaml | 16 ++++++++++++ .../integration/libpng16-16t64/test.png | Bin 0 -> 4352 bytes .../integration/libpng16-16t64/test.png.png | Bin 0 -> 69 bytes tests/spread/integration/metapixel/task.yaml | 11 ++++++++ tests/spread/integration/metapixel/test.gif | Bin 0 -> 62 bytes tests/spread/integration/metapixel/test.png | Bin 0 -> 4352 bytes 16 files changed, 126 insertions(+) create mode 100644 slices/libgif7.yaml create mode 100644 slices/libjpeg8.yaml create mode 100644 slices/libpng16-16t64.yaml create mode 100644 slices/metapixel.yaml create mode 100644 tests/spread/integration/libgif7/tables.mxt create mode 100644 tests/spread/integration/libgif7/task.yaml create mode 100644 tests/spread/integration/libgif7/test.gif create mode 100644 tests/spread/integration/libgif7/test.gif.png create mode 100644 tests/spread/integration/libjpeg8/task.yaml create mode 100644 tests/spread/integration/libpng16-16t64/tables.mxt create mode 100644 tests/spread/integration/libpng16-16t64/task.yaml create mode 100644 tests/spread/integration/libpng16-16t64/test.png create mode 100644 tests/spread/integration/libpng16-16t64/test.png.png create mode 100644 tests/spread/integration/metapixel/task.yaml create mode 100644 tests/spread/integration/metapixel/test.gif create mode 100644 tests/spread/integration/metapixel/test.png diff --git a/slices/libgif7.yaml b/slices/libgif7.yaml new file mode 100644 index 00000000..3417d9c1 --- /dev/null +++ b/slices/libgif7.yaml @@ -0,0 +1,16 @@ +# Library for GIF images +package: libgif7 + +essential: + - libgif7_copyright + +slices: + libs: + essential: + - libc6_libs + contents: + /usr/lib/*-linux-*/libgif.so.7*: + + copyright: + contents: + /usr/share/doc/libgif7/copyright: diff --git a/slices/libjpeg8.yaml b/slices/libjpeg8.yaml new file mode 100644 index 00000000..d04a94f6 --- /dev/null +++ b/slices/libjpeg8.yaml @@ -0,0 +1,15 @@ +# This is a nothing package but other packages reference this instead of +# libjpeg-turbo8, so it is included for convenience. +package: libjpeg8 + +essential: + - libjpeg8_copyright + +slices: + libs: + essential: + - libjpeg-turbo8_libs + + copyright: + contents: + /usr/share/doc/libjpeg8/copyright: diff --git a/slices/libpng16-16t64.yaml b/slices/libpng16-16t64.yaml new file mode 100644 index 00000000..8db39752 --- /dev/null +++ b/slices/libpng16-16t64.yaml @@ -0,0 +1,17 @@ +# PNG library - runtime (version 1.6) +package: libpng16-16t64 + +essential: + - libpng16-16t64_copyright + +slices: + libs: + essential: + - libc6_libs + - zlib1g_libs + contents: + /usr/lib/*-linux-*/libpng16.so.16*: + + copyright: + contents: + /usr/share/doc/libpng16-16t64/copyright: diff --git a/slices/metapixel.yaml b/slices/metapixel.yaml new file mode 100644 index 00000000..eb4ee2de --- /dev/null +++ b/slices/metapixel.yaml @@ -0,0 +1,24 @@ +# Metapixel is a program for generating photomosaics. +package: metapixel + +essential: + - metapixel_copyright + +slices: + bins: + essential: + - libc6_libs + - libgif7_libs + - libjpeg8_libs + - libpng16-16t64_libs + contents: + /usr/bin/metapixel: + /usr/bin/metapixel-imagesize: + # The following two programs are perl scripts, they can't be added until + # there is a perl slice. + # /usr/bin/metapixel-prepare: + # /usr/bin/metapixel-sizesort: + + copyright: + contents: + /usr/share/doc/metapixel/copyright: diff --git a/tests/spread/integration/libgif7/tables.mxt b/tests/spread/integration/libgif7/tables.mxt new file mode 100644 index 00000000..ce762d4a --- /dev/null +++ b/tests/spread/integration/libgif7/tables.mxt @@ -0,0 +1 @@ +(small-image "test.gif.png" (size 1 1) (wavelet (means 255.000000 127.500000 126.893440) (coeffs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232)) (subpixel (y 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255) (i 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127) (q 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126))) diff --git a/tests/spread/integration/libgif7/task.yaml b/tests/spread/integration/libgif7/task.yaml new file mode 100644 index 00000000..74b47f83 --- /dev/null +++ b/tests/spread/integration/libgif7/task.yaml @@ -0,0 +1,16 @@ +summary: Integration tests for libgif7 + +execute: | + rootfs="$(install-slices libgif7_libs metapixel_bins)" + + mkdir -p "${rootfs}/images" + mkdir -p "${rootfs}/library" + cp test.gif "${rootfs}/images/" + # metapixel-prepare depends on perl so we need to run the prepare step manually + cp tables.mxt "${rootfs}/library/" + cp test.gif.png "${rootfs}/library/" + + chroot "$rootfs" metapixel --metapixel images/test.gif images/output.png --library library/ --distance=0 + + apt install -y file + [[ $(file "${rootfs}/images/output.png") == "${rootfs}/images/output.png: PNG image data, 64 x 64, 8-bit/color RGB, non-interlaced" ]] diff --git a/tests/spread/integration/libgif7/test.gif b/tests/spread/integration/libgif7/test.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b04c4e4f87d4e4ac6a0875f36235b8aa1c8b826 GIT binary patch literal 62 zcmZ?wbhEHbWMp7u_`tyM|Nnmm1_s6d+r Mpb!(23nPOy0Pe*Mr2qf` literal 0 HcmV?d00001 diff --git a/tests/spread/integration/libgif7/test.gif.png b/tests/spread/integration/libgif7/test.gif.png new file mode 100644 index 0000000000000000000000000000000000000000..ff40e718c715a9fbd54cb1186b88a619a1a47b31 GIT binary patch literal 69 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2ryJf1F&AsjQ4fBgS%&%pYR>0iXB RY(AhkgQu&X%Q~loCIH|25kUX| literal 0 HcmV?d00001 diff --git a/tests/spread/integration/libjpeg8/task.yaml b/tests/spread/integration/libjpeg8/task.yaml new file mode 100644 index 00000000..22bde51b --- /dev/null +++ b/tests/spread/integration/libjpeg8/task.yaml @@ -0,0 +1,9 @@ +summary: Integration tests for libjpeg8 + +execute: | + rootfs="$(install-slices libjpeg8_libs)" + + apt install -y gcc + arch=$(gcc -dumpmachine) + + test -f ${rootfs}/usr/lib/${arch}/libjpeg.so.8 diff --git a/tests/spread/integration/libpng16-16t64/tables.mxt b/tests/spread/integration/libpng16-16t64/tables.mxt new file mode 100644 index 00000000..5e8303ef --- /dev/null +++ b/tests/spread/integration/libpng16-16t64/tables.mxt @@ -0,0 +1 @@ +(small-image "test.png.png" (size 1 1) (wavelet (means 255.000000 127.500000 126.893440) (coeffs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232)) (subpixel (y 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255) (i 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127) (q 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126 126))) diff --git a/tests/spread/integration/libpng16-16t64/task.yaml b/tests/spread/integration/libpng16-16t64/task.yaml new file mode 100644 index 00000000..d1151205 --- /dev/null +++ b/tests/spread/integration/libpng16-16t64/task.yaml @@ -0,0 +1,16 @@ +summary: Integration tests for libpng16-16t64 + +execute: | + rootfs="$(install-slices libpng16-16t64_libs metapixel_bins)" + + mkdir -p "${rootfs}/images" + mkdir -p "${rootfs}/library" + cp test.png "${rootfs}/images/" + # metapixel-prepare depends on perl so we need to run the prepare step manually + cp tables.mxt "${rootfs}/library/" + cp test.png.png "${rootfs}/library/" + + chroot "$rootfs" metapixel --metapixel images/test.png images/output.png --library library/ --distance=0 + + apt install -y file + [[ $(file "${rootfs}/images/output.png") == "${rootfs}/images/output.png: PNG image data, 64 x 64, 8-bit/color RGB, non-interlaced" ]] diff --git a/tests/spread/integration/libpng16-16t64/test.png b/tests/spread/integration/libpng16-16t64/test.png new file mode 100644 index 0000000000000000000000000000000000000000..66d0056fd57eedc77d5ae066ca0f0daece73e72a GIT binary patch literal 4352 zcmeHKe^3l-Y>9Du^-E+hJ@^<0w zs3mG_jMg7iC4ixmqmsao5rZhvP?I2yB-&K0HkyPOM{LE4MVyq0O-B0NJLJbCGaY7{ z|G1m|-tPOp_j&Jq-uu3}-C@f%$Hgp&kw_$QmMl{){GBFVv!}zg!k>3lBAGr|mR}&` zQhvni^RS!~AVSa!5D?&4i6rp(ovNIDy(x1thYLSU>)7{5!nuy3CRW<|-N~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I5Ct!nJ583 zP+XycB$7ChPpC^6enY1k z_CrauH>;4BNMe5~UehE8YZIYRDp;(U(!SZ#;)v+z=akJ*G{<6Eo%=Q*%bq*8c)oMmTf; literal 0 HcmV?d00001 diff --git a/tests/spread/integration/libpng16-16t64/test.png.png b/tests/spread/integration/libpng16-16t64/test.png.png new file mode 100644 index 0000000000000000000000000000000000000000..ff40e718c715a9fbd54cb1186b88a619a1a47b31 GIT binary patch literal 69 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2ryJf1F&AsjQ4fBgS%&%pYR>0iXB RY(AhkgQu&X%Q~loCIH|25kUX| literal 0 HcmV?d00001 diff --git a/tests/spread/integration/metapixel/task.yaml b/tests/spread/integration/metapixel/task.yaml new file mode 100644 index 00000000..de72bc8d --- /dev/null +++ b/tests/spread/integration/metapixel/task.yaml @@ -0,0 +1,11 @@ +summary: Integration tests for metapixel + +execute: | + rootfs="$(install-slices metapixel_bins)" + + cp test.gif "${rootfs}/" + cp test.png "${rootfs}/" + + chroot "$rootfs" metapixel --help + [[ $(chroot "$rootfs" metapixel-imagesize test.gif) == "1 1" ]] + [[ $(chroot "$rootfs" metapixel-imagesize test.png) == "1 1" ]] diff --git a/tests/spread/integration/metapixel/test.gif b/tests/spread/integration/metapixel/test.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b04c4e4f87d4e4ac6a0875f36235b8aa1c8b826 GIT binary patch literal 62 zcmZ?wbhEHbWMp7u_`tyM|Nnmm1_s6d+r Mpb!(23nPOy0Pe*Mr2qf` literal 0 HcmV?d00001 diff --git a/tests/spread/integration/metapixel/test.png b/tests/spread/integration/metapixel/test.png new file mode 100644 index 0000000000000000000000000000000000000000..66d0056fd57eedc77d5ae066ca0f0daece73e72a GIT binary patch literal 4352 zcmeHKe^3l-Y>9Du^-E+hJ@^<0w zs3mG_jMg7iC4ixmqmsao5rZhvP?I2yB-&K0HkyPOM{LE4MVyq0O-B0NJLJbCGaY7{ z|G1m|-tPOp_j&Jq-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