Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/z/zix/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package("zix")
set_description("A lightweight C99 portability and data structure library")
set_license("0BSD", "ISC")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

set_license should ideally be a single string following the SPDX expression format (e.g., "0BSD OR ISC" or "0BSD AND ISC"). Passing multiple arguments may result in only the first license being correctly recognized by the package manager metadata parser.

    set_license("0BSD OR ISC")


add_urls("https://gitlab.com/drobilla/zix/-/archive/v$(version)/zix-v$(version).tar.gz",
"https://gitlab.com/drobilla/zix.git")

add_versions("0.8.0", "51d70d63e970214db84e32d55377d84090c02145f5768265ab140d117f2b8e24")

add_deps("meson", "ninja")

on_install(function (package)
local configs = {
"-Dbenchmarks=disabled",
"-Ddocs=disabled",
"-Dtests=disabled",
"-Dtests_cpp=disabled",
}
import("package.tools.meson").install(package, configs)
package:add("includedirs", path.join("include", "zix-0"))
if not package:config("shared") then
package:add("defines", "ZIX_STATIC")
end

end)
Comment on lines +19 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The on_install block contains inconsistent indentation, mixing tabs and spaces. Additionally, it is more idiomatic in xmake-repo to place exported configurations like includedirs and defines in an on_load block. This ensures that the package metadata is correctly configured regardless of the installation state (e.g., when the package is already cached).

    on_load(function (package)
        package:add("includedirs", "include/zix-0")
        if not package:config("shared") then
            package:add("defines", "ZIX_STATIC")
        end
    end)

    on_install(function (package)
        local configs = {
            "-Dbenchmarks=disabled",
            "-Ddocs=disabled",
            "-Dtests=disabled",
            "-Dtests_cpp=disabled",
        }
        import("package.tools.meson").install(package, configs)
    end)


on_test(function (package)
assert(package:has_cfuncs("zix_strerror", {includes = "zix/status.h"}))
end)