diff options
| author | ruki <[email protected]> | 2024-06-12 23:43:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-06-12 23:24:25 +0800 |
| commit | 2a1d36cd43e3719b34843316e4afd823eb9761d5 (patch) | |
| tree | 7978017d3a9f29431bf2a7e459e15bd4a3827653 | |
| parent | 48c0ae382d6a424f5f538d9180e913f903356325 (diff) | |
add deb pack stub
| -rw-r--r-- | tests/plugins/pack/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/pack/deb/main.lua | 53 |
2 files changed, 54 insertions, 1 deletions
diff --git a/tests/plugins/pack/xmake.lua b/tests/plugins/pack/xmake.lua index 437ae8a37..e5a83d8f1 100644 --- a/tests/plugins/pack/xmake.lua +++ b/tests/plugins/pack/xmake.lua @@ -19,7 +19,7 @@ target("foo") add_packages("zlib") xpack("test") - set_formats("nsis", "srpm", "rpm", "zip", "targz", "srczip", "srctargz", "runself", "wix") + set_formats("nsis", "srpm", "rpm", "deb", "zip", "targz", "srczip", "srctargz", "runself", "wix") set_title("hello") set_author("ruki") set_description("A test installer.") diff --git a/xmake/plugins/pack/deb/main.lua b/xmake/plugins/pack/deb/main.lua new file mode 100644 index 000000000..b2629ef04 --- /dev/null +++ b/xmake/plugins/pack/deb/main.lua @@ -0,0 +1,53 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, TBOOX Open Source Group. +-- +-- @author ruki +-- @file main.lua +-- + +-- imports +import("core.base.option") +import("core.base.semver") +import("core.base.hashset") +import("lib.detect.find_tool") +import("lib.detect.find_file") +import("utils.archive") +import(".batchcmds") + +-- get the debuild +function _get_debuild() + local debuild = find_tool("debuild", {force = true}) + assert(debuild, "debuild not found!") + return debuild +end + +-- pack deb package +function _pack_deb(debuild, package) +end + +function main(package) + if not is_host("linux") then + return + end + + cprint("packing %s", package:outputfile()) + + -- get debuild + local debuild = _get_debuild() + + -- pack deb package + _pack_deb(debuild.program, package) +end |
