@@ -1047,19 +1047,31 @@ 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 )
1053-
1054- print ("Downloading {0}" .format (tarball_url ))
1055- if sys .version_info [0 ] == 2 :
1056- from urllib import urlretrieve
1057- else :
1058- from urllib .request import urlretrieve
1059-
1060- if not os .path .exists ('build' ):
1061- os .makedirs ('build' )
1062- urlretrieve (tarball_url , tarball_path )
1050+ sourceforge_url = (
1051+ 'http://downloads.sourceforge.net/project/freetype'
1052+ '/freetype2/{0}/' .format (LOCAL_FREETYPE_VERSION )
1053+ )
1054+ url_fmts = (
1055+ 'http://download.savannah.gnu.org/releases/freetype/{0}' ,
1056+ sourceforge_url + '{0}'
1057+ )
1058+ for url_fmt in url_fmts :
1059+ tarball_url = url_fmt .format (tarball )
1060+
1061+ print ("Downloading {0}" .format (tarball_url ))
1062+ if sys .version_info [0 ] == 2 :
1063+ from urllib import urlretrieve
1064+ else :
1065+ from urllib .request import urlretrieve
1066+
1067+ if not os .path .exists ('build' ):
1068+ os .makedirs ('build' )
1069+ try :
1070+ urlretrieve (tarball_url , tarball_path )
1071+ except :
1072+ print ("Failed to download {0}" .format (tarball_url ))
1073+ if not os .path .isfile (tarball_path ):
1074+ raise IOError ("Failed to download freetype" )
10631075 if get_file_hash (tarball_path ) == LOCAL_FREETYPE_HASH :
10641076 try :
10651077 # this will fail on LPy, oh well
0 commit comments