AtlatestRepositorysigil-app

sigil-app / treepackage.sgl

1;;; sigil-app - Application framework for Sigil
2;;;
3;;; Provides windowing, input handling, and application lifecycle management
4;;; via sokol_app. This is the base package for interactive applications.
5
6(package
7 name: "sigil-app"
8 version: "0.9.0"
9 sigil: "^0.17"
10 description: "Application framework for Sigil (windowing, input, lifecycle)"
11 url: "https://codeberg.org/sigil/sigil-app"
12 license: "BSD-3-Clause"
13 authors: (list "David Wilson <[email protected]>")
15 configs: (list
16 (config
17 name: 'dev
18 output-dir: "build/dev"
19 debug?: #t
20 optimize: 0)
21 (config
22 name: 'release
23 output-dir: "build/release"
24 debug?: #f
25 optimize: 2)
27 ;; Windows x86_64 (MinGW via zig) — built so downstream consumers
28 ;; (e.g., cinder-cantata) can produce Windows binaries from Linux.
29 ;; Mirrors the windows-amd64 config in sigil-audio and the main sigil package.
30 (config
31 name: 'windows-amd64
32 output-dir: "build/windows-amd64"
33 toolchain: 'zig
34 target: "x86_64-windows-gnu"
35 static?: #t
36 debug?: #f
37 optimize: 2
38 features: '(release cross windows)))
40 dependencies: (list
41 (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.17"))
43 libraries: (list
44 (library
45 name: 'sigil-app
46 c-sources: '("src/c/sokol-app.c" "src/c/app.c")
47 c-include-dirs: '("vendor/sokol" "src/c")
48 native-init: "sigil__init_sigil_app_module"
49 ;; Platform-specific linker flags for sokol_app.
50 ;;
51 ;; Procedural (lambda ctx) form so cross-compile configs evaluate
52 ;; the right branch at link time. (case (host-os) ...) was evaluated
53 ;; once at package-load on the host, leaking Linux flags into
54 ;; cross builds.
55 link-flags: (lambda (ctx)
56 (case (target-os ctx)
57 ((linux) '("-lX11" "-lXi" "-lXcursor"))
58 ((darwin) '("-framework" "Cocoa" "-framework" "QuartzCore"))
59 ((windows) '("-lkernel32" "-luser32" "-lshell32" "-lgdi32"))
60 (else '())))))
62 tasks: (list
63 (task
64 name: 'build
65 description: "Build sigil-app"
66 steps: (list
67 (compile-c-sources
68 sources: '("src/c/sokol-app.c" "src/c/app.c")
69 include-dirs: '("vendor/sokol" "src/c")
70 flags: (with-sigil-c-flags '("-std=c99" "-D_GNU_SOURCE"
71 "-DSOKOL_NO_ENTRY" "-DSOKOL_GLCORE"
72 "-Wno-unused-parameter")))
73 (create-static-library name: "sigil-app")
74 (compile-sigil-modules sources: "src/**/*.sgl"
75 output-dir: (config-output-subdir "lib"))))))