Skip to content

Commit ddcf1a3

Browse files
stfl: add package (#4570)
* stfl: add package * limit plat * fix syslinks * fix includedirs * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua * Update xmake.lua
1 parent c00e635 commit ddcf1a3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

packages/s/stfl/xmake.lua

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package("stfl")
2+
set_homepage("https://github.com/newsboat/stfl")
3+
set_description("stfl with Newsboat-related bugfixes")
4+
set_license("LGPL-3.0")
5+
6+
add_urls("https://github.com/newsboat/stfl.git")
7+
8+
add_versions("2024.12.24", "bbb2404580e845df2556560112c8aefa27494d66")
9+
10+
if is_plat("linux", "bsd") then
11+
add_syslinks("pthread")
12+
elseif is_plat("macosx") then
13+
add_syslinks("iconv")
14+
end
15+
16+
add_deps("ncurses")
17+
18+
on_check("android", function (package)
19+
local ndk = package:toolchain("ndk")
20+
local ndkver = ndk:config("ndkver")
21+
local ndk_sdkver = ndk:config("ndk_sdkver")
22+
if ndkver and tonumber(ndkver) == 27 then
23+
assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(stfl) require ndk api level > 21")
24+
end
25+
end)
26+
27+
on_install("!wasm and !iphoneos and !mingw and @!windows", function (package)
28+
io.writefile("xmake.lua", [[
29+
add_rules("mode.release", "mode.debug")
30+
add_requires("ncurses")
31+
target("stfl")
32+
set_kind("$(kind)")
33+
add_files("*.c|example.c")
34+
add_files("widgets/*.c")
35+
add_includedirs(".")
36+
add_defines("_XOPEN_SOURCE=700", "_GNU_SOURCE")
37+
add_headerfiles("stfl.h")
38+
39+
if is_plat("linux", "bsd") then
40+
add_syslinks("pthread")
41+
elseif is_plat("macosx") then
42+
add_syslinks("iconv")
43+
end
44+
add_packages("ncurses")
45+
]])
46+
import("package.tools.xmake").install(package)
47+
end)
48+
49+
on_test(function (package)
50+
assert(package:has_cfuncs("stfl_create", {includes = "stfl.h"}))
51+
end)

0 commit comments

Comments
 (0)