forked from wolfi-dev/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cairo.yaml
184 lines (163 loc) · 4.76 KB
/
cairo.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
package:
name: cairo
version: 1.18.2
epoch: 1
description: A vector graphics library
copyright:
- license: LGPL-2.0-or-later OR MPL-1.1
environment:
contents:
packages:
- autoconf
- automake
- build-base
- busybox
- ca-certificates-bundle
- expat-dev
- fontconfig-dev
- freetype-dev
- glib-dev
- libpng-dev
- libxext-dev
- libxrender-dev
- meson
- openssf-compiler-options
- pixman-dev
- xcb-util
- xcb-util-dev
- zlib-dev
pipeline:
- uses: fetch
with:
expected-sha256: 0b895967abfae888ecad9ace4bce475a27e1b9aaeedaaf334b97c96f13ccc604
uri: https://gitlab.freedesktop.org/cairo/cairo/-/archive/${{package.version}}/cairo-${{package.version}}.tar.bz2
- runs: |
meson . output \
-Db_lto=true \
-Dgtk_doc=false \
-Ddefault_library=both \
-Dtests=disabled \
--prefix=/usr
- uses: meson/compile
- uses: meson/install
- uses: strip
subpackages:
- name: cairo-static
pipeline:
- uses: split/static
description: cairo static
- name: cairo-dev
pipeline:
- uses: split/dev
dependencies:
runtime:
- cairo
- cairo-tools
- fontconfig-dev
- freetype-dev
- libxext-dev
- libxrender-dev
- pixman-dev
- xcb-util-dev
description: cairo dev
test:
pipeline:
- uses: test/pkgconf
- name: cairo-gobject
# dependencies:
# provides:
# - cairo-gobject
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/lib
mv ${{targets.destdir}}/usr/lib/libcairo-gobject.so.* ${{targets.subpkgdir}}/usr/lib/
description: cairo (gobject bindings)
- name: cairo-tools
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mkdir -p ${{targets.subpkgdir}}/usr/lib/cairo
mv ${{targets.destdir}}/usr/bin/* ${{targets.subpkgdir}}/usr/bin/
mv ${{targets.destdir}}/usr/lib/cairo/libcairo-trace.* ${{targets.subpkgdir}}/usr/lib/cairo/
description: cairo (development tools)
test:
pipeline:
- runs: |
cairo-trace --help
update:
enabled: true
release-monitor:
identifier: 247
test:
environment:
contents:
packages:
- build-base
- cairo-dev
- cairo-gobject
- cairo-tools
- gcc
- pkgconf
- expat-dev
- file
- zlib-dev
- glib-dev
pipeline:
- name: "Check cairo version"
runs: |
pkg-config --modversion cairo
- name: "Check cairo-gobject version"
runs: |
pkg-config --modversion cairo-gobject
- name: "Verify cairo libraries are installed"
runs: |
ldconfig -p | grep libcairo
ldconfig -p | grep libcairo-gobject
ldconfig -p | grep libcairo-script-interpreter
- name: "Check cairo-trace tool"
runs: |
which cairo-trace
cairo-trace --version
- name: "Compile and run a simple cairo program"
runs: |
cat << EOF > test_cairo.c
#include <cairo.h>
#include <stdio.h>
int main(void) {
cairo_surface_t *surface;
cairo_t *cr;
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 240, 80);
cr = cairo_create(surface);
cairo_select_font_face(cr, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size(cr, 32.0);
cairo_set_source_rgb(cr, 0.0, 0.0, 1.0);
cairo_move_to(cr, 10.0, 50.0);
cairo_show_text(cr, "Hello, Cairo!");
cairo_destroy(cr);
cairo_surface_write_to_png(surface, "hello.png");
cairo_surface_destroy(surface);
printf("Cairo test completed successfully.\n");
return 0;
}
EOF
gcc -o test_cairo test_cairo.c $(pkg-config --cflags --libs cairo)
./test_cairo
test -f hello.png || (echo "PNG file was not created" && exit 1)
file hello.png | grep -q "PNG image data" || (echo "Invalid PNG file created" && exit 1)
- name: "Test cairo-gobject compilation"
runs: |
cat << EOF > test_cairo_gobject.c
#include <cairo-gobject.h>
#include <stdio.h>
int main(void) {
GType type = cairo_gobject_context_get_type();
if (type == G_TYPE_INVALID) {
fprintf(stderr, "Failed to get cairo context type\n");
return 1;
}
printf("Cairo-GObject test completed successfully.\n");
return 0;
}
EOF
gcc -o test_cairo_gobject test_cairo_gobject.c $(pkg-config --cflags --libs cairo-gobject)
./test_cairo_gobject