|
@@ -6,15 +6,28 @@ package("python")
|
|
|
|
|
|
if is_host("windows") then
|
|
|
if os.arch() == "x64" then
|
|
|
- add_urls("https://www.python.org/ftp/python/$(version)/python-$(version).amd64.msi", {alias = "py2"})
|
|
|
- add_urls("https://www.python.org/ftp/python/$(version)/python-$(version)-embed-amd64.zip", {alias = "py3"})
|
|
|
- add_versions("py2:2.7.15", "5e85f3c4c209de98480acbf2ba2e71a907fd5567a838ad4b6748c76deb286ad7")
|
|
|
- add_versions("py3:3.7.0", "0cc08f3c74c0112abc2adafd16a534cde12fe7c7aafb42e936d59fd3ab08fcdb")
|
|
|
+ add_urls("https://gitlab.com/xmake-mirror/python-releases/raw/master/python-$(version).arm64.zip", {alias = "py2"})
|
|
|
+ add_versions("py2:2.7.15", "b9d8157fe2ca58f84d29a814bedf1d304d2277ad02f0930acd22e2ce7367b77e")
|
|
|
else
|
|
|
- add_urls("https://www.python.org/ftp/python/$(version)/python-$(version).msi", {alias = "py2"})
|
|
|
- add_urls("https://www.python.org/ftp/python/$(version)/python-$(version)-embed-win32.zip", {alias = "py3"})
|
|
|
- add_versions("py2:2.7.15", "1afa1b10cf491c788baa340066a813d5ec6232561472cfc3af1664dbc6f29f77")
|
|
|
- add_versions("py3:3.7.0", "9596b23a8db1f945c2e26fe0dc1743e33f3700b4b708c68ea202cf2ac761a736")
|
|
|
+ add_urls("https://gitlab.com/xmake-mirror/python-releases/raw/master/python-$(version).win32.zip", {alias = "py2"})
|
|
|
+ add_versions("py2:2.7.15", "f34e2555c4fde5d7d746e6a0bbfc9151435f3f5c3eaddfc046ec0993b7cc9660")
|
|
|
+ end
|
|
|
+ if winos.version():gt("winxp") then
|
|
|
+ if os.arch() == "x64" then
|
|
|
+ add_urls("https://www.python.org/ftp/python/$(version)/python-$(version)-embed-amd64.zip", {alias = "py3"})
|
|
|
+ add_versions("py3:3.7.0", "0cc08f3c74c0112abc2adafd16a534cde12fe7c7aafb42e936d59fd3ab08fcdb")
|
|
|
+ else
|
|
|
+ add_urls("https://www.python.org/ftp/python/$(version)/python-$(version)-embed-win32.zip", {alias = "py3"})
|
|
|
+ add_versions("py3:3.7.0", "9596b23a8db1f945c2e26fe0dc1743e33f3700b4b708c68ea202cf2ac761a736")
|
|
|
+ end
|
|
|
+ else
|
|
|
+ if os.arch() == "x64" then
|
|
|
+ add_urls("https://gitlab.com/xmake-mirror/python-releases/raw/master/python-$(version).arm64.zip", {alias = "py3"})
|
|
|
+ add_versions("py3:3.3.4", "a83bf90b28f8b44b99c3524a34ab18f21a59999e07c107da19b031869fb42af1")
|
|
|
+ else
|
|
|
+ add_urls("https://gitlab.com/xmake-mirror/python-releases/raw/master/python-$(version).win32.zip", {alias = "py3"})
|
|
|
+ add_versions("py3:3.3.4", "c9843d585e30da1c7c85663543b2f6a1f68621e02d288abc5b5e54361d93ccd6")
|
|
|
+ end
|
|
|
end
|
|
|
else
|
|
|
set_urls("https://www.python.org/ftp/python/$(version)/Python-$(version).tgz")
|
|
@@ -32,13 +45,10 @@ package("python")
|
|
|
|
|
|
on_install("windows", function (package)
|
|
|
local installdir = package:installdir("share", package:name(), package:version_str())
|
|
|
+ os.cp("*", installdir)
|
|
|
if package:version_str():startswith("2.") then
|
|
|
- os.mkdir("targetdir")
|
|
|
- os.vrun("msiexec /a \"%s\" /quiet /qn TARGETDIR=\"%s\"", package:originfile(), path.absolute("targetdir"))
|
|
|
- os.cp("targetdir/*", installdir)
|
|
|
- os.cp("targetdir/python.exe", path.join(installdir, "python2.exe"))
|
|
|
+ os.cp("python.exe", path.join(installdir, "python2.exe"))
|
|
|
else
|
|
|
- os.cp("*", installdir)
|
|
|
os.cp("python.exe", path.join(installdir, "python3.exe"))
|
|
|
end
|
|
|
end)
|
|
@@ -47,3 +57,6 @@ package("python")
|
|
|
import("package.tools.autoconf").install(package)
|
|
|
end)
|
|
|
|
|
|
+ on_test(function (package)
|
|
|
+ os.vrun("python --version")
|
|
|
+ end)
|