From 226a241e8afee4bace0e0f1ca7cd9d237da637d1 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 17 Mar 2026 11:22:20 +0100 Subject: [PATCH] py-defs.mk: Add PY_INSTALL_INIT_PY Add PY_INSTALL_INIT_PY ?= true to py-defs.mk. If set to false, a Python module will not try to attempt installing an existing / generated __init__.py. This is useful when installing into an exiting directory with an existing __init__.py. Signed-off-by: Jan Lindemann --- make/py-defs.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make/py-defs.mk b/make/py-defs.mk index fee7f5a8..5772cc52 100644 --- a/make/py-defs.mk +++ b/make/py-defs.mk @@ -22,6 +22,8 @@ ifneq ($(PY_INSTALL_DIR),) PY_INSTALL_DIR_PY ?= $(PY_INSTALL_DIR) endif +PY_INSTALL_INIT_PY ?= true + # deduce PY_INSTALL_DIR_PY from working directory below .. python/ ifeq ($(PY_INSTALL_DIR_PY),) PY_INSTALL_PKG_MOD ?= $(shell $(ECHO) $(CWD) | $(SED) 's%.*/python/%%; s%/.*%%') @@ -32,7 +34,9 @@ ifeq ($(PY_INSTALL_DIR_PY),) PY_INSTALL_MOD ?= $(PY_INSTALL_PKG_MOD) endif PY_MOD ?= $(subst /,.,$(PY_INSTALL_MOD)) - PY_ALL_PY += __init__.py + ifeq ($(PY_INSTALL_INIT_PY),true) + PY_ALL_PY += __init__.py + endif PY_INSTALL_DIR_PY ?= $(ENV_PREFIX)$(PY_SITE_PACKAGES_PATH)/$(patsubst .,/,$(PY_INSTALL_MOD)) else ifeq ($(PY_INSTALL_DIR_PY),)