|
|
|
@ -13,7 +13,8 @@ package("python2") |
|
|
|
|
add_versions("2.7.15", "f34e2555c4fde5d7d746e6a0bbfc9151435f3f5c3eaddfc046ec0993b7cc9660") |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
set_urls("https://www.python.org/ftp/python/$(version)/Python-$(version).tgz") |
|
|
|
|
set_urls("https://www.python.org/ftp/python/$(version)/Python-$(version).tgz", |
|
|
|
|
"https://github.com/xmake-mirror/cpython/releases/download/v$(version)/Python-$(version).tgz") |
|
|
|
|
add_versions("2.7.15", "18617d1f15a380a919d517630a9cd85ce17ea602f9bbdc58ddc672df4b0239db") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -47,7 +48,7 @@ package("python2") |
|
|
|
|
|
|
|
|
|
-- allow python modules to use ctypes.find_library to find xmake's stuff |
|
|
|
|
if is_host("macosx") then |
|
|
|
|
io.gsub("Lib/ctypes/macholib/dyld.py", "DEFAULT_LIBRARY_FALLBACK = [", format("DEFAULT_LIBRARY_FALLBACK = [ '%s/lib',", package:installdir())) |
|
|
|
|
io.gsub("Lib/ctypes/macholib/dyld.py", "DEFAULT_LIBRARY_FALLBACK = %[", format("DEFAULT_LIBRARY_FALLBACK = [ '%s/lib',", package:installdir())) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
-- unset these so that installing pip and setuptools puts them where we want |
|
|
|
@ -76,15 +77,15 @@ package("python2") |
|
|
|
|
} |
|
|
|
|
import("net.http") |
|
|
|
|
import("utils.archive") |
|
|
|
|
import("lib.detect.find_file") |
|
|
|
|
for name, resource in pairs(resources) do |
|
|
|
|
local resourcefile = path.join(package:cachedir(), path.filename(resource.url)) |
|
|
|
|
local resourcefile = path.join(os.curdir(), path.filename(resource.url)) |
|
|
|
|
local resourcedir = resourcefile .. ".dir" |
|
|
|
|
http.download(resource.url, resourcefile) |
|
|
|
|
assert(resource.sha256 == hash.sha256(resourcefile), "resource(%s): unmatched checksum!", name) |
|
|
|
|
assert(archive.extract(resourcefile, resourcedir), "resource(%s): extract failed!", name) |
|
|
|
|
os.cd(resourcedir) |
|
|
|
|
os.vrun("python2 setup.py install") |
|
|
|
|
os.cd("-") |
|
|
|
|
local setupfile = assert(find_file("setup.py", path.join(resourcedir, "*")), "resource(%s): setup.py not found!", name) |
|
|
|
|
os.vrunv("python", {setupfile, "install"}) |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|