Skip to content

Commit

Permalink
python.mk: Remove zlib at source to avoir re-building
Browse files Browse the repository at this point in the history
  • Loading branch information
th0ma7 committed Nov 24, 2024
1 parent bb576d1 commit eca7dce
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mk/spksrc.python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ endif
# set PYTHONPATH for spksrc.python-module.mk
#PYTHONPATH = $(PYTHON_SITE_PACKAGES_NATIVE):$(PYTHON_LIB_NATIVE):$(PYTHON_STAGING_INSTALL_PREFIX)/lib/python$(PYTHON_VERSION)/site-packages/

# Re-use all default python mandatory libraries
PYTHON_LIBS := $(wildcard $(PYTHON_STAGING_INSTALL_PREFIX)/lib/pkgconfig/*.pc)
# Re-use all default python mandatory libraries (with exception of zlib)
PYTHON_LIBS := $(filter-out %zlib.pc,$(wildcard $(PYTHON_STAGING_INSTALL_PREFIX)/lib/pkgconfig/*.pc))

# Re-use all python dependencies and mark as already done
PYTHON_DEPENDS := $(foreach cross,$(foreach pkg_name,$(shell $(MAKE) dependency-list -C $(realpath $(PYTHON_PACKAGE_WORK_DIR)/../) 2>/dev/null | grep ^$(PYTHON_PACKAGE) | cut -f2 -d:),$(shell sed -n 's/^PKG_NAME = \(.*\)/\1/p' $(realpath $(CURDIR)/../../$(pkg_name)/Makefile))),$(wildcard $(PYTHON_PACKAGE_WORK_DIR)/.$(cross)-*_done))
# Re-use all python dependencies and mark as already done (with exceltion of zlib)
PYTHON_DEPENDS := $(foreach cross,$(filter-out zlib,$(foreach pkg_name,$(shell $(MAKE) dependency-list -C $(realpath $(PYTHON_PACKAGE_WORK_DIR)/../) 2>/dev/null | grep ^$(PYTHON_PACKAGE) | cut -f2 -d:),$(shell sed -n 's/^PKG_NAME = \(.*\)/\1/p' $(realpath $(CURDIR)/../../$(pkg_name)/Makefile)))),$(wildcard $(PYTHON_PACKAGE_WORK_DIR)/.$(cross)-*_done))

# call-up pre-depend to prepare the shared python build environment
PRE_DEPEND_TARGET = python_pre_depend
Expand All @@ -71,8 +71,6 @@ python_pre_depend:
@mkdir -p $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/
@$(foreach lib,$(PYTHON_LIBS),ln -sf $(lib) $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/ ;)
@$(foreach _done,$(PYTHON_DEPENDS), ln -sf $(_done) $(WORK_DIR) ;)
@# EXCEPTION: Ensure zlib is always built locally
@rm -f $(STAGING_INSTALL_PREFIX)/lib/pkgconfig/zlib.pc $(WORK_DIR)/.zlib*
@# EXCEPTION: Do not symlink cross/* wheel builds
@make --no-print-directory dependency-flat | sort -u | grep cross/ | while read depend ; do \
makefile="../../$${depend}/Makefile" ; \
Expand Down

0 comments on commit eca7dce

Please sign in to comment.