From 384db22e3c1c8de46af0568f86c1efe8c701c36a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 13 Apr 2024 17:04:38 +0800 Subject: [PATCH] Auto-update libpsl to 0.21.5 (#3482) * Update libpsl to 0.21.5 * Update xmake.lua --------- Co-authored-by: star9029 --- packages/l/libpsl/xmake.lua | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/l/libpsl/xmake.lua b/packages/l/libpsl/xmake.lua index 903df0201..7a6727a03 100644 --- a/packages/l/libpsl/xmake.lua +++ b/packages/l/libpsl/xmake.lua @@ -1,16 +1,20 @@ package("libpsl") - set_homepage("https://github.com/rockdaboot/libpsl") set_description("C library to handle the Public Suffix List") set_license("MIT") - add_urls("https://github.com/rockdaboot/libpsl/releases/download/$(version)/libpsl-$(version).tar.gz") + add_urls("https://github.com/rockdaboot/libpsl/releases/download/$(version)/libpsl-$(version).tar.gz", + "https://github.com/rockdaboot/libpsl.git") + + add_versions("0.21.5", "1dcc9ceae8b128f3c0b3f654decd0e1e891afc6ff81098f227ef260449dae208") add_versions("0.21.1", "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c") - add_deps("meson", "ninja") if is_plat("windows", "mingw") then add_syslinks("ws2_32") end + + add_deps("meson", "ninja") + on_load("windows", function (package) if not package:config("shared") then package:add("defines", "PSL_STATIC") @@ -18,12 +22,19 @@ package("libpsl") end) on_install("windows", "macosx", "linux", "mingw", function (package) - io.replace("meson.build", "subdir('tests')", "", {plain = true}) - io.replace("meson.build", "subdir('fuzz')", "", {plain = true}) - if package:is_plat("windows") and not package:config("shared") then - io.replace("tools/meson.build", "'-DHAVE_CONFIG_H'", "'-DHAVE_CONFIG_H','-DPSL_STATIC'", {plain = true}) + local configs = {"-Druntime=no"} + if package:version():ge("0.21.5") then + table.insert(configs, "-Dbuiltin=false") + table.insert(configs, "-Dtests=false") + else + io.replace("meson.build", "subdir('tests')", "", {plain = true}) + io.replace("meson.build", "subdir('fuzz')", "", {plain = true}) + if package:is_plat("windows") and not package:config("shared") then + io.replace("tools/meson.build", "'-DHAVE_CONFIG_H'", "'-DHAVE_CONFIG_H','-DPSL_STATIC'", {plain = true}) + end + table.insert(configs, "-Dbuiltin=no") end - local configs = {"-Druntime=no", "-Dbuiltin=no"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) import("package.tools.meson").install(package, configs) end)