仓库依赖包定义描述,package()相关接口定义,等有时间会详细说明,敬请期待。。

    可先参考官方仓库中现有包描述:xmake-repo

    这里给个比较具有代表性的实例供参考:

    1. package("libxml2")
    2. set_homepage("http://xmlsoft.org/")
    3. set_description("The XML C parser and toolkit of Gnome.")
    4. set_urls("https://github.com/GNOME/libxml2/archive/$(version).zip", {excludes = {"*/result/*", "*/test/*"}})
    5. add_versions("v2.9.8", "c87793e45e66a7aa19200f861873f75195065de786a21c1b469bdb7bfc1230fb")
    6. add_versions("v2.9.7", "31dd4c0e10fa625b47e27fd6a5295d246c883f214da947b9a4a9e13733905ed9")
    7. if is_plat("macosx", "linux") then
    8. add_deps("autoconf", "automake", "libtool", "pkg-config")
    9. end
    10. on_load(function (package)
    11. package:addvar("includedirs", "include/libxml2")
    12. package:addvar("links", "xml2")
    13. end)
    14. if is_plat("windows") and winos.version():gt("winxp") then
    15. on_install("windows", function (package)
    16. os.cd("win32")
    17. os.vrun("cscript configure.js iso8859x=yes iconv=no compiler=msvc cruntime=/MT debug=%s prefix=\"%s\"", package:debug() and "yes" or "no", package:installdir())
    18. os.vrun("nmake /f Makefile.msvc")
    19. os.vrun("nmake /f Makefile.msvc install")
    20. end)
    21. end
    22. on_install("macosx", "linux", function (package)
    23. import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--without-python", "--without-lzma"})
    24. end)