Bundle ssl lib

This commit is contained in:
Gres 2020-04-12 15:52:42 +03:00
parent 2f796d33c9
commit 04de7388b1
5 changed files with 69 additions and 0 deletions

View File

@ -66,6 +66,9 @@ jobs:
- name: Get Qt
run: python ./share/ci/get_qt.py
- name: Get ssl
run: python ./share/ci/get_qt_ssl.py
- name: Get leptonica
run: python ./share/ci/get_leptonica.py

View File

@ -3,6 +3,8 @@ from config import *
import os
import sys
import subprocess as sub
import shutil
from glob import glob
if len(sys.argv) > 1 and sys.argv[1] == 'glibc_version': # subcommand
sub.run('ldd --version | head -n 1 | grep -Po "\\d\\.\\d\\d"', shell=True)
@ -43,6 +45,12 @@ os.environ['VERSION'] = app_version
# debug flags: -unsupported-bundle-everything -unsupported-allow-new-glibc
flags = '' if os.getenv("DEBUG") is None else '-unsupported-allow-new-glibc'
out_lib_dir = install_dir + '/usr/lib'
os.makedirs(out_lib_dir, exist_ok=True)
for f in glob(ssl_dir + '/lib/lib*.so.*'):
c.print('>> Copying {} to {}'.format(f, out_lib_dir))
shutil.copy(f, out_lib_dir)
c.run('{} {}/usr/share/applications/*.desktop {} -appimage -qmake={}/bin/qmake'.format(
linuxdeployqt_bin, install_dir, flags, qt_dir))

View File

@ -10,6 +10,7 @@ qt_modules = ['qtbase', 'qttools', 'icu',
'qtdeclarative', 'qtlocation', 'opengl32sw', 'd3dcompiler_47',
'qtserialport']
qt_dir = path.abspath('qt')
ssl_dir = path.abspath('ssl')
build_dir = path.abspath('build')
dependencies_dir = path.abspath('deps')

52
share/ci/get_qt_ssl.py Normal file
View File

@ -0,0 +1,52 @@
import common as c
from config import ssl_dir, os_name
import sys
import xml.etree.ElementTree as ET
c.print('>> Downloading ssl for Qt for {}'.format(os_name))
if os_name == 'linux':
os_url = 'linux_x64'
tool_name = 'tools_openssl_x64'
root_path = 'Tools/OpenSSL/binary'
elif os_name == 'win32':
os_url = 'windows_x86'
tool_name = 'tools_openssl_x86'
root_path = 'Tools/OpenSSL/Win_x86'
elif os_name == 'win64':
os_url = 'windows_x86'
tool_name = 'tools_openssl_x64'
root_path = 'Tools/OpenSSL/Win_x64'
elif os_name == 'macos':
exit(0)
base_url = 'https://download.qt.io/online/qtsdkrepository/{}/desktop/{}' \
.format(os_url, tool_name)
updates_file = 'Updates-{}-{}.xml'.format(tool_name, os_name)
c.download(base_url + '/Updates.xml', updates_file)
updates = ET.parse(updates_file)
updates_root = updates.getroot()
url = ''
file_name = ''
for i in updates_root.iter('PackageUpdate'):
name = i.find('Name').text
if not 'qt.tools.openssl' in name:
continue
archives = i.find('DownloadableArchives')
if archives.text is None:
continue
version = i.find('Version').text
url = base_url + '/' + name + '/' + version + archives.text
file_name = archives.text
if len(url) == 0:
c.print('>> No ssl url found')
exit(1)
c.download(url, file_name)
c.extract(file_name, '.')
c.symlink(root_path, ssl_dir)

View File

@ -3,6 +3,7 @@ from config import *
import os
import sys
import shutil
from glob import glob
artifact_name = '{}-{}-{}.zip'.format(app_name, app_version, os_name)
if len(sys.argv) > 1 and sys.argv[1] == 'artifact_name': # subcommand
@ -32,4 +33,8 @@ for file in os.scandir(libs_dir):
c.print('>> Copying {} to {}'.format(full_name, install_dir))
shutil.copy(full_name, install_dir)
for f in glob(ssl_dir + '/bin/*.dll'):
c.print('>> Copying {} to {}'.format(f, install_dir))
shutil.copy(f, install_dir)
c.archive(c.get_folder_files(os.path.relpath(install_dir)), artifact_path)