Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
env:
PYXMLSEC_STATIC_DEPS: true
PYXMLSEC_LIBXML2_VERSION: 2.14.6 # Lock it to libxml2 2.14.6 until the issue with 2.15.x is resolved; e.g. https://github.com/lsh123/xmlsec/issues/948
PYXMLSEC_XMLSEC1_VERSION: 1.3.8-rc1
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
/opt/python/${{ matrix.python-abi }}/bin/python -m build
Expand Down
16 changes: 13 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ def latest_xmlsec_release():
return tar_gz['browser_download_url']


def urlretrieve2(url, filename):
req = Request(url, headers={'User-Agent': 'python-xmlsec build'})
with urlopen(req) as r, open(filename, 'wb') as f:
while True:
chunk = r.read(8192)
if not chunk:
break
f.write(chunk)


class CrossCompileInfo:
def __init__(self, host, arch, compiler):
self.host = host
Expand Down Expand Up @@ -319,13 +329,13 @@ def prepare_static_build(self, build_platform):
libiconv_tar = self.libs_dir / 'libiconv.tar.gz'
if self.libiconv_version is None:
url = latest_libiconv_release()
self.info('{:10}: {}'.format('zlib', f'PYXMLSEC_LIBICONV_VERSION unset, downloading latest from {url}'))
self.info('{:10}: {}'.format('libiconv', f'PYXMLSEC_LIBICONV_VERSION unset, downloading latest from {url}'))
else:
url = f'https://ftp.gnu.org/pub/gnu/libiconv/libiconv-{self.libiconv_version}.tar.gz'
self.info(
'{:10}: {}'.format('zlib', f'PYXMLSEC_LIBICONV_VERSION={self.libiconv_version}, downloading from {url}')
'{:10}: {}'.format('libiconv', f'PYXMLSEC_LIBICONV_VERSION={self.libiconv_version}, downloading from {url}')
)
urlretrieve(url, str(libiconv_tar))
urlretrieve2(url, str(libiconv_tar))

# fetch libxml2
libxml2_tar = next(self.libs_dir.glob('libxml2*.tar.xz'), None)
Expand Down
Loading