File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -1047,19 +1047,34 @@ def do_custom_build(self):
1047
1047
pass
1048
1048
1049
1049
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 )
1053
1050
1054
- print ("Downloading {0}" .format (tarball_url ))
1055
1051
if sys .version_info [0 ] == 2 :
1056
1052
from urllib import urlretrieve
1057
1053
else :
1058
1054
from urllib .request import urlretrieve
1059
-
1060
1055
if not os .path .exists ('build' ):
1061
1056
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" )
1063
1078
if get_file_hash (tarball_path ) == LOCAL_FREETYPE_HASH :
1064
1079
try :
1065
1080
# this will fail on LPy, oh well
You can’t perform that action at this time.
0 commit comments