Hi, I am adding ostree and aktualizr to my openwrt package, ostree is a denpendency of aktualizr, I have added it to the DEPENDS of aktualizr. But when I compile aktualizr, the CMake system tells me that it cannot find the headers path and library path of ostree.
Here is the error messages:
Package aktualizr is missing dependencies for the following libraries:
libostree-1.so.1
I have no idea how OpenWRT find the libraries for a package. If anyone knows it, please give me a hint.
And here is the Makefile of aktualizr:
include $(TOPDIR)/rules.mk
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}
CMAKE_BINARY_SUBDIR:=build
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/${PKG_NAME}
SECTION:=TCU
CATEGORY:=TCU
SUBMENU:=Utils
TITLE:=aktualizr
DEPENDS:=+libc +libopenssl +boost +boost-atomic +boost-chrono +boost-filesystem +boost-log +boost-program_options +boost-regex +boost-thread +boost-system +libpsl +libcurl +libsodium +libostree +libarchive +libsqlite3
endef
define Package/${PKG_NAME}/description
This is a update client for embedded systems. It can be used to update the software on a device over-the-air.
endef
define Package/${PKG_NAME}/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkg-install/usr/bin/aktualizr ${1}/usr/bin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkg-install/usr/lib/libaktualizr.so ${1}/usr/lib
endef
CMAKE_OPTIONS+= \
-DCMAKE_BUILD_TYPE=Debug
$(eval $(call BuildPackage,${PKG_NAME}))
And the Makefile of OSTree
include $(TOPDIR)/rules.mk
PKG_NAME:=libostree
PKG_VERSION:=2023.8
PKG_RELEASE:=1
PKG_BUILD_DIR=${BUILD_DIR}/${PKG_NAME}-${PKG_VERSION}
PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.xz
PKG_SOURCE_URL:=https://github.com/ostreedev/ostree/releases/download/v${PKG_VERSION}/
PKG_HASH:=b6fffc267188e40d60755e6d7f2be65831795baa53b0fd9dd6c6809c7e54796d
include $(INCLUDE_DIR)/package.mk
export OT_DEP_E2P_CFLAGS="-I${BUILD_DIR}/target-aarch64_generic_glibc/e2fsprogs-1.46.5/lib/e2p"
export OT_DEP_E2P_LIBS="-L{STAGING_DIR}/root-layerscape/usr/lib"
define Package/${PKG_NAME}
SECTION:=TCU
CATEGORY:=TCU
SUBMENU:=Utils
TITLE:=libostree
DEPENDS:=+libunistring +libgpgme +libassuan +libcurl +libidn2 +libatomic +libarchive +e2fsprogs +libnettle +libcharset +libxml2 +liblzma +libiconv +libselinux +libsqlite3 +glib2 +libfuse +libmount +libcurl +libsoup
endef
define Package/${PKG_NAME}/description
OSTree library.
endef
define Build/Configure
$(call Build/Configure/Default,)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/ostree $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ostree-prepare-root $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/.libs/lib*.a $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/.libs/lib*.so* $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/ipkg-install/usr/include/ostree-1/* $(1)/usr/include
endef
define Package/${PKG_NAME}/install
$(call Build/Install/Default,)
endef
$(eval $(call BuildPackage,${PKG_NAME}))
Anything you need to debug, feel free to comment!