diff --git a/packages/m/mimalloc/xmake.lua b/packages/m/mimalloc/xmake.lua index 33a7d479b..df188ffd4 100644 --- a/packages/m/mimalloc/xmake.lua +++ b/packages/m/mimalloc/xmake.lua @@ -5,6 +5,7 @@ package("mimalloc") set_license("MIT") set_urls("https://github.com/microsoft/mimalloc/archive/v$(version).zip") + add_versions("2.1.7", "fa61cf01e3dd869b35275bfd8be95bfde77f0b65dfa7e34012c09a66e1ea463f") add_versions("2.1.2", "86281c918921c1007945a8a31e5ad6ae9af77e510abfec20d000dd05d15123c7") add_versions("2.0.7", "ddb32937aabddedd0d3a57bf68158d4e53ecf9e051618df3331a67182b8b0508") add_versions("2.0.6", "23e7443d0b4d7aa945779ea8a806e4e109c0ed62d740953d3656cddea7e04cf8") @@ -13,6 +14,7 @@ package("mimalloc") add_versions("2.0.2", "6ccba822e251b8d10f8a63d5d7767bc0cbfae689756a4047cdf3d1e4a9fd33d0") add_versions("2.0.1", "59c1fe79933e0ac9837a9ca4d954e4887dccd80a84281a6f849681b89a8b8876") + add_versions("1.8.7", "c37c099244f1096c40fca6ca9d2d456bb22efb99d64d34a26e39e3291a774ed9") add_versions("1.7.7", "d51a5b8f3bc6800a0b2fc46830ce67b4d31b12f4e4550ff80cf394d5a88fead8") add_versions("1.7.6", "bae56f8ebdcd43da83b52610d7f1c1602ea8d3798d906825defa5c40ad2eb560") add_versions("1.7.3", "8319eca4a114dce5f897a4cb7d945bce22d915b4b262adb861cd7ac68fa3e848") @@ -26,7 +28,7 @@ package("mimalloc") if is_plat("windows") then add_configs("etw", {description = "Enable Event tracing for Windows", default = false, type = "boolean"}) end - + add_deps("cmake") if is_plat("windows") then @@ -79,6 +81,10 @@ package("mimalloc") elseif package:is_plat("mingw") then os.trycp("build/**.dll", package:installdir("bin")) os.trycp("build/**.a", package:installdir("lib")) + elseif package:is_plat("macosx") then + os.trycp("build/*.dylib", package:installdir("bin")) + os.trycp("build/*.dylib", package:installdir("lib")) + os.trycp("build/*.a", package:installdir("lib")) else os.trycp("build/*.so", package:installdir("bin")) os.trycp("build/*.so", package:installdir("lib")) diff --git a/scripts/test.lua b/scripts/test.lua index 71c2019bc..76d2d90aa 100644 --- a/scripts/test.lua +++ b/scripts/test.lua @@ -216,6 +216,32 @@ function _package_is_supported(argv, packagename) end end +function get_modified_packages() + local packages = {} + local diff = os.iorun("git --no-pager diff HEAD^") + for _, line in ipairs(diff:split("\n")) do + if line:startswith("+++ b/") then + local file = line:sub(7) + if file:startswith("packages") then + assert(file == file:lower(), "%s must be lower case!", file) + local package = file:match("packages/%w/(%S-)/") + table.insert(packages, package) + end + elseif line:startswith("+") and line:find("add_versions") then + local version = line:match("add_versions%(\"(.-)\"") + if #packages > 0 and version then + local lastpackage = packages[#packages] + local splitinfo = lastpackage:split("%s+") + if #splitinfo == 1 then + table.remove(packages) + end + table.insert(packages, splitinfo[1] .. " " .. version) + end + end + end + return packages +end + -- the main entry function main(...) @@ -225,14 +251,7 @@ function main(...) -- get packages local packages = argv.packages or {} if #packages == 0 then - local files = os.iorun("git diff --name-only HEAD^") - for _, file in ipairs(files:split('\n'), string.trim) do - if file:startswith("packages") then - assert(file == file:lower(), "%s must be lower case!", file) - local package = file:match("packages/%w/(%S-)/") - table.insert(packages, package) - end - end + packages = get_modified_packages() end if #packages == 0 then table.insert(packages, "tbox dev")