AtlatestRepositorysigil-ui
1
;;; sigil-ui - a retained-mode UI framework for Sigil2
;;;3
;;; Views are functions of state, reconciled into a persistent tree that4
;;; produces a display list. Renderers turn the display list into pixels;5
;;; surfaces put the pixels on a screen or in a file.7
(define ui-common-sources '("native/raster.c" "native/png.c"))8
(define ui-flags '("-std=c99" "-Wall" "-Wextra" "-Wno-unused-parameter" "-D_GNU_SOURCE"))10
(define (compile-ui ctx)11
((compile-c-sources12
sources: (append ui-common-sources13
(case (target-os ctx)14
((darwin windows) '("native/surface-unavailable.c"))15
((linux) '("native/surface.c" "native/wayland.c"))16
(else (error "sigil-ui supports Linux, macOS and Windows targets"))))17
include-dirs: '("native/wayland" "native/wayland/include")18
flags: (with-sigil-c-flags ui-flags)) ctx))20
(define (compile-ui-modules ctx)21
((compile-sigil-modules22
sources: "src/**/*.sgl"23
exclude: (map (lambda (file) (path-join (context-package-dir ctx) file))24
(append25
(if (eq? (target-os ctx) 'windows) '() '("src/sigil/ui/win32.sgl"))26
(if (eq? (target-os ctx) 'darwin) '()27
'("src/sigil/ui/appkit.sgl" "src/sigil/ui/appkit/wait.sgl"))))28
output-dir: (config-output-subdir "lib")) ctx))30
(package31
name: "sigil-ui"32
version: "0.2.11"33
sigil: "0.24.8"34
description: "Retained-mode UI framework with a software renderer"35
url: "https://git.usesigil.org/sigil/sigil-ui"36
license: "BSD-3-Clause"37
authors: (list "David Wilson <david@daviwil.com>")39
configs: (list40
(config name: 'darwin-arm64 toolchain: 'zig target: "aarch64-macos.15.0-none"41
features: '(cross darwin) output-dir: "build/darwin-arm64")42
(config name: 'darwin-amd64 toolchain: 'zig target: "x86_64-macos.15.0-none"43
features: '(cross darwin) output-dir: "build/darwin-amd64")44
(config name: 'windows-amd64 toolchain: 'zig target: "x86_64-windows-gnu"45
features: '(cross windows) output-dir: "build/windows-amd64")46
(config47
name: 'dev48
output-dir: "build/dev"49
debug?: #t50
optimize: 0)51
(config52
name: 'release53
output-dir: "build/release"54
debug?: #f55
optimize: 2))57
dependencies: (list58
(from-pkg name: "sigil/sigil-window" version: "^0.2.2")59
(from-pkg name: "sigil/sigil-font" version: "^0.1.3")60
(from-pkg name: "sigil/sigil-lib" version: "^0.24.8")61
(from-pkg name: "sigil/sigil-stdlib" version: "^0.24.8"))63
;; The test runner declares its package/build/store helpers transitively.64
dev-dependencies: (list65
(from-pkg name: "sigil/sigil-shell" version: "^0.24.6")66
(from-pkg name: "sigil/sigil-test" version: "^0.24.6")67
(from-pkg name: "sigil/sigil-test-runner" version: "^0.24.6"))69
;; Pixel loops and device access are native. Linux uses runtime-loaded70
;; Wayland libraries and the protocol tables from sigil-window. Sigil-window71
;; also supplies the AppKit host and native child services.72
libraries: (list73
(library74
name: 'sigil-ui75
c-sources: ui-common-sources76
c-include-dirs: '("native" "native/wayland" "native/wayland/include")77
native-init: "sigil__init_sigil_ui_native"78
link-flags: '()))80
tasks: (list81
(task82
name: 'build83
description: "Build sigil-ui"84
steps: (list85
compile-ui87
(create-static-library88
name: "sigil-ui")90
compile-ui-modules92
(copy-package-docs)))))