################################################################################
#
# ti-sgx-um_CV
#
################################################################################

# TI-GIT-Webinterface: https://git.ti.com/cgit/graphics/omap5-sgx-ddk-um-linux
# download: git clone https://git.ti.com/cgit/graphics/omap5-sgx-ddk-um-linux.git
# cd omap5-sgx-ddk-linux
# git branch -a --contains 909e237baf47d0bde006ff25552f5403fd7e359d
# git show 62f31de3ceed156bff32abb3dd03693a02df117e
# we use branch ti-img-sgx/1.17.4948957/k5.10

# This corresponds to SDK 06.01.00.08
# TI_SGX_UM_CV_VERSION = 909e237baf47d0bde006ff25552f5403fd7e359d
# TI_SGX_UM_CV_VERSION = 87d7e5c1e4db1bab048939c9719059d549c1e8dd
TI_SGX_UM_CV_VERSION = 905809029b877fea42e91b9738825a6294ff1775
TI_SGX_UM_CV_SITE = http://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git
TI_SGX_UM_CV_SITE_METHOD = git
TI_SGX_UM_CV_LICENSE = TI TSPA License
TI_SGX_UM_CV_LICENSE_FILES = TI-Linux-Graphics-DDK-UM-Manifest.doc
TI_SGX_UM_CV_INSTALL_STAGING = YES
TI_SGX_UM_CV_PROVIDES = libegl libgles powervr
TI_SGX_UM_CV_TARGET=ti335x

# ti-sgx-um is a egl/gles provider only if libdrm is installed
TI_SGX_UM_CV_DEPENDENCIES = libdrm wayland

define TI_SGX_UM_CV_INSTALL_STAGING_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DISCIMAGE=$(STAGING_DIR) \
		TARGET_PRODUCT=$(TI_SGX_UM_CV_TARGET) install
endef

define TI_SGX_UM_CV_INSTALL_TARGET_CMDS
	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DISCIMAGE=$(TARGET_DIR) \
		TARGET_PRODUCT=$(TI_SGX_UM_CV_TARGET) install
endef

TI_SGX_UM_CV_POST_INSTALL_TARGET_HOOKS += TI_SGX_UM_CV_INSTALL_CONF

define TI_SGX_UM_CV_INSTALL_INIT_SYSV
	$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_CVBOARD_PATH)/package/ti-sgx-um_CV/S80ti-sgx \
		$(TARGET_DIR)/etc/init.d/S80ti-sgx
endef

$(eval $(generic-package))
