Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Emery Hemingway | b3d0b69626 | |
Emery Hemingway | 3aa3521cf4 | |
Emery Hemingway | 7b5276d0f1 | |
Emery Hemingway | 068c619d9c | |
Emery Hemingway | 60515ad408 | |
Emery Hemingway | f83e57ee22 | |
Emery Hemingway | e509316985 |
|
@ -1 +1 @@
|
|||
/.direnv
|
||||
/nim.cfg
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
include ../syndicate-nim/depends.tup
|
||||
NIM_FLAGS += --path:$(TUP_CWD)/../syndicate-nim/src
|
||||
|
||||
NIM_GROUPS += $(TUP_CWD)/<lock>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20230506"
|
||||
version = "20231130"
|
||||
author = "Emery Hemingway"
|
||||
description = "Syndicate actor for asserting Fontconfig information"
|
||||
license = "Unlicense"
|
||||
|
@ -10,4 +10,4 @@ bin = @["fontconfig_actor"]
|
|||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 1.6.10"
|
||||
requires "nim >= 2.0.0", "syndicate >= 20230816"
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"depends": [
|
||||
{
|
||||
"method": "fetchzip",
|
||||
"packages": [
|
||||
"hashlib"
|
||||
],
|
||||
"path": "/nix/store/fav82xdbicvlk34nmcbl89zx99lr3mbs-source",
|
||||
"rev": "f9455d4be988e14e3dc7933eb7cc7d7c4820b7ac",
|
||||
"sha256": "1sx6j952lj98629qfgr7ds5aipyw9d6lldcnnqs205wpj4pkcjb3",
|
||||
"srcDir": "",
|
||||
"url": "https://github.com/ehmry/hashlib/archive/f9455d4be988e14e3dc7933eb7cc7d7c4820b7ac.tar.gz"
|
||||
},
|
||||
{
|
||||
"method": "fetchzip",
|
||||
"packages": [
|
||||
"nimcrypto"
|
||||
],
|
||||
"path": "/nix/store/zyr8zwh7vaiycn1s4r8cxwc71f2k5l0h-source",
|
||||
"ref": "traditional-api",
|
||||
"rev": "602c5d20c69c76137201b5d41f788f72afb95aa8",
|
||||
"sha256": "1dmdmgb6b9m5f8dyxk781nnd61dsk3hdxqks7idk9ncnpj9fng65",
|
||||
"srcDir": "",
|
||||
"url": "https://github.com/cheatfate/nimcrypto/archive/602c5d20c69c76137201b5d41f788f72afb95aa8.tar.gz"
|
||||
},
|
||||
{
|
||||
"method": "fetchzip",
|
||||
"packages": [
|
||||
"npeg"
|
||||
],
|
||||
"path": "/nix/store/ffkxmjmigfs7zhhiiqm0iw2c34smyciy-source",
|
||||
"ref": "1.2.1",
|
||||
"rev": "26d62fdc40feb84c6533956dc11d5ee9ea9b6c09",
|
||||
"sha256": "0xpzifjkfp49w76qmaylan8q181bs45anmp46l4bwr3lkrr7bpwh",
|
||||
"srcDir": "src",
|
||||
"url": "https://github.com/zevv/npeg/archive/26d62fdc40feb84c6533956dc11d5ee9ea9b6c09.tar.gz"
|
||||
},
|
||||
{
|
||||
"method": "fetchzip",
|
||||
"packages": [
|
||||
"preserves"
|
||||
],
|
||||
"path": "/nix/store/fmb2yckksz7iv3qdkk5gk1j060kppkq9-source",
|
||||
"ref": "20231102",
|
||||
"rev": "4faeb766dc3945bcfacaa1a836ef6ab29b20ceb0",
|
||||
"sha256": "1a3g5bk1l1h250q3p6sqv6r1lpsplp330qqyp48r0i4a5r0jksq3",
|
||||
"srcDir": "src",
|
||||
"url": "https://git.syndicate-lang.org/ehmry/preserves-nim/archive/4faeb766dc3945bcfacaa1a836ef6ab29b20ceb0.tar.gz"
|
||||
},
|
||||
{
|
||||
"method": "fetchzip",
|
||||
"packages": [
|
||||
"syndicate"
|
||||
],
|
||||
"path": "/nix/store/nhpvl223vbzdrlzikw7pgyfxs344w7ma-source",
|
||||
"ref": "20231108",
|
||||
"rev": "095418032180e360ea27ec7fcd63193944b68e2c",
|
||||
"sha256": "09pbml2chzz0v5zpz67fs7raj0mfmg8qrih2vz85xxc51h7ncqvw",
|
||||
"srcDir": "src",
|
||||
"url": "https://git.syndicate-lang.org/ehmry/syndicate-nim/archive/095418032180e360ea27ec7fcd63193944b68e2c.tar.gz"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
pkgs.buildNimPackage {
|
||||
name = "dummy";
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
buildInputs = [ pkgs.fontconfig ];
|
||||
lockFile = ./lock.json;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
import std/[asyncdispatch, options, os, tables]
|
||||
import preserves, syndicate, syndicate/[patterns]
|
||||
import preserves, syndicate, syndicate/relays, syndicate/[patterns]
|
||||
import ./protocol
|
||||
|
||||
proc logError(args: varargs[string, `$`]) = writeLine(stderr, args)
|
||||
|
@ -146,7 +146,7 @@ template withFontconfig(body: untyped): untyped =
|
|||
body
|
||||
Fini()
|
||||
|
||||
proc serve(ds: Ref; turn: var Turn) =
|
||||
proc serve(ds: Cap; turn: var Turn) =
|
||||
let observation = ?Observe(pattern: !FontAssertion) ?? {0: grabDict()}
|
||||
during(turn, ds, observation) do (properties: Preserve[void]):
|
||||
var fontAssert: FontAssertion
|
||||
|
@ -157,7 +157,7 @@ proc serve(ds: Ref; turn: var Turn) =
|
|||
var
|
||||
res = FcResultNoMatch
|
||||
pat = fillPattern(fontAssert.pattern)
|
||||
font = FontMatch(nil, pat, res)
|
||||
font = FontMatch(FcConfig(nil), pat, res)
|
||||
if res != FcResultMatch:
|
||||
logError "no font matched for ", fontAssert.pattern
|
||||
else:
|
||||
|
@ -166,7 +166,7 @@ proc serve(ds: Ref; turn: var Turn) =
|
|||
PatternDestroy(pat)
|
||||
discard publish(turn, ds, fontAssert)
|
||||
|
||||
runActor("main") do (root: Ref; turn: var Turn):
|
||||
connectStdio(root, turn)
|
||||
during(turn, root, ?BootArguments) do (ds: Ref):
|
||||
runActor("main") do (root: Cap; turn: var Turn):
|
||||
connectStdio(turn, root)
|
||||
during(turn, root, ?BootArguments) do (ds: Cap):
|
||||
serve(ds, turn)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import
|
||||
std/typetraits, preserves, std/tables
|
||||
preserves, std/tables
|
||||
|
||||
type
|
||||
FontAssertion* {.preservesRecord: "fontconfig".} = object
|
||||
|
|
Loading…
Reference in New Issue