From bddf3a4d3f49190b0850129044d1dae44872e32a Mon Sep 17 00:00:00 2001 From: Peter Richmond Date: Thu, 8 Aug 2024 17:32:15 +0100 Subject: [PATCH 1/2] add squirrel lang --- packages/s/squirrel/xmake.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/s/squirrel/xmake.lua diff --git a/packages/s/squirrel/xmake.lua b/packages/s/squirrel/xmake.lua new file mode 100644 index 00000000000..17261d94db4 --- /dev/null +++ b/packages/s/squirrel/xmake.lua @@ -0,0 +1,22 @@ +package("squirrel") + set_homepage("http://www.squirrel-lang.org") + set_description("Official repository for the programming language Squirrel") + set_license("MIT") + + add_urls("https://github.com/albertodemichelis/squirrel/archive/refs/tags/$(version).tar.gz", + "https://github.com/albertodemichelis/squirrel.git") + + add_versions("v3.2", "02805414cfadd5bbb921891d3599b83375a40650abd6404a8ab407dc5e86a996") + + add_deps("cmake") + + on_install(function (package) + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("sq_open", {includes = "squirrel.h"})) + end) From 4fa3b9c3a7c115b01eebd3997432a21a4f0d9a7a Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 11 Aug 2024 07:21:25 +0800 Subject: [PATCH 2/2] add patch & fix shared/static --- packages/s/squirrel/xmake.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/s/squirrel/xmake.lua b/packages/s/squirrel/xmake.lua index 17261d94db4..26a69090cb6 100644 --- a/packages/s/squirrel/xmake.lua +++ b/packages/s/squirrel/xmake.lua @@ -8,12 +8,19 @@ package("squirrel") add_versions("v3.2", "02805414cfadd5bbb921891d3599b83375a40650abd6404a8ab407dc5e86a996") + add_patches("3.2", "https://github.com/albertodemichelis/squirrel/commit/79711c69e2c4193b4b6f98c9162856d61ddaeb9f.patch", "908ef342bda194216d4d2c08f0ecdbd1518e368ef3b6ccdc15e3593c5b7725c2") + add_deps("cmake") - on_install(function (package) + on_install("!wasm and !iphoneos", function (package) local configs = {} table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + if package:config("shared") then + table.join2(configs, {"-DDISABLE_STATIC=ON", "-DDISABLE_DYNAMIC=OFF"}) + else + table.join2(configs, {"-DDISABLE_STATIC=OFF", "-DDISABLE_DYNAMIC=ON"}) + end import("package.tools.cmake").install(package, configs) end)