diff options
| author | ruki <[email protected]> | 2021-06-02 23:16:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-02 23:16:24 +0800 |
| commit | 76a7ac04e4a1a07347fd1fb6bc43374e2ff88dc6 (patch) | |
| tree | 5144d821fdca1f3df22c477a2bc48263a4b9311a /xmake/actions/package/remote/main.lua | |
| parent | 50a79cc6fcece9b826d60ccd54998176df5db43e (diff) | |
add more package options
Diffstat (limited to 'xmake/actions/package/remote/main.lua')
| -rw-r--r-- | xmake/actions/package/remote/main.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/xmake/actions/package/remote/main.lua b/xmake/actions/package/remote/main.lua index 3d46d10ba..6b108e60e 100644 --- a/xmake/actions/package/remote/main.lua +++ b/xmake/actions/package/remote/main.lua @@ -49,7 +49,12 @@ function _package_remote(target) if target:is_binary() then file:print(" set_kind(\"binary\")") end - file:print(" set_description(\"%s\")", "The " .. packagename .. " package") + local homepage = option.get("homepage") + if homepage then + file:print(" set_homepage(\"%s\")", homepage) + end + local description = option.get("description") or ("The " .. packagename .. " package") + file:print(" set_description(\"%s\")", description) if target:license() then file:print(" set_license(\"%s\")", target:license()) end @@ -57,10 +62,13 @@ function _package_remote(target) file:print(" set_deps(\"%s\")", table.concat(deps, "\", \"")) end file:print("") + local url = option.get("url") or "https://github.com/myrepo/foo.git" + local version = option.get("version") or target:version() and (target:version()) or "1.0" + local shasum = option.get("shasum") or "<shasum256 or gitcommit>" + file:print(" add_urls(\"%s\")", url) + file:print(" add_versions(\"%s\", \"%s\")", version, shasum) + file:print("") file:print([[ - add_urls("https://github.com/myrepo/foo.git") - add_versions("%s", "<shasum256 or gitcommit>") - on_install(function (package) local configs = {} if package:config("shared") then @@ -72,7 +80,7 @@ function _package_remote(target) on_test(function (package) -- TODO check includes and interfaces -- assert(package:has_cfuncs("foo", {includes = "foo.h"}) - end)]], target:version() and (target:version()) or "1.0") + end)]]) file:close() end |
