diff options
| author | ruki <[email protected]> | 2023-11-22 00:48:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-22 00:48:56 +0800 |
| commit | 8c8f130f69343bbb50dafa718a8fe6df63497974 (patch) | |
| tree | 0c5831419ce91e09f934ec1390a31c59091f2305 /xmake/plugins | |
| parent | 574d9bca0e5d7a01fdf2500ac83c75f5927bb69d (diff) | |
add title
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 10 | ||||
| -rw-r--r-- | xmake/plugins/pack/xpack_component.lua | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index 854bc46e7..29e4c6a55 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -195,7 +195,6 @@ function _get_specvars(package) specvars.PACKAGE_UNINSTALLCMDS = function () return _get_uninstallcmds(package) end - specvars.PACKAGE_NSIS_DISPLAY_NAME = _get_filter_value(package, "nsis_displayname") or package:name() specvars.PACKAGE_NSIS_DISPLAY_ICON = function () local iconpath = _get_filter_value(package, "nsis_displayicon") if iconpath then @@ -206,6 +205,7 @@ function _get_specvars(package) end return _translate_filepath(package, iconpath) end + --[[ specvars.PACKAGE_NSIS_INSTALL_SECTIONS = function () local result = {} local cmds = package:get("nsis_installcmds") @@ -235,7 +235,7 @@ function _get_specvars(package) table.insert(result, string.format('!insertmacro MUI_DESCRIPTION_TEXT ${%s} $(DESC_%s)', tag, tag)) end return table.concat(result, "\n ") - end + end]] return specvars end diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index 79acbb16a..bd687d39c 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -69,6 +69,15 @@ function xpack:license() return self:get("license") end +-- get the package title +function xpack:title() + local title = self:get("title") + if title == nil then + title = self:name() + end + return filter.handle(title, self) +end + -- get the package description function xpack:description() return self:get("description") @@ -251,6 +260,7 @@ function xpack:specvars() PACKAGE_ARCH = self:arch(), PACKAGE_PLAT = self:plat(), PACKAGE_NAME = self:name(), + PACKAGE_TITLE = self:title() or "", PACKAGE_DESCRIPTION = self:description() or "", PACKAGE_FILENAME = self:filename(), PACKAGE_HOMEPAGE = self:get("homepage") or "", diff --git a/xmake/plugins/pack/xpack_component.lua b/xmake/plugins/pack/xpack_component.lua index 62e8a1efe..bb274d08a 100644 --- a/xmake/plugins/pack/xpack_component.lua +++ b/xmake/plugins/pack/xpack_component.lua @@ -60,6 +60,11 @@ function xpack_component:extraconf(name, item, key) end end +-- get the component title +function xpack_component:title() + return self:get("title") or self:name() +end + -- get the component description function xpack_component:description() return self:get("description") |
