-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.janet
104 lines (91 loc) · 2.74 KB
/
project.janet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
(declare-project
:name "toolbox"
:description "a collection of useful janet functions, libraries and more"
:dependencies ["https://github.com/janet-lang/spork.git"
"https://github.com/janet-lang/sqlite3"]
:author "tionis.dev"
:license "MIT"
:url "https://tasadar.net/tionis/tools"
:repo "git https://tasadar.net/tionis/tools")
(declare-source
:source ["toolbox"])
(each f (if (os/stat "man") (os/dir "man") [])
(declare-manpage # Install man pages # TODO auto generate from module if not existant?
(string "man/" f)))
(def fuzzy
(declare-native
:name "toolbox/fuzzy"
:source @["cjanet/fuzzy.janet"]))
(def curi
(declare-native
:name "toolbox/curi"
:source @["cjanet/curi.janet"]))
(def codec
(declare-native
:name "toolbox/codec"
:source @["cjanet/codec.janet"]))
(def crypto
(declare-native
:name "toolbox/crypto"
:cflags [;default-cflags "-I."]
:source @["src/crypto.c"
"src/deps/libhydrogen/hydrogen.c"]))
(def ctrl-c/native
(declare-native
:name "toolbox/ctrl-c/native"
:source ["src/ctrl.c"]))
(def ctrl-c
(declare-source
:prefix "toolbox"
:source ["src/ctrl-c.janet"]))
(def jermbox
(declare-native
:name "toolbox/jermbox"
:cflags ["-std=c99"
"-Wall"
"-D_POSIX_C_SOURCE=200809L"
"-D_XOPEN_SOURCE"]
:source ["src/jermbox.c"
"src/deps/termbox_next/src/termbox.c"
"src/deps/termbox_next/src/utf8.c"
"src/deps/termbox_next/src/term.c"
"src/deps/termbox_next/src/ringbuffer.c"
"src/deps/termbox_next/src/input.c"
"src/deps/termbox_next/src/memstream.c"]))
(when (index-of (os/which) [:posix :linux :macos])
# if creating executable use add :deps [(posix-spawn :static)] etc
# to declare-executable to handle compile steps correctly
(def posix-spawn
(declare-native
:name "toolbox/posix_spawn/native"
:source ["src/posix-spawn.c"]))
(declare-source
:prefix "toolbox"
:source ["src/posix-spawn.janet"])
(def sh
(declare-native
:name "toolbox/sh/native"
:source ["src/sh.c"]))
(declare-source
:prefix "toolbox"
:source ["src/sh.janet"]))
(declare-executable
:name "tb" # TODO install man pages for this or add better cli help
:entry "toolbox/cli.janet"
:deps [(fuzzy :static)
(jermbox :static)]
:install true)
(declare-executable
:name "git-tb" # TODO install man pages for this or add better cli help
:entry "toolbox/git-cli.janet"
:deps [(fuzzy :static)
(jermbox :static)]
:install true)
(declare-executable
:name "tb-fuzzy"
:entry "toolbox/jeff/cli.janet"
:deps [(fuzzy :static)
(jermbox :static)]
:install true)
(post-deps
(print 1))