aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-05 21:21:35 -0500
committerDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-18 17:15:36 -0500
commit83d992a8a9e8f4b681b674e7e89e5d6027b1c242 (patch)
tree912cc6c672c0e2df5d3650211b92aee433864b84 /lang
parentc1dc8cd0e4c3ea65b8859cac8a54ef4a7c702d81 (diff)
lang/python: Make building additional (non-base) python modules easier
This adds code to make it easier to build third-party python modules such as ones from PyPi. Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
Diffstat (limited to 'lang')
-rw-r--r--lang/python/files/python-package.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk
index 92e8fdd37..0a370c531 100644
--- a/lang/python/files/python-package.mk
+++ b/lang/python/files/python-package.mk
@@ -109,3 +109,21 @@ define Build/Compile/PyMod
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef
+define PyMod/Default
+ define Build/Compile
+ $$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+ endef
+
+ define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $$(1)$(PYTHON_PKG_DIR) $$(1)/usr/bin
+ if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
+ find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
+ endef
+
+ define Build/InstallDev
+ $(INSTALL_DIR) $$(1)/usr/bin $$(1)$(PYTHON_PKG_DIR)
+ if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then find $(PKG_INSTALL_DIR)/usr/bin -mindepth 1 -maxdepth 1 -type f -exec $(CP) \{\} $$(1)/usr/bin/ \; ; fi
+ find $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR) -mindepth 1 -maxdepth 1 \( -type f -o -type d \) -exec $(CP) \{\} $$(1)$(PYTHON_PKG_DIR)/ \;
+ endef
+endef
+