Skip to content

Commit

Permalink
add deb pack stub
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jun 12, 2024
1 parent 48c0ae3 commit 2a1d36c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/plugins/pack/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
53 changes: 53 additions & 0 deletions xmake/plugins/pack/deb/main.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2a1d36c

Please sign in to comment.