Update pdcursesmod to v4.4.0 (#3672)

Co-authored-by: star9029 <hengxings783@gmail.com>
pull/3687/head
ruki 1 year ago committed by GitHub
parent c46023e629
commit e3c4ca2585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 157
      packages/p/pdcursesmod/xmake.lua

@ -1,78 +1,79 @@
package("pdcursesmod") package("pdcursesmod")
set_homepage("https://projectpluto.com/win32a.htm") set_homepage("https://projectpluto.com/win32a.htm")
set_description("PDCurses Modified - a curses library modified and extended from the 'official' pdcurses") set_description("PDCurses Modified - a curses library modified and extended from the 'official' pdcurses")
add_urls("https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/$(version).tar.gz", add_urls("https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/$(version).tar.gz",
"https://github.com/Bill-Gray/PDCursesMod.git") "https://github.com/Bill-Gray/PDCursesMod.git")
add_versions("v4.3.4", "abbd099a51612200d1bfe236d764e0f0748ee71c3a6bc2c4069447d907d55b82") add_versions("v4.4.0", "a53bf776623decb9e4b2c2ffe43e52d83fe4455ffd20229b4ba36c92918f67dd")
add_versions("v4.3.4", "abbd099a51612200d1bfe236d764e0f0748ee71c3a6bc2c4069447d907d55b82")
if not is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) if not is_plat("windows") then
end add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
add_configs("port", {description = "Set the target port.", default = "sdl2", values = {"sdl2", "wincon"}})
add_configs("utf8", {description = "Treat all narrow characters as UTF-8.", default = true, type = "boolean"}) add_configs("port", {description = "Set the target port.", default = "sdl2", values = {"sdl2", "wincon"}})
add_configs("utf8", {description = "Treat all narrow characters as UTF-8.", default = true, type = "boolean"})
if is_plat("windows", "mingw") then
add_syslinks("user32", "advapi32", "winmm") if is_plat("windows", "mingw") then
end add_syslinks("user32", "advapi32", "winmm")
end
on_load(function (package)
if package:config("port") == "sdl2" then on_load(function (package)
package:add("deps", "libsdl") if package:config("port") == "sdl2" then
if package:config("utf8") then package:add("deps", "libsdl")
package:add("deps", "libsdl_ttf") if package:config("utf8") then
end package:add("deps", "libsdl_ttf")
end end
if package:config("utf8") then end
package:add("defines", "PDC_WIDE", "PDC_FORCE_UTF8") if package:config("utf8") then
end package:add("defines", "PDC_WIDE", "PDC_FORCE_UTF8")
if package:config("shared") then end
package:add("defines", "PDC_DLL_BUILD") if package:config("shared") then
end package:add("defines", "PDC_DLL_BUILD")
end) end
end)
on_install("linux", "macosx", "mingw", "windows", function (package)
io.writefile("xmake.lua", [[ on_install("linux", "macosx", "mingw", "windows", function (package)
add_rules("mode.debug", "mode.release") io.writefile("xmake.lua", [[
option("port", {description = "Set the target port."}) add_rules("mode.debug", "mode.release")
option("utf8", {description = "Treat all narrow characters as UTF-8."}) option("port", {description = "Set the target port."})
add_defines("PDC_WIDE", "PDC_FORCE_UTF8") option("utf8", {description = "Treat all narrow characters as UTF-8."})
if is_config("port", "sdl2") then add_defines("PDC_WIDE", "PDC_FORCE_UTF8")
add_requires("libsdl") if is_config("port", "sdl2") then
if has_config("utf8") then add_requires("libsdl")
add_requires("libsdl_ttf") if has_config("utf8") then
end add_requires("libsdl_ttf")
end end
target("pdcursesmod") end
set_kind("$(kind)") target("pdcursesmod")
add_files("pdcurses/*.c", "$(port)/*.c") set_kind("$(kind)")
add_includedirs(".", "$(port)") add_files("pdcurses/*.c", "$(port)/*.c")
add_headerfiles("*.h", "$(port)/*.h") add_includedirs(".", "$(port)")
if is_kind("shared") then add_headerfiles("*.h", "$(port)/*.h")
add_defines("PDC_DLL_BUILD") if is_kind("shared") then
end add_defines("PDC_DLL_BUILD")
add_packages("libsdl", "libsdl_ttf") end
if is_plat("windows", "mingw") then add_packages("libsdl", "libsdl_ttf")
add_syslinks("user32", "advapi32", "winmm") if is_plat("windows", "mingw") then
end add_syslinks("user32", "advapi32", "winmm")
]]) end
local configs = {} ]])
if package:config("shared") then local configs = {}
configs.kind = "shared" if package:config("shared") then
end configs.kind = "shared"
configs.port = package:config("port") end
configs.utf8 = package:config("utf8") configs.port = package:config("port")
import("package.tools.xmake").install(package, configs) configs.utf8 = package:config("utf8")
end) import("package.tools.xmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_csnippets([[ on_test(function (package)
void test(void) { assert(package:check_csnippets([[
initscr(); void test(void) {
printw("Hello, world!"); initscr();
refresh(); printw("Hello, world!");
endwin(); refresh();
} endwin();
]], {includes = "curses.h"})) }
end) ]], {includes = "curses.h"}))
end)

Loading…
Cancel
Save