diff --git a/package/optee-test/Config.in b/package/optee-test/Config.in index 57a7834c75..a29eb355ac 100644 --- a/package/optee-test/Config.in +++ b/package/optee-test/Config.in @@ -31,3 +31,44 @@ comment "optee-test needs a toolchain w/ threads, C++, dynamic library, headers depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP || \ BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3 + +if BR2_PACKAGE_OPTEE_TEST + +choice + prompt "optee-test version" + default BR2_PACKAGE_OPTEE_TEST_LATEST if BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS + help + Select the version of optee-test you want to use + +config BR2_PACKAGE_OPTEE_TEST_LATEST + bool "4.3.0" + help + Use the latest release tag from the optee-test official Git + repository. + +config BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL + bool "Custom tarball" + help + This option allows to specify a URL pointing to an optee-test + source tarball. This URL can use any protocol recognized by + Buildroot, like http://, ftp://, file:// or scp://. + + When pointing to a local tarball using file://, you may want + to use a make variable like $(TOPDIR) to reference the root of + the Buildroot tree. + +endchoice + +if BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL + +config BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL_LOCATION + string "URL of custom optee-test tarball" + +endif + +config BR2_PACKAGE_OPTEE_TEST_VERSION + string + default "4.3.0" if BR2_PACKAGE_OPTEE_TEST_LATEST + default "custom" if BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL + +endif # BR2_PACKAGE_OPTEE_TEST diff --git a/package/optee-test/optee-test.mk b/package/optee-test/optee-test.mk index 9037678b1d..c250639d06 100644 --- a/package/optee-test/optee-test.mk +++ b/package/optee-test/optee-test.mk @@ -4,11 +4,22 @@ # ################################################################################ -OPTEE_TEST_VERSION = 4.3.0 -OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION)) +OPTEE_TEST_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_VERSION)) OPTEE_TEST_LICENSE = GPL-2.0, BSD-2-Clause, OPTEE_TEST_LICENSE_FILES = LICENSE.md +ifeq ($(BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL),y) +OPTEE_TEST_TARBALL = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL_LOCATION)) +OPTEE_TEST_SITE = $(patsubst %/,%,$(dir $(OPTEE_TEST_TARBALL))) +OPTEE_TEST_SOURCE = $(notdir $(OPTEE_TEST_TARBALL)) +else +OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION)) +endif + +ifeq ($(BR2_PACKAGE_OPTEE_TEST):$(BR2_PACKAGE_OPTEE_TEST_LATEST),y:) +BR_NO_CHECK_HASH_FOR += $(OPTEE_TEST_SOURCE) +endif + OPTEE_TEST_DEPENDENCIES = optee-client optee-os ifeq ($(BR2_PACKAGE_LIBOPENSSL),y) @@ -34,4 +45,10 @@ endef OPTEE_TEST_POST_BUILD_HOOKS += OPTEE_TEST_BUILD_TAS OPTEE_TEST_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_INSTALL_TAS +ifeq ($(BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL)$(BR_BUILDING),yy) +ifeq ($(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL_LOCATION)),) +$(error No tarball location specified. Please check BR2_PACKAGE_OPTEE_TEST_CUSTOM_TARBALL_LOCATION) +endif +endif + $(eval $(cmake-package))