2021-08-28 19:28:14 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Copyright 2021 Johannes Marbach
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
import glob
|
|
|
|
import os
|
|
|
|
|
|
|
|
import add_pmbootstrap_to_import_path
|
|
|
|
import pmb.parse
|
|
|
|
|
|
|
|
|
|
|
|
def test_aports_firmware(args):
|
|
|
|
"""
|
|
|
|
Various tests performed on the /**/firmware-* aports.
|
|
|
|
"""
|
|
|
|
|
|
|
|
excluded = [
|
2022-11-19 21:33:45 +00:00
|
|
|
"firmware-motorola-ali", # Depends on firmware-qcom-adreno-a530
|
2021-08-28 19:28:14 +00:00
|
|
|
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
|
2021-11-07 23:47:04 +00:00
|
|
|
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
|
2022-05-14 08:11:43 +00:00
|
|
|
"firmware-xiaomi-sagit", # Depends on soc-qcom-sdm845-nonfree-firmware
|
2021-08-28 19:28:14 +00:00
|
|
|
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
|
|
|
|
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
|
|
|
|
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan
|
|
|
|
"firmware-xiaomi-ferrari", # Depends on soc-qcom-msm8916
|
|
|
|
"firmware-xiaomi-willow", # Doesn't build, source link is dead (pma#1212)
|
|
|
|
]
|
|
|
|
|
|
|
|
for path in glob.iglob(f"{args.aports}/**/firmware-*/APKBUILD", recursive=True):
|
2021-11-27 14:08:36 +00:00
|
|
|
apkbuild = pmb.parse.apkbuild(path)
|
2021-08-28 19:28:14 +00:00
|
|
|
aport_name = os.path.basename(os.path.dirname(path))
|
|
|
|
|
|
|
|
if aport_name not in excluded:
|
|
|
|
if "pmb:cross-native" not in apkbuild["options"]:
|
|
|
|
raise RuntimeError(f"{aport_name}: \"pmb:cross-native\" missing in"
|
|
|
|
" options= line. The pmb:cross-native option is"
|
|
|
|
" preferred because it results in significantly"
|
|
|
|
" lower build times. If the package doesn't build"
|
|
|
|
" with the option, you can add an exemption in"
|
|
|
|
" .gitlab-ci/testcases/test_firmware.py.")
|
|
|
|
|
|
|
|
if "!tracedeps" not in apkbuild["options"]:
|
|
|
|
raise RuntimeError(f"{aport_name}: \"!tracedeps\" missing in"
|
|
|
|
" options= line. The tracedeps option is superfluous"
|
|
|
|
" for firmware packages.")
|
2022-11-01 16:32:11 +00:00
|
|
|
|
|
|
|
if "noarch" in apkbuild["arch"]:
|
|
|
|
raise RuntimeError(f"{aport_name}: \"arch\" must not be \"noarch\"!"
|
|
|
|
" Please limit this firmware package to the"
|
|
|
|
" required architectures only!")
|