Skip to content

Commit

Permalink
Fixed libui dependency extration on build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Oct 28, 2024
1 parent 6953fc2 commit 433b7da
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import shutil
import subprocess
import sys
import tarfile
import zipfile

from glob import glob
Expand Down Expand Up @@ -72,10 +73,18 @@ def download_libui():
print('Download completed.')
os.makedirs(OUT_DIR, exist_ok=True)

print('Extracting the ZIP file...')
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(OUT_DIR)
print('Extraction completed.')
if zip_path.endswith('.zip'):
print('Extracting the ZIP file...')
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(OUT_DIR)
print('Extraction completed.')
elif zip_path.endswith('.tgz') or zip_path.endswith('.tar.gz'):
print('Extracting the TAR file...')
with tarfile.open(zip_path, 'r:gz') as tar_ref:
tar_ref.extractall(OUT_DIR)
print('Extraction completed.')
else:
print('Unsupported file format for extraction.')

lib_header_path = os.path.join(TEMP_DIR, 'include')
os.makedirs(TEMP_DIR, exist_ok=True)
Expand Down

0 comments on commit 433b7da

Please sign in to comment.