Selaa lähdekoodia

improve ncurses

ruki 5 vuotta sitten
vanhempi
commit
19bfaff995
1 muutettua tiedostoa jossa 22 lisäystä ja 2 poistoa
  1. 22 2
      packages/n/ncurses/xmake.lua

+ 22 - 2
packages/n/ncurses/xmake.lua

@@ -8,9 +8,29 @@ package("ncurses")
              "ftp://ftp.gnu.org/gnu/ncurses/ncurses-$(version).tar.gz")
     add_versions("6.1", "aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17")
 
+    add_configs("widec", { description = "Compile with wide-char/UTF-8 code.", default = true, type = "boolean"})
+
     add_includedirs("include/ncurses", "include")
-    add_links("ncurses", "form", "panel", "menu")
+
+    on_load(function (package)
+        if package:config("widec") then
+            package:add("links", "ncursesw", "formw", "panelw", "menuw")
+        else
+            package:add("links", "ncurses", "form", "panel", "menu")
+        end
+    end)
 
     on_install("linux", "macosx", function (package)
-        import("package.tools.autoconf").install(package, {"--without-manpages"})
+        local configs = {"--without-manpages", "--enable-sigwinch", "--with-gpm=no"}
+        if package:config("widec") then
+            table.insert(configs, "--enable-widec")
+        end
+        if package:config("shared") then
+            table.insert(configs, "--with-shared")
+        end
+        import("package.tools.autoconf").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("initscr", {includes = "curses.h"}))
     end)