Commitd7601c2fRecorded2 Sep 2026Repositorysigil-cairo

Release v0.8.1: resolvable again, and the suite runs

Message

sigil-cairo could not be resolved, built or tested. Four layers, each hiding the next; the library source itself needed no change.

Packaging:

  • no sigil: field, so deps install refused outright
  • sigil-ffi requested FROM THE MONOREPO after it was extracted
  • pins still on ^0.9.0
  • no dev-dependencies, so the native test harness could not be built

Test file, three retired idioms:

  • (fn () ...) -- abandoned thunk syntax -- rewritten as (begin ...)
  • bare (assert x) -> (assert-true x); sigil-test exports no bare assert
  • (dict-ref d 'width) -> (dict-ref d width:); src builds keyword-keyed dicts and the test asked with symbols

Suite green: 17 tests, 0 failures.

Running the suite needs the system cairo on the dynamic linker path: guix shell cairo -- sh -c 'LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib sigil test' guix shell alone is not enough -- it populates the profile but not LD_LIBRARY_PATH, and the FFI dlopens libcairo by soname.

Version goes to 0.8.1: a v0.8.0 tag already exists (pointing at an "Add README" commit, while master stayed at 0.7.0), so 0.7.1 would sit below it. The one consumer, easel, pins ^0.7.0 and will need its pin bumped -- but easel is itself missing a sigil: field and cannot build today, so nothing is stranded by this choice.

Changed
 package.sgl         | 11 ++++++++---
 sigil.lock          | 46 +++++++++++++++++++++++++++++++++++++++-------
 test/test-cairo.sgl | 56 ++++++++++++++++++++++++++++----------------------------
 3 files changed, 75 insertions(+), 38 deletions(-)
Diff
package.sglmodified
@@ -5,7 +5,8 @@
5
6
(package
7
name: "sigil-cairo"
−8
version: "0.7.0"
+8
version: "0.8.1"
+9
sigil: "0.20"
10
description: "Cairo 2D graphics bindings for Sigil"
11
url: "https://codeberg.org/sigil/sigil-cairo"
12
license: "BSD-3-Clause"
@@ -24,8 +25,12 @@
25
optimize: 2))
26
27
dependencies: (list
−27
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.9.0")
−28
(from-git url: "codeberg:sigil/sigil" package: "sigil-ffi" version: "^0.9.0"))
+28
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.20")
+29
(from-git url: "codeberg:sigil/sigil-ffi" version: "^0.16"))
+30
+31
dev-dependencies: (list
+32
(from-git url: "codeberg:sigil/sigil" package: "sigil-test" version: "^0.20")
+33
(from-git url: "codeberg:sigil/sigil" package: "sigil-test-runner" version: "^0.20"))
34
35
tasks: (list
36
(task
sigil.lockmodified
@@ -2,14 +2,46 @@
2
(lock
3
(package name: "sigil-stdlib"
4
url: "codeberg:sigil/sigil"
−5
ref: "^0.9.0"
−6
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"
+5
ref: "^0.20"
+6
sha: "2e452e2f641fcf63be4e88a2748b34791543be8f"
7
package-selector: "sigil-stdlib"
−8
version: "0.9.1")
+8
version: "0.20.3")
9
(package name: "sigil-ffi"
+10
url: "codeberg:sigil/sigil-ffi"
+11
ref: "^0.16"
+12
sha: "43283237fae5abdba324769ad4a7a2baf694e660"
+13
version: "0.16.3")
+14
(package name: "sigil-test"
15
url: "codeberg:sigil/sigil"
−11
ref: "^0.9.0"
−12
sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0"
−13
package-selector: "sigil-ffi"
−14
version: "0.9.1")
+16
ref: "^0.20"
+17
sha: "2e452e2f641fcf63be4e88a2748b34791543be8f"
+18
package-selector: "sigil-test"
+19
version: "0.20.3")
+20
(package name: "sigil-test-runner"
+21
url: "codeberg:sigil/sigil"
+22
ref: "^0.20"
+23
sha: "2e452e2f641fcf63be4e88a2748b34791543be8f"
+24
package-selector: "sigil-test-runner"
+25
version: "0.20.3")
+26
(package name: "sigil-lib"
+27
url: "codeberg:sigil/sigil"
+28
ref: "^0.19"
+29
sha: "2e452e2f641fcf63be4e88a2748b34791543be8f"
+30
package-selector: "sigil-lib"
+31
version: "0.20.3")
+32
(package name: "sigil-json"
+33
url: "codeberg:sigil/sigil-json"
+34
ref: "^0.16.0"
+35
sha: "55c9e74712b5f79b45d41c65cfe0aef2c8f7e155"
+36
version: "0.16.0")
+37
(package name: "sigil-crypto"
+38
url: "codeberg:sigil/sigil-crypto"
+39
ref: "^0.16.0"
+40
sha: "debba4462b7ff4de143db9e0792b8606fdc455bc"
+41
version: "0.16.5")
+42
(package name: "sigil-sqlite"
+43
url: "codeberg:sigil/sigil-sqlite"
+44
ref: "^0.16.0"
+45
sha: "569ef1063dda8f5989968644af31fc09c64b4bfe"
+46
version: "0.16.3")
47
)
test/test-cairo.sglmodified
@@ -10,30 +10,30 @@
10
(test-group "cairo"
11
12
(test-group "Image surfaces"
−13
(test "create image surface" (fn ()
+13
(test "create image surface" (begin
14
(let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100)))
−15
(assert (pointer? surface))
+15
(assert-true (pointer? surface))
16
(assert-equal CAIRO_STATUS_SUCCESS (cairo-surface-status surface))
17
(cairo-surface-destroy surface))))
18
−19
(test "surface dimensions" (fn ()
+19
(test "surface dimensions" (begin
20
(let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 150)))
21
(assert-equal 200 (cairo-image-surface-get-width surface))
22
(assert-equal 150 (cairo-image-surface-get-height surface))
23
(assert-equal CAIRO_FORMAT_ARGB32 (cairo-image-surface-get-format surface))
−24
(assert (> (cairo-image-surface-get-stride surface) 0))
+24
(assert-true (> (cairo-image-surface-get-stride surface) 0))
25
(cairo-surface-destroy surface)))))
26
27
(test-group "Context"
−28
(test "create and destroy context" (fn ()
+28
(test "create and destroy context" (begin
29
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100))
30
(cr (cairo-create surface)))
−31
(assert (pointer? cr))
+31
(assert-true (pointer? cr))
32
(assert-equal CAIRO_STATUS_SUCCESS (cairo-status cr))
33
(cairo-destroy cr)
34
(cairo-surface-destroy surface))))
35
−36
(test "save and restore" (fn ()
+36
(test "save and restore" (begin
37
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100))
38
(cr (cairo-create surface)))
39
(cairo-set-line-width cr 5.0)
@@ -44,11 +44,11 @@
44
(cairo-destroy cr)
45
(cairo-surface-destroy surface))))
46
−47
(test "status-to-string" (fn ()
−48
(assert (string? (cairo-status-to-string CAIRO_STATUS_SUCCESS))))))
+47
(test "status-to-string" (begin
+48
(assert-true (string? (cairo-status-to-string CAIRO_STATUS_SUCCESS))))))
49
50
(test-group "Drawing"
−51
(test "set-source-rgb and rectangle" (fn ()
+51
(test "set-source-rgb and rectangle" (begin
52
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
53
(cr (cairo-create surface)))
54
(cairo-set-source-rgb cr 0.2 0.3 0.8)
@@ -58,7 +58,7 @@
58
(cairo-destroy cr)
59
(cairo-surface-destroy surface))))
60
−61
(test "arc drawing" (fn ()
+61
(test "arc drawing" (begin
62
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
63
(cr (cairo-create surface)))
64
(cairo-set-source-rgba cr 1.0 0.0 0.0 0.8)
@@ -68,7 +68,7 @@
68
(cairo-destroy cr)
69
(cairo-surface-destroy surface))))
70
−71
(test "curve-to drawing" (fn ()
+71
(test "curve-to drawing" (begin
72
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
73
(cr (cairo-create surface)))
74
(cairo-set-source-rgb cr 0.0 0.0 0.0)
@@ -80,7 +80,7 @@
80
(cairo-destroy cr)
81
(cairo-surface-destroy surface))))
82
−83
(test "line drawing" (fn ()
+83
(test "line drawing" (begin
84
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
85
(cr (cairo-create surface)))
86
(cairo-set-source-rgb cr 0.0 0.5 0.0)
@@ -93,7 +93,7 @@
93
(cairo-surface-destroy surface)))))
94
95
(test-group "PNG output"
−96
(test "write to PNG" (fn ()
+96
(test "write to PNG" (begin
97
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
98
(cr (cairo-create surface)))
99
(cairo-set-source-rgb cr 0.2 0.3 0.8)
@@ -103,35 +103,35 @@
103
(let ((status (cairo-surface-write-to-png surface "/tmp/test-cairo.png")))
104
(assert-equal CAIRO_STATUS_SUCCESS status))
105
(cairo-surface-destroy surface)
−106
(assert (file-exists? "/tmp/test-cairo.png"))))))
+106
(assert-true (file-exists? "/tmp/test-cairo.png"))))))
107
108
(test-group "Text"
−109
(test "text extents" (fn ()
+109
(test "text extents" (begin
110
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 400 200))
111
(cr (cairo-create surface)))
112
(cairo-select-font-face cr "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_NORMAL)
113
(cairo-set-font-size cr 20.0)
114
(let ((extents (cairo-text-extents cr "Hello, Cairo!")))
−115
(assert (dict? extents))
−116
(assert (> (dict-ref extents 'width) 0))
−117
(assert (> (dict-ref extents 'height) 0)))
+115
(assert-true (dict? extents))
+116
(assert-true (> (dict-ref extents width:) 0))
+117
(assert-true (> (dict-ref extents height:) 0)))
118
(cairo-destroy cr)
119
(cairo-surface-destroy surface))))
120
−121
(test "font extents" (fn ()
+121
(test "font extents" (begin
122
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 400 200))
123
(cr (cairo-create surface)))
124
(cairo-select-font-face cr "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_NORMAL)
125
(cairo-set-font-size cr 20.0)
126
(let ((extents (cairo-font-extents cr)))
−127
(assert (dict? extents))
−128
(assert (> (dict-ref extents 'ascent) 0))
−129
(assert (> (dict-ref extents 'height) 0)))
+127
(assert-true (dict? extents))
+128
(assert-true (> (dict-ref extents ascent:) 0))
+129
(assert-true (> (dict-ref extents height:) 0)))
130
(cairo-destroy cr)
131
(cairo-surface-destroy surface)))))
132
133
(test-group "Transforms"
−134
(test "translate and scale" (fn ()
+134
(test "translate and scale" (begin
135
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
136
(cr (cairo-create surface)))
137
(cairo-translate cr 100.0 100.0)
@@ -143,7 +143,7 @@
143
(cairo-surface-destroy surface)))))
144
145
(test-group "Patterns"
−146
(test "linear gradient" (fn ()
+146
(test "linear gradient" (begin
147
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
148
(cr (cairo-create surface))
149
(pat (cairo-pattern-create-linear 0.0 0.0 200.0 200.0)))
@@ -156,7 +156,7 @@
156
(cairo-destroy cr)
157
(cairo-surface-destroy surface))))
158
−159
(test "radial gradient" (fn ()
+159
(test "radial gradient" (begin
160
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200))
161
(cr (cairo-create surface))
162
(pat (cairo-pattern-create-radial 100.0 100.0 10.0 100.0 100.0 90.0)))
@@ -170,7 +170,7 @@
170
(cairo-surface-destroy surface)))))
171
172
(test-group "Convenience"
−173
(test "with-cairo-context" (fn ()
+173
(test "with-cairo-context" (begin
174
(let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100)))
175
(with-cairo-context surface
176
(lambda (cr)
@@ -179,7 +179,7 @@
179
(assert-equal CAIRO_STATUS_SUCCESS (cairo-status cr))))
180
(cairo-surface-destroy surface))))
181
−182
(test "set-dash" (fn ()
+182
(test "set-dash" (begin
183
(let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 100))
184
(cr (cairo-create surface)))
185
(cairo-set-source-rgb cr 0.0 0.0 0.0)