mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
python: simplify/unify default build rules for python packages
Most python packages use the same build rules & vars. So, adding them in python-package.mk. Also, preparing for using VARIANTs for python/python3 packages. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
@@ -77,4 +77,20 @@ define Build/Compile/HostPyMod
|
|||||||
$(3))
|
$(3))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define HostPy/Compile/Default
|
||||||
|
$(call Build/Compile/HostPyMod,,\
|
||||||
|
install --root="$(HOST_BUILD_PREFIX)" --prefix="" \
|
||||||
|
--single-version-externally-managed \
|
||||||
|
)
|
||||||
|
endef
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),python)
|
||||||
|
define Host/Compile
|
||||||
|
$(call HostPy/Compile/Default)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Host/Install
|
||||||
|
endef
|
||||||
|
endif # python
|
||||||
|
|
||||||
endif # __python_host_mk_inc
|
endif # __python_host_mk_inc
|
||||||
|
|||||||
@@ -41,6 +41,15 @@ define PyPackage
|
|||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef PyPackage/$(1)/install
|
||||||
|
define PyPackage/$(1)/install
|
||||||
|
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
|
||||||
|
$(INSTALL_DIR) $$(1)/usr/bin \
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
$(call shexport,PyPackage/$(1)/filespec)
|
$(call shexport,PyPackage/$(1)/filespec)
|
||||||
|
|
||||||
define Package/$(1)/install
|
define Package/$(1)/install
|
||||||
@@ -115,21 +124,15 @@ define Build/Compile/PyMod
|
|||||||
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
|
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define PyMod/Default
|
define PyBuild/Compile/Default
|
||||||
define Build/Compile
|
$(call Build/Compile/PyMod,, \
|
||||||
$$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
|
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
|
||||||
endef
|
--single-version-externally-managed \
|
||||||
|
)
|
||||||
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
|
endef
|
||||||
|
|
||||||
|
ifeq ($(BUILD_VARIANT),python)
|
||||||
|
define Build/Compile
|
||||||
|
$(call PyBuild/Compile/Default)
|
||||||
|
endef
|
||||||
|
endif # python
|
||||||
|
|||||||
Reference in New Issue
Block a user