From 0268f52a4cd2b7aa63934526437bcf6912e47d3c Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 2 Apr 2025 09:13:31 +0100 Subject: [PATCH] depends: Introduce customizable `$(package)_patches_path` variables This change helps avoid patch duplication between a package and its native counterpart. --- depends/funcs.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index b07432adec9..e7cc288bfd6 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -40,7 +40,8 @@ define fetch_file endef define int_get_build_recipe_hash -$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) +$(eval $(1)_patches_path?=$(PATCHES_PATH)/$(1)) +$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $($(1)_patches_path)/,$($(1)_patches)) | cut -d" " -f1)) $(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) endef @@ -219,7 +220,7 @@ $($(1)_extracted): | $($(1)_fetched) $($(1)_preprocessed): | $($(1)_extracted) echo Preprocessing $(1)... mkdir -p $$(@D) $($(1)_patch_dir) - $(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) + $(foreach patch,$($(1)_patches),cd $($(1)_patches_path); cp $(patch) $($(1)_patch_dir) ;) { cd $$(@D); $($(1)_preprocess_cmds); } $$($(1)_logging) touch $$@ $($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed)