Skip to content

Commit 09b486a

Browse files
editline: add package (#5006)
* editline: add package * add msys * add includedirs * try termcap * remove mingw
1 parent 819d720 commit 09b486a

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

packages/e/editline/xmake.lua

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package("editline")
2+
set_homepage("http://thrysoee.dk/editline")
3+
set_description("Autotool- and libtoolized port of the NetBSD Editline library (libedit).")
4+
set_license("BSD-3-Clause")
5+
6+
add_urls("https://thrysoee.dk/editline/libedit-20240808-$(version).tar.gz")
7+
8+
add_versions("3.1", "5f0573349d77c4a48967191cdd6634dd7aa5f6398c6a57fe037cc02696d6099f")
9+
10+
add_configs("terminal_db", {description = "Select terminal library", default = "termcap", type = "string", values = {"termcap", "ncurses", "tinfo"}})
11+
12+
add_includedirs("include", "include/editline")
13+
14+
on_load(function (package)
15+
local terminal = package:config("terminal_db")
16+
if terminal == "termcap" then
17+
package:add("deps", "termcap")
18+
elseif terminal == "ncurses" then
19+
package:add("deps", "ncurses")
20+
if package:is_plat("mingw") then
21+
raise("Unsupported ncurses on mingw, need package libsystre first")
22+
end
23+
else
24+
raise("Unsupported tinfo now!")
25+
end
26+
end)
27+
28+
on_install("linux", "macosx", "bsd", "msys", function (package)
29+
local configs = {"--disable-examples"}
30+
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
31+
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
32+
import("package.tools.autoconf").install(package, configs, {packagedeps = package:config("terminal_db")})
33+
end)
34+
35+
on_test(function (package)
36+
assert(package:has_cfuncs("el_init", {includes = "histedit.h"}))
37+
end)

packages/n/ncurses/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ package("ncurses")
3333
end
3434
end)
3535

36-
on_install("linux", "macosx", "bsd", function (package)
36+
on_install("linux", "macosx", "bsd", "msys", function (package)
3737
local configs = {
3838
"--without-manpages",
3939
"--enable-sigwinch",

0 commit comments

Comments
 (0)