Skip to content

Commit

Permalink
yy-thunks: update to 1.1.5 version (#5730)
Browse files Browse the repository at this point in the history
* yy-thunks: update to 1.1.4 version

* add version limit

* Add 1.1.5 version

* Add TODO
  • Loading branch information
star-hengxing authored Feb 6, 2025
1 parent 26276a2 commit 5820957
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
18 changes: 14 additions & 4 deletions packages/y/yy-thunks/rules/link.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
-- TODO:
-- YY_Thunks_for_Win8.obj
-- YY_Thunks_for_Win10.0.10240.obj
-- YY_Thunks_for_Win10.0.19041.obj

rule("xp")
on_config(function (target)
local objectfile = "YY_Thunks_for_WinXP.obj"
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 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)

Expand All @@ -14,21 +24,21 @@ 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)

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"
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)

Expand Down
19 changes: 14 additions & 5 deletions packages/y/yy-thunks/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@ 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.5", "e6e2bb6e6b46f8b2b4af4cff2b2b754b123837a3c72f1cd5d7a5bfdf3c0df82a")
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")
add_configs("debug", {description = "Enable debug symbols.", default = false, readonly = true})
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})

set_policy("package.precompiled", false)

on_install("windows|x64", "windows|x86", 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

if package:is_arch("x64") then
os.cp("objs/x64/*.obj", package:installdir("lib"))
os.mv("objs/x64/*.obj", package:installdir("lib"))
elseif package:is_arch("x86") then
os.cp("objs/x86/*.obj", package:installdir("lib"))
os.mv("objs/x86/*.obj", package:installdir("lib"))
else
raise("Unsupported architecture!")
end
os.trymv("YY.Depends.Analyzer.exe", package:installdir("bin"))
end)

on_test(function (package)
Expand Down

0 comments on commit 5820957

Please sign in to comment.