-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpre-publish.py
75 lines (61 loc) · 2.37 KB
/
pre-publish.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import requests
import zipfile
import platform
import subprocess
import os
import shutil
import io
tmp_dir = "./tmp"
lexactivator_libs_version = "v3.31.0"
class FileInfo(object):
def __init__(self, src, dest):
self.src = src
self.dest = dest
def download(url, files):
print (url)
result = requests.get(url, stream=True)
zip = zipfile.ZipFile(io.BytesIO(result.content))
if not os.path.exists(tmp_dir):
os.makedirs(tmp_dir)
zip.extractall(tmp_dir)
for file in files:
shutil.copyfile(tmp_dir + "/" + file.src, file.dest)
def main():
print("Downloading LexActivator library ...")
base_url = 'https://dl.cryptlex.com/downloads/'
base_path = './cryptlex/lexactivator/libs'
files = [
FileInfo('libs/clang/x86_64/libLexActivator.dylib',
base_path + '/macos/x86_64/libLexActivator.dylib'),
FileInfo('libs/clang/arm64/libLexActivator.dylib',
base_path + '/macos/arm64/libLexActivator.dylib')
]
url = '/LexActivator-Mac.zip'
download(base_url + lexactivator_libs_version + url, files)
files = [
FileInfo('libs/vc14/x86/LexActivator.dll',
base_path + '/win32/x86/LexActivator.dll'),
FileInfo('libs/vc14/x64/LexActivator.dll',
base_path + '/win32/x86_64/LexActivator.dll'),
FileInfo('libs/vc17/arm64/LexActivator.dll',
base_path + '/win32/arm64/LexActivator.dll')
]
url = '/LexActivator-Win.zip'
download(base_url + lexactivator_libs_version + url, files)
files = [
FileInfo('libs/gcc/amd64/libLexActivator.so', base_path +
'/linux/gcc/x86_64/libLexActivator.so'),
FileInfo('libs/gcc/i386/libLexActivator.so', base_path +
'/linux/gcc/x86/libLexActivator.so'),
FileInfo('libs/gcc/arm64/libLexActivator.so', base_path +
'/linux/gcc/arm64/libLexActivator.so'),
FileInfo('libs/gcc/armhf/libLexActivator.so', base_path +
'/linux/gcc/armhf/libLexActivator.so'),
FileInfo('libs/musl/amd64/libLexActivator.so', base_path +
'/linux/musl/x86_64/libLexActivator.so'),
]
url = '/LexActivator-Linux.zip'
download(base_url + lexactivator_libs_version + url, files)
print("Lexactivator library successfully downloaded!")
shutil.rmtree(tmp_dir)
main()