From 64ac60ded82051c8e91260a06e3dcbc3ef5403c1 Mon Sep 17 00:00:00 2001 From: star9029 Date: Mon, 11 Nov 2024 16:48:22 +0800 Subject: [PATCH 1/2] yy-thunks: update to 1.1.4 version --- packages/y/yy-thunks/rules/link.lua | 7 +++++-- packages/y/yy-thunks/xmake.lua | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/y/yy-thunks/rules/link.lua b/packages/y/yy-thunks/rules/link.lua index 2d4be0012d6..a276a612f05 100644 --- a/packages/y/yy-thunks/rules/link.lua +++ b/packages/y/yy-thunks/rules/link.lua @@ -4,7 +4,10 @@ rule("xp") local thunks = target:pkg("yy-thunks") if thunks then local installdir = thunks:installdir() - table.insert(target:objectfiles(), path.join(installdir, "lib", objectfile)) + table.insert(target:objectfiles(), 1, path.join(installdir, "lib", objectfile)) + if target:is_shared() then + target:add("shflags", "/entry:DllMainCRTStartupForYY_Thunks", {tools = "link", force = true}) + end end end) @@ -21,7 +24,7 @@ rule("vista") rule("2k") on_config(function (target) if not target:is_arch("x86") then - raise("Win2K only supports x86 architecture") + wprint("Win2K only supports x86 architecture") end local objectfile = "YY_Thunks_for_Win2K.obj" diff --git a/packages/y/yy-thunks/xmake.lua b/packages/y/yy-thunks/xmake.lua index 3111c698962..da515c0e59d 100644 --- a/packages/y/yy-thunks/xmake.lua +++ b/packages/y/yy-thunks/xmake.lua @@ -3,15 +3,17 @@ package("yy-thunks") set_description("Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.") set_license("MIT") + add_urls("https://github.com/Chuyu-Team/YY-Thunks/releases/download/v$(version)/YY-Thunks-$(version)-Objs.zip") add_urls("https://github.com/Chuyu-Team/YY-Thunks/releases/download/v$(version)/YY-Thunks-$(version)-Binary.zip") + + add_versions("1.1.4", "f9850a35d1f2b0cae15e64da516de0ec5e798c060b320e91788aa33b853e85ba") + add_versions("1.1.1", "fe79e309aa42a58794609e06382632a0b768a1193a6bb5aad0bddd4264712aba") add_versions("1.0.9", "216b88757f28075d3d8c0363139e870d49ba84458fc10a0f094f264ebf0a302c") add_versions("1.0.7", "3607a79ac37f141cbcbf00aaea8d82a4c2628d81d8dad9e2a4dce4c8c17a025b") - on_install("windows|x64", "windows|x86", function (package) - import("core.tool.toolchain") - + on_install("windows|x64", "windows|x86", "mingw", "msys", function (package) -- check vs version - local vs = toolchain.load("msvc"):config("vs") + local vs = package:toolchain("msvc"):config("vs") if vs and tonumber(vs) < 2005 then raise("YY-Thunks only supports VS2008 or later versions") end @@ -23,6 +25,7 @@ package("yy-thunks") else raise("Unsupported architecture!") end + os.trycp("YY.Depends.Analyzer.exe", package:installdir("bin")) end) on_test(function (package) From 79a98dedc30005c4d405782cf9666794698c8cf1 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 12 Nov 2024 20:35:43 +0800 Subject: [PATCH 2/2] add version limit --- packages/y/yy-thunks/rules/link.lua | 10 ++++++---- packages/y/yy-thunks/xmake.lua | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/y/yy-thunks/rules/link.lua b/packages/y/yy-thunks/rules/link.lua index a276a612f05..cce1d4d9fe8 100644 --- a/packages/y/yy-thunks/rules/link.lua +++ b/packages/y/yy-thunks/rules/link.lua @@ -5,8 +5,10 @@ rule("xp") if thunks then local installdir = thunks:installdir() table.insert(target:objectfiles(), 1, path.join(installdir, "lib", objectfile)) - if target:is_shared() then - target:add("shflags", "/entry:DllMainCRTStartupForYY_Thunks", {tools = "link", force = true}) + if thunks:version():ge("1.1") then + if target:is_shared() then + target:add("shflags", "/entry:DllMainCRTStartupForYY_Thunks", {tools = "link", force = true}) + end end end end) @@ -17,7 +19,7 @@ rule("vista") local thunks = target:pkg("yy-thunks") if thunks then local installdir = thunks:installdir() - table.insert(target:objectfiles(), path.join(installdir, "lib", objectfile)) + table.insert(target:objectfiles(), 1, path.join(installdir, "lib", objectfile)) end end) @@ -31,7 +33,7 @@ rule("2k") local thunks = target:pkg("yy-thunks") if thunks then local installdir = thunks:installdir() - table.insert(target:objectfiles(), path.join(installdir, "lib", objectfile)) + table.insert(target:objectfiles(), 1, path.join(installdir, "lib", objectfile)) end end) diff --git a/packages/y/yy-thunks/xmake.lua b/packages/y/yy-thunks/xmake.lua index da515c0e59d..93ca2a711ca 100644 --- a/packages/y/yy-thunks/xmake.lua +++ b/packages/y/yy-thunks/xmake.lua @@ -11,7 +11,7 @@ package("yy-thunks") add_versions("1.0.9", "216b88757f28075d3d8c0363139e870d49ba84458fc10a0f094f264ebf0a302c") add_versions("1.0.7", "3607a79ac37f141cbcbf00aaea8d82a4c2628d81d8dad9e2a4dce4c8c17a025b") - on_install("windows|x64", "windows|x86", "mingw", "msys", function (package) + on_install("windows|x64", "windows|x86", function (package) -- check vs version local vs = package:toolchain("msvc"):config("vs") if vs and tonumber(vs) < 2005 then