Release v0.8.1: resolvable again, and the suite runs
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.
package.sgl | 11 ++++++++---
sigil.lock | 46 +++++++++++++++++++++++++++++++++++++++-------
test/test-cairo.sgl | 56 ++++++++++++++++++++++++++++----------------------------
3 files changed, 75 insertions(+), 38 deletions(-)package.sglmodified
(package name: "sigil-cairo" version: "0.7.0" version: "0.8.1" sigil: "0.20" description: "Cairo 2D graphics bindings for Sigil" url: "https://codeberg.org/sigil/sigil-cairo" license: "BSD-3-Clause" optimize: 2)) dependencies: (list (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.9.0") (from-git url: "codeberg:sigil/sigil" package: "sigil-ffi" version: "^0.9.0")) (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.20") (from-git url: "codeberg:sigil/sigil-ffi" version: "^0.16")) dev-dependencies: (list (from-git url: "codeberg:sigil/sigil" package: "sigil-test" version: "^0.20") (from-git url: "codeberg:sigil/sigil" package: "sigil-test-runner" version: "^0.20")) tasks: (list (tasksigil.lockmodified
(lock (package name: "sigil-stdlib" url: "codeberg:sigil/sigil" ref: "^0.9.0" sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0" ref: "^0.20" sha: "2e452e2f641fcf63be4e88a2748b34791543be8f" package-selector: "sigil-stdlib" version: "0.9.1") version: "0.20.3") (package name: "sigil-ffi" url: "codeberg:sigil/sigil-ffi" ref: "^0.16" sha: "43283237fae5abdba324769ad4a7a2baf694e660" version: "0.16.3") (package name: "sigil-test" url: "codeberg:sigil/sigil" ref: "^0.9.0" sha: "54f66e8ec446b65b75ab6f12454d2c0aa269f2c0" package-selector: "sigil-ffi" version: "0.9.1") ref: "^0.20" sha: "2e452e2f641fcf63be4e88a2748b34791543be8f" package-selector: "sigil-test" version: "0.20.3") (package name: "sigil-test-runner" url: "codeberg:sigil/sigil" ref: "^0.20" sha: "2e452e2f641fcf63be4e88a2748b34791543be8f" package-selector: "sigil-test-runner" version: "0.20.3") (package name: "sigil-lib" url: "codeberg:sigil/sigil" ref: "^0.19" sha: "2e452e2f641fcf63be4e88a2748b34791543be8f" package-selector: "sigil-lib" version: "0.20.3") (package name: "sigil-json" url: "codeberg:sigil/sigil-json" ref: "^0.16.0" sha: "55c9e74712b5f79b45d41c65cfe0aef2c8f7e155" version: "0.16.0") (package name: "sigil-crypto" url: "codeberg:sigil/sigil-crypto" ref: "^0.16.0" sha: "debba4462b7ff4de143db9e0792b8606fdc455bc" version: "0.16.5") (package name: "sigil-sqlite" url: "codeberg:sigil/sigil-sqlite" ref: "^0.16.0" sha: "569ef1063dda8f5989968644af31fc09c64b4bfe" version: "0.16.3"))test/test-cairo.sglmodified
(test-group "cairo" (test-group "Image surfaces" (test "create image surface" (fn () (test "create image surface" (begin (let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100))) (assert (pointer? surface)) (assert-true (pointer? surface)) (assert-equal CAIRO_STATUS_SUCCESS (cairo-surface-status surface)) (cairo-surface-destroy surface)))) (test "surface dimensions" (fn () (test "surface dimensions" (begin (let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 150))) (assert-equal 200 (cairo-image-surface-get-width surface)) (assert-equal 150 (cairo-image-surface-get-height surface)) (assert-equal CAIRO_FORMAT_ARGB32 (cairo-image-surface-get-format surface)) (assert (> (cairo-image-surface-get-stride surface) 0)) (assert-true (> (cairo-image-surface-get-stride surface) 0)) (cairo-surface-destroy surface))))) (test-group "Context" (test "create and destroy context" (fn () (test "create and destroy context" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100)) (cr (cairo-create surface))) (assert (pointer? cr)) (assert-true (pointer? cr)) (assert-equal CAIRO_STATUS_SUCCESS (cairo-status cr)) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "save and restore" (fn () (test "save and restore" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100)) (cr (cairo-create surface))) (cairo-set-line-width cr 5.0) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "status-to-string" (fn () (assert (string? (cairo-status-to-string CAIRO_STATUS_SUCCESS)))))) (test "status-to-string" (begin (assert-true (string? (cairo-status-to-string CAIRO_STATUS_SUCCESS)))))) (test-group "Drawing" (test "set-source-rgb and rectangle" (fn () (test "set-source-rgb and rectangle" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-set-source-rgb cr 0.2 0.3 0.8) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "arc drawing" (fn () (test "arc drawing" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-set-source-rgba cr 1.0 0.0 0.0 0.8) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "curve-to drawing" (fn () (test "curve-to drawing" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-set-source-rgb cr 0.0 0.0 0.0) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "line drawing" (fn () (test "line drawing" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-set-source-rgb cr 0.0 0.5 0.0) (cairo-surface-destroy surface))))) (test-group "PNG output" (test "write to PNG" (fn () (test "write to PNG" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-set-source-rgb cr 0.2 0.3 0.8) (let ((status (cairo-surface-write-to-png surface "/tmp/test-cairo.png"))) (assert-equal CAIRO_STATUS_SUCCESS status)) (cairo-surface-destroy surface) (assert (file-exists? "/tmp/test-cairo.png")))))) (assert-true (file-exists? "/tmp/test-cairo.png")))))) (test-group "Text" (test "text extents" (fn () (test "text extents" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 400 200)) (cr (cairo-create surface))) (cairo-select-font-face cr "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_NORMAL) (cairo-set-font-size cr 20.0) (let ((extents (cairo-text-extents cr "Hello, Cairo!"))) (assert (dict? extents)) (assert (> (dict-ref extents 'width) 0)) (assert (> (dict-ref extents 'height) 0))) (assert-true (dict? extents)) (assert-true (> (dict-ref extents width:) 0)) (assert-true (> (dict-ref extents height:) 0))) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "font extents" (fn () (test "font extents" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 400 200)) (cr (cairo-create surface))) (cairo-select-font-face cr "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_NORMAL) (cairo-set-font-size cr 20.0) (let ((extents (cairo-font-extents cr))) (assert (dict? extents)) (assert (> (dict-ref extents 'ascent) 0)) (assert (> (dict-ref extents 'height) 0))) (assert-true (dict? extents)) (assert-true (> (dict-ref extents ascent:) 0)) (assert-true (> (dict-ref extents height:) 0))) (cairo-destroy cr) (cairo-surface-destroy surface))))) (test-group "Transforms" (test "translate and scale" (fn () (test "translate and scale" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface))) (cairo-translate cr 100.0 100.0) (cairo-surface-destroy surface))))) (test-group "Patterns" (test "linear gradient" (fn () (test "linear gradient" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface)) (pat (cairo-pattern-create-linear 0.0 0.0 200.0 200.0))) (cairo-destroy cr) (cairo-surface-destroy surface)))) (test "radial gradient" (fn () (test "radial gradient" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 200)) (cr (cairo-create surface)) (pat (cairo-pattern-create-radial 100.0 100.0 10.0 100.0 100.0 90.0))) (cairo-surface-destroy surface))))) (test-group "Convenience" (test "with-cairo-context" (fn () (test "with-cairo-context" (begin (let ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 100 100))) (with-cairo-context surface (lambda (cr) (assert-equal CAIRO_STATUS_SUCCESS (cairo-status cr)))) (cairo-surface-destroy surface)))) (test "set-dash" (fn () (test "set-dash" (begin (let* ((surface (cairo-image-surface-create CAIRO_FORMAT_ARGB32 200 100)) (cr (cairo-create surface))) (cairo-set-source-rgb cr 0.0 0.0 0.0)