Skip to content

Commit

Permalink
feat(24.04): Add slice definitions for libgif7, libpng16-16t64 and me…
Browse files Browse the repository at this point in the history
…tapixel (#302)

Co-authored-by: Cristovao Cordeiro <[email protected]>
  • Loading branch information
sjauld and cjdcordeiro authored Aug 12, 2024
1 parent 4726382 commit 29d5517
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 0 deletions.
16 changes: 16 additions & 0 deletions slices/libgif7.yaml
Original file line number Diff line number Diff line change
@@ -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:
15 changes: 15 additions & 0 deletions slices/libjpeg8.yaml
Original file line number Diff line number Diff line change
@@ -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:
17 changes: 17 additions & 0 deletions slices/libpng16-16t64.yaml
Original file line number Diff line number Diff line change
@@ -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:
24 changes: 24 additions & 0 deletions slices/metapixel.yaml
Original file line number Diff line number Diff line change
@@ -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:
1 change: 1 addition & 0 deletions tests/spread/integration/libgif7/tables.mxt
Original file line number Diff line number Diff line change
@@ -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)))
16 changes: 16 additions & 0 deletions tests/spread/integration/libgif7/task.yaml
Original file line number Diff line number Diff line change
@@ -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" ]]
Binary file added tests/spread/integration/libgif7/test.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/spread/integration/libgif7/test.gif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions tests/spread/integration/libjpeg8/task.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/spread/integration/libpng16-16t64/tables.mxt
Original file line number Diff line number Diff line change
@@ -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)))
16 changes: 16 additions & 0 deletions tests/spread/integration/libpng16-16t64/task.yaml
Original file line number Diff line number Diff line change
@@ -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" ]]
Binary file added tests/spread/integration/libpng16-16t64/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tests/spread/integration/metapixel/task.yaml
Original file line number Diff line number Diff line change
@@ -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" ]]
Binary file added tests/spread/integration/metapixel/test.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/spread/integration/metapixel/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 29d5517

Please sign in to comment.