include $(TOPDIR)/rules.mk
# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
PKG_NAME:=aktualizr
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/advancedtelematic/aktualizr.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE_VERSION:=2020.10
PKG_BUILD_DIR:=$(BUILD_DIR)/${PKG_NAME}
PKG_INSTALL_DIR:=$(STAGING_DIR)/root-layerscape
CMAKE_BINARY_SUBDIR:=build
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/${PKG_NAME}
SECTION:=libs
CATEGORY:=Libraries
TITLE:=aktualizr
DEPENDS:=+asn1c +boost +libboost_log +libboost_program_options +libpsl +libcurl +libsodium +ostree
endef
define Package/${PKG_NAME}/description
This is a FOTA client for embedded systems. It can be used to update the software on a device over-the-air.
endef
CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Debug
define Package/${PKG_NAME}/install
$(INSTALL_DIR) $(1)/usr/bin
endef
$(eval $(call BuildPackage,${PKG_NAME}))
Package aktualizr is missing dependencies for the following libraries:
libboost_atomic.so.1.78.0
libboost_chrono.so.1.78.0
libboost_filesystem.so.1.78.0
libboost_log.so.1.78.0
libboost_log_setup.so.1.78.0
libboost_program_options.so.1.78.0
libboost_regex.so.1.78.0
libboost_system.so.1.78.0
libboost_thread.so.1.78.0
[aktualizr] 是基于CMake构建的包,在此前的定制包示例中,都是基于Makefile编译的,因此这篇博客主要记录如何增加CMAKE编译的组件。 编写的CMAKE如下:
由于
aktualizr
无法在源码目录编译,否则会出现以下错误: 在解决这个问题的时候花费了较长时间,最后是通过openwrt论坛提问得到的解决方法,具体帖子参考:openwrt提问求助。 其中,include $(INCLUDE_DIR)/cmake.mk
只有在编译cmake的包是2才需要引入,CMAKE_BINARY_SUBDIR
定义了编译的路径,正是这个变量解决了上述问题。除了这个问题外,如果依赖只添加boost或者添加的方式为+libboost_atomic
或者是boost_atomic
,都会出现以下这个错误:正确的添加方式是: