10
10
import tarfile
11
11
import zipfile
12
12
from distutils import log
13
- from distutils .version import StrictVersion as Version
14
13
from distutils .errors import DistutilsError
14
+ from distutils .version import StrictVersion as Version
15
15
from pathlib import Path
16
16
from urllib .request import urlcleanup , urljoin , urlopen , urlretrieve
17
17
@@ -59,33 +59,23 @@ def latest_release_from_gnome_org_cache(url, lib_name):
59
59
60
60
61
61
def latest_zlib_release ():
62
- return latest_release_from_html (
63
- 'https://zlib.net/fossils' , re .compile ('zlib-(?P<version>.*).tar.gz' )
64
- )
62
+ return latest_release_from_html ('https://zlib.net/fossils' , re .compile ('zlib-(?P<version>.*).tar.gz' ))
65
63
66
64
67
65
def latest_libiconv_release ():
68
- return latest_release_from_html (
69
- 'https://ftp.gnu.org/pub/gnu/libiconv' , re .compile ('libiconv-(?P<version>.*).tar.gz' )
70
- )
66
+ return latest_release_from_html ('https://ftp.gnu.org/pub/gnu/libiconv' , re .compile ('libiconv-(?P<version>.*).tar.gz' ))
71
67
72
68
73
69
def latest_libxml2_release ():
74
- return latest_release_from_gnome_org_cache (
75
- 'https://download.gnome.org/sources/libxml2' , 'libxml2'
76
- )
70
+ return latest_release_from_gnome_org_cache ('https://download.gnome.org/sources/libxml2' , 'libxml2' )
77
71
78
72
79
73
def latest_libxslt_release ():
80
- return latest_release_from_gnome_org_cache (
81
- 'https://download.gnome.org/sources/libxslt' , 'libxslt'
82
- )
74
+ return latest_release_from_gnome_org_cache ('https://download.gnome.org/sources/libxslt' , 'libxslt' )
83
75
84
76
85
77
def latest_xmlsec_release ():
86
- return latest_release_from_html (
87
- 'https://www.aleksey.com/xmlsec/download/' , re .compile ('xmlsec1-(?P<version>.*).tar.gz' )
88
- )
78
+ return latest_release_from_html ('https://www.aleksey.com/xmlsec/download/' , re .compile ('xmlsec1-(?P<version>.*).tar.gz' ))
89
79
90
80
91
81
class build_ext (build_ext_orig ):
@@ -265,7 +255,9 @@ def prepare_static_build_linux(self):
265
255
self .info ('{:10}: {}' .format ('zlib' , 'PYXMLSEC_ZLIB_VERSION unset, downloading latest from {}' .format (url )))
266
256
else :
267
257
url = 'https://zlib.net/fossils/zlib-{}.tar.gz' .format (self .zlib_version )
268
- self .info ('{:10}: {}' .format ('zlib' , 'PYXMLSEC_ZLIB_VERSION={}, downloading from {}' .format (self .zlib_version , url )))
258
+ self .info (
259
+ '{:10}: {}' .format ('zlib' , 'PYXMLSEC_ZLIB_VERSION={}, downloading from {}' .format (self .zlib_version , url ))
260
+ )
269
261
urlretrieve (url , str (zlib_tar ))
270
262
271
263
# fetch libiconv
@@ -278,7 +270,11 @@ def prepare_static_build_linux(self):
278
270
self .info ('{:10}: {}' .format ('zlib' , 'PYXMLSEC_LIBICONV_VERSION unset, downloading latest from {}' .format (url )))
279
271
else :
280
272
url = 'https://ftp.gnu.org/pub/gnu/libiconv/libiconv-{}.tar.gz' .format (self .libiconv_version )
281
- self .info ('{:10}: {}' .format ('zlib' , 'PYXMLSEC_LIBICONV_VERSION={}, downloading from {}' .format (self .libiconv_version , url )))
273
+ self .info (
274
+ '{:10}: {}' .format (
275
+ 'zlib' , 'PYXMLSEC_LIBICONV_VERSION={}, downloading from {}' .format (self .libiconv_version , url )
276
+ )
277
+ )
282
278
urlretrieve (url , str (libiconv_tar ))
283
279
284
280
# fetch libxml2
@@ -290,8 +286,14 @@ def prepare_static_build_linux(self):
290
286
self .info ('{:10}: {}' .format ('libxml2' , 'PYXMLSEC_LIBXML2_VERSION unset, downloading latest from {}' .format (url )))
291
287
else :
292
288
version_prefix , _ = self .libxml2_version .split ('.' , - 1 )
293
- url = 'https://download.gnome.org/sources/libxml2/{}/libxml2-{}.tar.xz' .format (version_prefix , self .libxml2_version )
294
- self .info ('{:10}: {}' .format ('libxml2' , 'PYXMLSEC_LIBXML2_VERSION={}, downloading from {}' .format (self .libxml2_version , url )))
289
+ url = 'https://download.gnome.org/sources/libxml2/{}/libxml2-{}.tar.xz' .format (
290
+ version_prefix , self .libxml2_version
291
+ )
292
+ self .info (
293
+ '{:10}: {}' .format (
294
+ 'libxml2' , 'PYXMLSEC_LIBXML2_VERSION={}, downloading from {}' .format (self .libxml2_version , url )
295
+ )
296
+ )
295
297
libxml2_tar = self .libs_dir / 'libxml2.tar.xz'
296
298
urlretrieve (url , str (libxml2_tar ))
297
299
@@ -304,8 +306,14 @@ def prepare_static_build_linux(self):
304
306
self .info ('{:10}: {}' .format ('libxslt' , 'PYXMLSEC_LIBXSLT_VERSION unset, downloading latest from {}' .format (url )))
305
307
else :
306
308
version_prefix , _ = self .libxslt_version .split ('.' , - 1 )
307
- url = 'https://download.gnome.org/sources/libxslt/{}/libxslt-{}.tar.xz' .format (version_prefix , self .libxslt_version )
308
- self .info ('{:10}: {}' .format ('libxslt' , 'PYXMLSEC_LIBXSLT_VERSION={}, downloading from {}' .format (self .libxslt_version , url )))
309
+ url = 'https://download.gnome.org/sources/libxslt/{}/libxslt-{}.tar.xz' .format (
310
+ version_prefix , self .libxslt_version
311
+ )
312
+ self .info (
313
+ '{:10}: {}' .format (
314
+ 'libxslt' , 'PYXMLSEC_LIBXSLT_VERSION={}, downloading from {}' .format (self .libxslt_version , url )
315
+ )
316
+ )
309
317
libxslt_tar = self .libs_dir / 'libxslt.tar.gz'
310
318
urlretrieve (url , str (libxslt_tar ))
311
319
@@ -318,7 +326,11 @@ def prepare_static_build_linux(self):
318
326
self .info ('{:10}: {}' .format ('xmlsec1' , 'PYXMLSEC_XMLSEC1_VERSION unset, downloading latest from {}' .format (url )))
319
327
else :
320
328
url = 'https://www.aleksey.com/xmlsec/download/xmlsec1-{}.tar.gz' .format (self .xmlsec1_version )
321
- self .info ('{:10}: {}' .format ('xmlsec1' , 'PYXMLSEC_XMLSEC1_VERSION={}, downloading from {}' .format (self .xmlsec1_version , url )))
329
+ self .info (
330
+ '{:10}: {}' .format (
331
+ 'xmlsec1' , 'PYXMLSEC_XMLSEC1_VERSION={}, downloading from {}' .format (self .xmlsec1_version , url )
332
+ )
333
+ )
322
334
xmlsec1_tar = self .libs_dir / 'xmlsec1.tar.gz'
323
335
urlretrieve (url , str (xmlsec1_tar ))
324
336
0 commit comments