Skip to content

Commit ee53d1f

Browse files
committed
improve unicorn
1 parent e0fa068 commit ee53d1f

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

packages/p/python/xmake.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ package("python")
9797
os.cp("libs/*", package:installdir("lib"))
9898
os.cp("*", package:installdir())
9999
local python = path.join(package:installdir("bin"), "python.exe")
100-
os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"})
100+
if package:version():eq("3.9.10") then
101+
-- https://github.com/xmake-io/xmake-repo/issues/1013
102+
os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip=21.3.1"})
103+
else
104+
os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"})
105+
end
101106
os.vrunv(python, {"-m", "pip", "install", "wheel"})
102107
end)
103108

packages/u/unicorn/xmake.lua

+25-1
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,39 @@ package("unicorn")
88
add_deps("cmake")
99
add_deps("glib")
1010

11-
add_links("unicorn", "unicorn-common", "aarch64-softmmu", "sparc-softmmu", "riscv64-softmmu", "arm-softmmu", "m68k-softmmu", "x86_64-softmmu", "s390x-softmmu", "mips64-softmmu", "sparc64-softmmu", "ppc-softmmu", "ppc64-softmmu", "mipsel-softmmu", "riscv32-softmmu", "mips-softmmu", "mips64el-softmmu")
11+
local archs = {"aarch64", "sparc", "sparc", "riscv64", "arm", "m68k",
12+
"x86_64", "s390x", "mips64", "sparc64", "ppc", "ppc64",
13+
"mipsel", "riscv32", "mips", "mips64el"}
14+
add_configs("arch", {description = "Select unicorn architecture for softmmu.", default = "aarch64", values = archs})
15+
16+
on_load(function (package)
17+
package:add("links", "unicorn")
18+
package:add("links", package:config("arch") .. "-softmmu")
19+
package:add("links", "unicorn-common")
20+
end)
1221

1322
on_install("windows", "macosx", "linux", function (package)
1423
local configs = {
1524
"-DUNICORN_BUILD_TESTS=OFF",
1625
"-DUNICORN_STATIC_MSVCRT=OFF"}
26+
local arch = package:config("arch")
27+
if arch == "x86_64" then
28+
table.insert(configs, "-DUNICORN_ARCH=x86")
29+
elseif arch:startswith("riscv") then
30+
table.insert(configs, "-DUNICORN_ARCH=riscv")
31+
elseif arch:startswith("mips") then
32+
table.insert(configs, "-DUNICORN_ARCH=mips")
33+
elseif arch:startswith("ppc") then
34+
table.insert(configs, "-DUNICORN_ARCH=ppc")
35+
else
36+
table.insert(configs, "-DUNICORN_ARCH=" .. arch)
37+
end
1738
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
1839
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
1940
import("package.tools.cmake").install(package, configs, {buildir = "build"})
41+
if package:is_plat("windows") then
42+
os.cp("include", package:installdir())
43+
end
2044
os.trycp("build/*.a", package:installdir("lib"))
2145
os.trycp("build/*.lib", package:installdir("lib"))
2246
os.trycp("build/*.dylib", package:installdir("lib"))

0 commit comments

Comments
 (0)