I try to add dbus-python package. It is needed for interfaces with dbus. My target is a simple bluetooth agent, thus allowing audio transmission to the device. The setup.py calls make on it's own. I removed that, but it still looks like some important defines are missing in the when make is called.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-dbus
PKG_VERSION:=1.2.16
PKG_RELEASE:=1
PYPI_NAME:=dbus-python
PKG_HASH:=11238f1d86c995d8aed2e22f04a1e3779f0d70e587caffeab4857f3c662ed5a4
PKG_MAINTAINER:=Andre Valentin <avalentin@marcant.net>
PKG_LICENSE:=GPL-2.0-or-later Apache-2.0
PKG_LICENSE_FILES:=LICENSE.GPL.v2 LICENSE.Apache.v2
PKG_FIXUP:=autoreconf
PYTHON3_PKG_BUILD:=1
include $(TOPDIR)/package/feeds/packages/python3/../pypi.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
include $(TOPDIR)/package/feeds/packages/python3/../python3-package.mk
define Package/python3-dbus
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Python dbus library
URL:=https://dbus.freedesktop.org/
DEPENDS:= +python3-light $(INTL_DEPENDS) +glib2 +libdbus
endef
define Package/python3-dbus/description
Python module for interfacing with dbus
endef
TARGET_CFLAGS += \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/include \
-I$(STAGING_DIR)/usr/include/dbus-1.0 \
-I$(STAGING_DIR)/usr/lib/dbus-1.0/include \
-I$(STAGING_DIR)/usr/include/glib-2.0
# -include $(PKG_BUILD_DIR)/config.h
# -DPACKAGE_VERSION=1
CONFIGURE_ARGS += \
PYTHON_VERSION=$(PYTHON3_VERSION) \
PYTHON_LIBS="-L$(STAGING_DIR)/usr/lib -lpython$(PYTHON3_VERSION)"
$(eval $(call Py3Package,python3-dbus))
$(eval $(call BuildPackage,python3-dbus))
#$(eval $(call BuildPackage,python3-dbus-src))
dbus_bindings/module.c: In function 'PyInit__dbus_bindings':
dbus_bindings/module.c:407:36: error: 'PACKAGE_VERSION' undeclared (first use in this function); did you mean 'PY_VERSION'?
PACKAGE_VERSION) < 0) goto init_error;
^~~~~~~~~~~~~~~
PY_VERSION
import dbus
File "/usr/lib/python3.8/site-packages/dbus/__init__.py", line 73, in <module>
File "/usr/lib/python3.8/site-packages/dbus/types.py", line 8, in <module>
ImportError: Error relocating /usr/lib/python3.8/site-packages/_dbus_bindings.cpython-38.so: dbus_py_init_byte_types: symbol not found
@Spider84@avalentin were you able to compile it. My compilation is failing with below error:
++++++++++++++++++++++++++++++++++++++++++
checking consistency of all components of python development environment... no
configure: error: in `/home/kishan/s2//build_dir/target-mipsel_24kc_musl/python3-dbus-python-1.2.16':
configure: error:
Could not link test program to Python. Maybe the main Python library has been
installed in some non-standard library path. If so, pass it to configure,
via the LIBS environment variable.
Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
See `config.log' for more details
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
I have enabled python3-dev as dependency by no luck.
Thankyou for providing makefile and patch but it's still giving same error. Not sure why. I'm using OpenWRT 18 branch as I have to and pypi.mk is not available so I'm just using old method to download, everything else remains same.
Error is coming in configure stage. Below is error from config.log. Please check and help if you can.
import dbus
File "/usr/lib/python3.8/site-packages/dbus/__init__.py", line 73, in <module>
File "/usr/lib/python3.8/site-packages/dbus/types.py", line 8, in <module>
ImportError: Error relocating /usr/lib/python3.8/site-packages/_dbus_bindings.cpython-38.so: dbus_py_init_byte_types: symbol not found