Some assistance creating a Makefile for iotop

I'd like to build iotop with the OpenWrt build system. I am trying to convert how I compile it on Arch Linux to the OpenWrt format but am not able to get it right.

On Arch, the make depends are:

python-build
python-installer
python-setuptools
python-wheel

Compiling iotop is accomplished like this:

cd src
sed -i '7,13d' setup.py
python -m build --wheel --no-isolation
python -m installer --destdir=foo dist/*.whl

That results in a compiled binary. When I try the following Makefile, I get a simple text file installed to /usr/bin/iotop not the expected compiled binary. Any suggestions are welcomed.

include $(TOPDIR)/rules.mk
PKG_NAME:=iotop
PKG_VERSION:=0.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://guichaz.free.fr/$(PKG_NAME)/files
PKG_HASH:=3adea2a24eda49bbbaeb4e6ed2042355b441dbd7161e883067a02bfc8dcef75b
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Place Holder <place@holder.com>

include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk

define Package/iotop
	SECTION:=utils
	CATEGORY:=Utilities
	TITLE:=View IO usage of processes
	URL:=http://guichaz.free.fr/iotop/
	DEPENDS:=+python3-light
endef

define Package/iotop/description
   iotop is a Python program with a top-like UI used to show of behalf of which
   process is the I/O going on.
endef

define Build/Prepare
	$(call Build/Prepare/Default)
	$(SED) '7,13d' $(PKG_BUILD_DIR)/setup.py
endef

define Package/iotop/install
	$(call Py3Package/$(PKG_NAME)/install,$(1))
	$(INSTALL_DIR) $(1)/usr/bin
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
endef

$(eval $(call BuildPackage,iotop))
$(eval $(call Py3Package,iotop))

Nevermind, I found a fork written in C which works great:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.