Skip to content
Open
Changes from all commits
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
31 changes: 31 additions & 0 deletions packages/z/zix/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package("zix")
set_description("A lightweight C99 portability and data structure library")
set_license("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_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)
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)
Loading