|
| 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) |
0 commit comments