diff --git a/packages/p/python/xmake.lua b/packages/p/python/xmake.lua index 1b66f843869..f98c4c78dc6 100644 --- a/packages/p/python/xmake.lua +++ b/packages/p/python/xmake.lua @@ -97,7 +97,12 @@ package("python") os.cp("libs/*", package:installdir("lib")) os.cp("*", package:installdir()) local python = path.join(package:installdir("bin"), "python.exe") - os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"}) + if package:version():eq("3.9.10") then + -- https://github.com/xmake-io/xmake-repo/issues/1013 + os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip=21.3.1"}) + else + os.vrunv(python, {"-m", "pip", "install", "--upgrade", "--force-reinstall", "pip"}) + end os.vrunv(python, {"-m", "pip", "install", "wheel"}) end) diff --git a/packages/u/unicorn/xmake.lua b/packages/u/unicorn/xmake.lua index 16d5a7c1141..715632b2307 100644 --- a/packages/u/unicorn/xmake.lua +++ b/packages/u/unicorn/xmake.lua @@ -8,15 +8,39 @@ package("unicorn") add_deps("cmake") add_deps("glib") - 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") + local archs = {"aarch64", "sparc", "sparc", "riscv64", "arm", "m68k", + "x86_64", "s390x", "mips64", "sparc64", "ppc", "ppc64", + "mipsel", "riscv32", "mips", "mips64el"} + add_configs("arch", {description = "Select unicorn architecture for softmmu.", default = "aarch64", values = archs}) + + on_load(function (package) + package:add("links", "unicorn") + package:add("links", package:config("arch") .. "-softmmu") + package:add("links", "unicorn-common") + end) on_install("windows", "macosx", "linux", function (package) local configs = { "-DUNICORN_BUILD_TESTS=OFF", "-DUNICORN_STATIC_MSVCRT=OFF"} + local arch = package:config("arch") + if arch == "x86_64" then + table.insert(configs, "-DUNICORN_ARCH=x86") + elseif arch:startswith("riscv") then + table.insert(configs, "-DUNICORN_ARCH=riscv") + elseif arch:startswith("mips") then + table.insert(configs, "-DUNICORN_ARCH=mips") + elseif arch:startswith("ppc") then + table.insert(configs, "-DUNICORN_ARCH=ppc") + else + table.insert(configs, "-DUNICORN_ARCH=" .. arch) + end table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package: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, {buildir = "build"}) + if package:is_plat("windows") then + os.cp("include", package:installdir()) + end os.trycp("build/*.a", package:installdir("lib")) os.trycp("build/*.lib", package:installdir("lib")) os.trycp("build/*.dylib", package:installdir("lib"))