package infra: add patch-dependencies
authorYann E. MORIN <yann.morin.1998@free.fr>
Sat, 14 Mar 2015 14:25:17 +0000 (15:25 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 9 Apr 2015 20:47:30 +0000 (22:47 +0200)
Some packages need to vampirise files from one or more other packages.
This is the case, for example, of the Linux kernel and its /extensions/.

Add a new type of dependencies, that are guaranteed to be extracted and
patched before a package is patched.

[Thomas: remove <pkg>-show-build-depends and <pkg>-show-patch-depends,
since they don't seem to really be necessary and very useful.]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pkg-generic.mk

index f77aab27d5cb49044f0816142ac9ee68285520dc..1d56f81778aa032057c2e105694536e985eef737 100644 (file)
@@ -428,6 +428,7 @@ endif
 
 # Eliminate duplicates in dependencies
 $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES))
+$(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES))
 
 $(2)_INSTALL_STAGING           ?= NO
 $(2)_INSTALL_IMAGES            ?= NO
@@ -539,6 +540,8 @@ $$($(2)_TARGET_CONFIGURE):  $$($(2)_TARGET_PATCH)
 
 $(1)-patch:            $$($(2)_TARGET_PATCH)
 $$($(2)_TARGET_PATCH): $$($(2)_TARGET_EXTRACT)
+# Order-only dependency
+$$($(2)_TARGET_PATCH):  | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES))
 
 $(1)-extract:                  $$($(2)_TARGET_EXTRACT)
 $$($(2)_TARGET_EXTRACT):       $$($(2)_TARGET_SOURCE)
@@ -578,7 +581,7 @@ $(1)-show-version:
                        @echo $$($(2)_VERSION)
 
 $(1)-show-depends:
-                       @echo $$($(2)_FINAL_DEPENDENCIES)
+                       @echo $$(sort $$($(2)_FINAL_DEPENDENCIES) $$($(2)_FINAL_PATCH_DEPENDENCIES))
 
 $(1)-graph-depends: graph-depends-requirements
                        @$$(INSTALL) -d $$(GRAPHS_DIR)