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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
add_rules("mode.debug", "mode.release", "mode.releasedbg", "mode.minsizerel")
add_requires("nuklear", "nuklear_glfw_gl3", "nuklear_fonts", "glew", "glfw", "tinyfiledialogs",
"c11threads", "pcre2",
"cjson", "ffmpeg")
add_requires("libcurl", { configs = { zlib = true } })
if is_plat("linux") then
set_toolchains("clang")
end
if is_plat("windows") then
set_arch("x86")
set_toolchains("llvm")
end
target("hinata")
set_kind("binary")
add_files("src/*.c")
add_files("src/*/*.c")
set_languages("c11")
if is_mode("debug") then
add_defines("DEBUG")
end
add_packages("nuklear", "nuklear_glfw_gl3", "nuklear_fonts", "glew", "glfw", "libcurl", "tinyfiledialogs",
"c11threads", "pcre2",
"cjson", "ffmpeg")
package("tinyfiledialogs")
set_homepage("https://sourceforge.net/projects/tinyfiledialogs/")
set_description("Native dialog library for WINDOWS MAC OSX GTK+ QT CONSOLE")
set_license("zlib")
add_urls("https://git.code.sf.net/p/tinyfiledialogs/code.git")
if is_plat("windows", "mingw") then
add_syslinks("comdlg32", "ole32", "user32", "shell32")
end
on_install("windows", "mingw", "linux", "macosx", function(package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("tinyfiledialogs")
set_kind("static")
add_files("tinyfiledialogs.c")
add_headerfiles("tinyfiledialogs.h")
]])
import("package.tools.xmake").install(package)
end)
on_test(function(package)
assert(package:check_csnippets({
test = [[
#include <stdio.h>
#include <string.h>
#include "tinyfiledialogs.h"
void test() {
char const * lWillBeGraphicMode;
lWillBeGraphicMode = tinyfd_inputBox("tinyfd_query", NULL, NULL);
}
]]
}))
end)
package("c11threads")
set_homepage("https://github.com/jtsiomb/c11threads")
set_description("Portable C11 threads implementation over POSIX threads and win32 threads.")
add_urls("https://github.com/jtsiomb/c11threads/archive/ec95e1aa82079aefe109d18e5069b79711692064.zip")
add_versions("1.0-ec95e1a", "9eb5eab9db4c32418eea39543d4883022c81167ea5e37f820f5af972bea7a30e")
on_install("linux", "macosx", function(package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("c11threads")
set_kind("static")
add_headerfiles("c11threads.h")
]])
import("package.tools.xmake").install(package)
end)
on_install("windows", "mingw", function(package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("c11threads")
set_kind("static")
add_files("c11threads_win32.c")
add_headerfiles("c11threads.h")
]])
import("package.tools.xmake").install(package)
end)
package("nuklear_glfw_gl3")
set_homepage("https://github.com/Immediate-Mode-UI/Nuklear")
set_description("A single-header ANSI C immediate mode cross-platform GUI library (GLFW OpenGL 3 Binding)")
set_license("MIT")
add_urls("https://github.com/Immediate-Mode-UI/Nuklear/archive/refs/tags/$(version).tar.gz",
"https://github.com/Immediate-Mode-UI/Nuklear.git")
add_versions("4.10.5", "6c80cbd0612447421fa02ad92f4207da2cd019a14d94885dfccac1aadc57926a")
on_install(function(package)
os.cp("demo/glfw_opengl3/nuklear_glfw_gl3.h", package:installdir("include"))
end)
package("nuklear_fonts")
add_urls(
"https://gist.github.com/135e2/656614a4a86cf6f8e9aea9f0de850634/archive/8d1dc2a079cef20d97acbc2a9874b1b77b25070b.zip")
add_versions("8d1dc2a", "3dedfd45900cf68fed49ee50963c37c59af01c7f8deb327224f710c010565f87")
on_install(function(package)
os.cp("unifont.h", package:installdir("include"))
os.cp("NotoSansCJK.h", package:installdir("include"))
end)
package("cjson")
set_homepage("https://github.com/DaveGamble/cJSON")
set_description("Ultralightweight JSON parser in ANSI C.")
set_license("MIT")
set_urls("https://github.com/DaveGamble/cJSON/archive/v$(version).zip",
"https://github.com/DaveGamble/cJSON.git")
add_versions("1.7.16", "ea60a2477e5b7f41418eeb70488f437c56c56f998802e23be22b859e4be3ef44")
add_deps("cmake")
on_install("windows", "macosx", "linux", "mingw", "iphoneos", "android", function(package)
local configs = { "-DENABLE_CJSON_TEST=OFF" }
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function(package)
assert(package:has_cfuncs("cJSON_malloc", { includes = "cjson/cJSON.h" }))
end)
|