我正在尝试将backports-abc python模块构建到我的OpenWRT构建中,并且在构建/提取过程中需要一些帮助。
我的问题似乎是,由于底层的tar文件结构,下载的backports-abc tar文件将内容提取到backports_abc-0.5,但构建过程在backports-abc-0.5下查找setup.py等(见下文)。我可以手动复制文件并重新构建,这很好用,但这并不理想。此外,尽管它构建正常,但当我将映像加载到设备时,后端端口模块丢失。
/home/ubuntu/build2/openwrt/staging_dir/host/bin/python2: can't open file './setup.py': [Errno 2] No such file or directory
Makefile:59: recipe for target '/home/ubuntu/build2/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/backports-abc-0.5//.built' failed
make[3]: *** [/home/ubuntu/build2/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/backports-abc-0.5//.built] Error 2
make[3]: Leaving directory '/home/ubuntu/build2/openwrt/feeds/linkit/python-backports-abc‘
关于Makefiles的openWRT文档有点模糊,我对这个过程的理解也是如此。
如何将tar文件解压到正确的文件夹,或者在Makefile过程中的什么位置,我应该只将文件复制到正确的文件夹?
这是我的Makefile。
include $(TOPDIR)/rules.mk
PKG_NAME:=backports_abc
PKG_VERSION:=0.5
PKG_RELEASE:=1
PKG_SOURCE:=backports_abc-0.5.tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/68/3c/1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8/
PKG_MD5SUM:=7d1936ec183a3586290adf60f6f96764
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/
#PKG_BUILD_DEPENDS:=python-setuptools
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
define Package/backports_abc
SECTION:=lang-python
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=backports_abc
URL:=https://pypi.python.org/pypi/backports_abc/0.5
DEPENDS:=+python
endef
define Package/backports_abc/description
A backport of recent additions to the 'collections.abc' module.
endef
define Build/Compile
$(call Build/Compile/PyMod,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)$(PYTHON_PKG_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(STAGING_DIR)$(PYTHON_PKG_DIR)/
[ ! -e $(PKG_INSTALL_DIR)/usr/include ] || $(CP) \
$(PKG_INSTALL_DIR)/usr/include/* \
$(STAGING_DIR)/usr/include/
endef
define Package/backportsabc/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
endef
$(eval $(call BuildPackage,backports_abc))发布于 2017-12-04 03:05:18
将Makefile复制到包目录中的某个位置,并从Makefile中删除PKG_BUILD_DIR变量以解决此问题。
发布于 2017-12-04 12:55:22
我通过设置一些下划线和连字符解决了这个问题...例如: backports_abc和backports-abc基本上..这..。PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/表示它正在根据PKG_NAME变量查找文件。
include $(TOPDIR)/rules.mk
PKG_NAME:=backports_abc
PKG_VERSION:=0.5
PKG_RELEASE:=1
PKG_SOURCE:=backports_abc-0.5.tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/68/3c/1317a9113c377d1e33711ca8de1e80afbaf4a3c950dd0edfaf61f9bfe6d8/
PKG_MD5SUM:=7d1936ec183a3586290adf60f6f96764
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/
#PKG_BUILD_DEPENDS:=python-setuptools
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
define Package/backports-abc
SECTION:=lang-python
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=backports-abc
URL:=https://pypi.python.org/pypi/backports_abc/0.5
DEPENDS:=+python
endef
define Package/backports-abc/description
A backport of recent additions to the 'collections.abc' module.
endef
define Build/Compile
$(call Build/Compile/PyMod,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)$(PYTHON_PKG_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(STAGING_DIR)$(PYTHON_PKG_DIR)/
[ ! -e $(PKG_INSTALL_DIR)/usr/include ] || $(CP) \
$(PKG_INSTALL_DIR)/usr/include/* \
$(STAGING_DIR)/usr/include/
endef
define Package/backports-abc/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
endef
$(eval $(call BuildPackage,backports-abc))https://stackoverflow.com/questions/47543526
复制相似问题