Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 507aca5

Browse filesBrowse files
authored
Merge pull request #6943 from jenshnielsen/addfreetypemirror
BLD: Add mirrors to freetype download
2 parents 6937366 + 7509230 commit 507aca5
Copy full SHA for 507aca5

File tree

Expand file treeCollapse file tree

1 file changed

+21
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+21
-6
lines changed

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+21-6Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,19 +1047,34 @@ def do_custom_build(self):
10471047
pass
10481048

10491049
if not os.path.isfile(tarball_path):
1050-
url_fmt = (
1051-
'http://download.savannah.gnu.org/releases/freetype/{0}')
1052-
tarball_url = url_fmt.format(tarball)
10531050

1054-
print("Downloading {0}".format(tarball_url))
10551051
if sys.version_info[0] == 2:
10561052
from urllib import urlretrieve
10571053
else:
10581054
from urllib.request import urlretrieve
1059-
10601055
if not os.path.exists('build'):
10611056
os.makedirs('build')
1062-
urlretrieve(tarball_url, tarball_path)
1057+
1058+
sourceforge_url = (
1059+
'http://downloads.sourceforge.net/project/freetype'
1060+
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
1061+
)
1062+
url_fmts = (
1063+
sourceforge_url + '{0}',
1064+
'http://download.savannah.gnu.org/releases/freetype/{0}'
1065+
)
1066+
for url_fmt in url_fmts:
1067+
tarball_url = url_fmt.format(tarball)
1068+
1069+
print("Downloading {0}".format(tarball_url))
1070+
try:
1071+
urlretrieve(tarball_url, tarball_path)
1072+
except:
1073+
print("Failed to download {0}".format(tarball_url))
1074+
else:
1075+
break
1076+
if not os.path.isfile(tarball_path):
1077+
raise IOError("Failed to download freetype")
10631078
if get_file_hash(tarball_path) == LOCAL_FREETYPE_HASH:
10641079
try:
10651080
# this will fail on LPy, oh well

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.