Skip to content

Instantly share code, notes, and snippets.

@h3po
Created February 18, 2017 23:28
Show Gist options
  • Save h3po/854317aa7fae7a41cedfc442816e3f97 to your computer and use it in GitHub Desktop.
Save h3po/854317aa7fae7a41cedfc442816e3f97 to your computer and use it in GitHub Desktop.
Makefile for building python-scandir package on openwrt, v1.3 as dependency for octoprint
include $(TOPDIR)/rules.mk
PKG_NAME:=scandir
PKG_VERSION:=1.3
PKG_RELEASE:=1
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/benhoyt/scandir/archive/
PKG_BUILD_DIR:=$(BUILD_DIR)/scandir-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
define Package/python-scandir
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=python-scandir
URL:=https://github.com/benhoyt/scandir
DEPENDS:=+python
endef
define Package/python-scandir/description
Better directory iterator and faster os.walk(), now in the Python 3.5 stdlib
endef
define Build/Compile
$(call Build/Compile/PyMod,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
)
endef
define Package/python-scandir/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
endef
$(eval $(call BuildPackage,python-scandir))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment