mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-10 21:59:54 -05:00
2.0 KiB
2.0 KiB
dl
Downloaded files should be put in pkgs directory.
Extracted files should be put in extracted directory.
so:
- If you are developing a package, and need data files, cause only code should be add to git repo, you should put the data files on internet, and download them is
dl/pkgsdirectory, to use them, extract them todl/extracteddirectory. You just need edit thecomponents.pywhich next toCMakeLists.txtfile, addadd_file_downloadsfunction, this will tell maixcdk to download and extract them before compile, so you can use the extracted files with${DL_EXTRACTED_PATH}/your_pathin yourCMakeLists.txt
e.g. For python packages, will be downloaded to
dl/pkgs/python_srcs, and extracted todl/extracted/python_srcs, which download commands in CMakelists.txt.
add_file_downloads example:
def add_file_downloads(confs : dict) -> list:
'''
@param confs kconfig vars, dict type
@return list type, items is dict type
'''
version = f"{confs['CONFIG_MEDIA_SERVER_VERSION_MAJOR']}.{confs['CONFIG_MEDIA_SERVER_VERSION_MINOR']}.{confs['CONFIG_MEDIA_SERVER_VERSION_PATCH']}"
if version == "1.0.0":
url = "https://master.dl.sourceforge.net/projectxxxxxx.zip"
sha256sum = "dfe405cedbf3969fbf1f252634e7b1c71e8bb3e2d0857db2fe7e70189474ecd1"
elif version == "1.0.1":
url = "https://master.dl.sourceforge.net/projectxxxxxx1.0.1.zip"
else:
raise Exception(f"version {version} not support")
filename = f"media_server-{version}.zip"
return [
{
'url': f'{url}',
'urls': [],
'sites': [],
'sha256sum': sha256sum,
'filename': filename,
'path': 'media_server',
'check_files': [
f'media_server-{version}'
]
}
]
- If you users to compile projects, you can download files manually to dl/pkgs directory first, when compile
pkgs_info.jsonwill be write to this directory, all files need to be downloaded will be listed in this file.