@@ -62,13 +62,24 @@ def _get_xdg_cache_dir():
6262 return path
6363
6464
65+ # SHA256 hashes of the FreeType tarballs
66+ _freetype_hashes = {
67+ '2.6.1' : '0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014' ,
68+ '2.6.2' : '8da42fc4904e600be4b692555ae1dcbf532897da9c5b9fb5ebd3758c77e5c2d4' ,
69+ '2.6.3' : '7942096c40ee6fea882bd4207667ad3f24bff568b96b10fd3885e11a7baad9a3' ,
70+ '2.6.4' : '27f0e38347a1850ad57f84fc4dfed68ba0bc30c96a6fa6138ef84d485dd9a8d7' ,
71+ '2.6.5' : '3bb24add9b9ec53636a63ea8e867ed978c4f8fdd8f1fa5ccfd41171163d4249a' ,
72+ '2.7' : '7b657d5f872b0ab56461f3bd310bd1c5ec64619bd15f0d8e08282d494d9cfea4' ,
73+ '2.7.1' : '162ef25aa64480b1189cdb261228e6c5c44f212aac4b4621e28cf2157efb59f5' ,
74+ '2.8' : '33a28fabac471891d0523033e99c0005b95e5618dc8ffa7fa47f9dadcacb1c9b' ,
75+ '2.8.1' : '876711d064a6a1bd74beb18dd37f219af26100f72daaebd2d86cb493d7cd7ec6' ,
76+ }
6577# This is the version of FreeType to use when building a local
6678# version. It must match the value in
6779# lib/matplotlib.__init__.py and also needs to be changed below in the
6880# embedded windows build script (grep for "REMINDER" in this file)
6981LOCAL_FREETYPE_VERSION = '2.6.1'
70- # md5 hash of the freetype tarball
71- LOCAL_FREETYPE_HASH = '348e667d728c597360e4a87c16556597'
82+ LOCAL_FREETYPE_HASH = _freetype_hashes .get (LOCAL_FREETYPE_VERSION , 'unknown' )
7283
7384if sys .platform != 'win32' :
7485 if not PY3min :
@@ -294,11 +305,11 @@ def make_extension(name, files, *args, **kwargs):
294305
295306def get_file_hash (filename ):
296307 """
297- Get the MD5 hash of a given filename.
308+ Get the SHA256 hash of a given filename.
298309 """
299310 import hashlib
300311 BLOCKSIZE = 1 << 16
301- hasher = hashlib .md5 ()
312+ hasher = hashlib .sha256 ()
302313 with open (filename , 'rb' ) as fd :
303314 buf = fd .read (BLOCKSIZE )
304315 while len (buf ) > 0 :
0 commit comments