Skip to content

Commit 355509f

Browse files
termcap: add package (#5015)
* termcap: add package * patch headers * add missing patch * fix check_cincludes
1 parent 659e35c commit 355509f

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/tparam.c b/tparam.c
2+
index 5a9809a..09ef456 100644
3+
--- a/tparam.c
4+
+++ b/tparam.c
5+
@@ -40,6 +40,10 @@ char *realloc ();
6+
7+
#endif /* not emacs */
8+
9+
+#ifdef HAVE_UNISTD_H
10+
+#include <unistd.h>
11+
+#endif
12+
+
13+
#ifndef NULL
14+
#define NULL (char *) 0
15+
#endif

packages/t/termcap/xmake.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package("termcap")
2+
set_homepage("https://www.gnu.org/software/termcap")
3+
set_description("Enables programs to use display terminals in a terminal-independent manner")
4+
set_license("GPL-2.0-or-later")
5+
6+
add_urls("https://ftp.gnu.org/gnu/termcap/termcap-$(version).tar.gz",
7+
"https://github.com/marcv81/termcap.git")
8+
9+
add_versions("1.3.1", "91a0e22e5387ca4467b5bcb18edf1c51b930262fd466d5fda396dd9d26719100")
10+
11+
add_patches("1.3.1", "patches/1.3.1/unistd_h.patch", "9a61b94c22d913ac4f5adf3e5735c07cb5e57eaa057f737bacb754215897cce0")
12+
13+
on_install(function (package)
14+
io.writefile("xmake.lua", [[
15+
add_rules("mode.debug", "mode.release")
16+
includes("@builtin/check")
17+
check_cincludes("HAVE_FCNTL_H", "fcntl.h")
18+
check_cincludes("HAVE_UNISTD_H", "unistd.h")
19+
target("termcap")
20+
set_kind("$(kind)")
21+
add_files("*.c")
22+
add_headerfiles("*.h")
23+
add_defines("STDC_HEADERS")
24+
if is_plat("windows") and is_kind("shared") then
25+
add_rules("utils.symbols.export_all")
26+
end
27+
]])
28+
import("package.tools.xmake").install(package)
29+
end)
30+
31+
on_test(function (package)
32+
assert(package:has_cfuncs("tgetent", {includes = "termcap.h"}))
33+
end)

0 commit comments

Comments
 (0)