Skip to content

Commit

Permalink
Download luajit from github mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Dec 22, 2015
1 parent 081f713 commit a297581
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions hererocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ def fetch_repo(self, ref):
if need_checkout and ref != "master":
run_command("git checkout", quote(ref))

def get_download_name(self):
return self.name + "-" + self.version + ("-win32" if self.win32_zip else "")

def get_download_url(self):
return self.downloads + "/" + self.get_download_name() + (
".zip" if self.win32_zip else ".tar.gz")

def fetch(self):
if self.fetched:
return
Expand All @@ -239,8 +246,7 @@ def fetch(self):
os.makedirs(opts.downloads)

archive_name = os.path.join(opts.downloads, self.name + self.version)
download_name = self.name + "-" + self.version + ("-win32" if self.win32_zip else "")
url = self.downloads + "/" + download_name + (".zip" if self.win32_zip else ".tar.gz")
url = self.get_download_url()
message = "Fetching {} from {}".format(self.title, url)

if not os.path.exists(archive_name):
Expand All @@ -256,7 +262,7 @@ def fetch(self):

archive.extractall(temp_dir)
archive.close()
os.chdir(os.path.join(temp_dir, download_name))
os.chdir(os.path.join(temp_dir, self.get_download_name()))
self.fetched = True

def set_identifiers(self):
Expand Down Expand Up @@ -503,9 +509,9 @@ def make_install(self):
class LuaJIT(Lua):
name = "LuaJIT"
title = "LuaJIT"
downloads = "http://luajit.org/download"
downloads = "https://github.com/LuaJIT/LuaJIT/archive"
win32_zip = False
default_repo = "https://github.com/luajit/luajit"
default_repo = "https://github.com/LuaJIT/LuaJIT"
versions = [
"2.0.0", "2.0.1", "2.0.2", "2.0.3", "2.0.4"
]
Expand All @@ -516,6 +522,9 @@ class LuaJIT(Lua):
"^": "2.0.4"
}

def get_download_url(self):
return self.downloads + "/v" + self.version + ".tar.gz"

@staticmethod
def major_version_from_version():
return "5.1"
Expand Down

0 comments on commit a297581

Please sign in to comment.