diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2011-07-05 21:53:57 +0200 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2011-07-07 23:48:41 +0200 |
commit | 7a41cbf938d6a189109b8b15dc2cef8638c5a0c2 (patch) | |
tree | 6c2e7697c8885b635e3309012012b9f153db8ea5 /package | |
parent | 2985998f2810fb3b45af4e1ee46eaec993959edb (diff) |
package: fix patching procedure for host packages
The patching procedure was using $($(NOHOSTPKG)_NAME) to find the name
of the package without the host- prefix for host packages, which is
needed to find the package directory and the prefix of the patches.
However, this $($(NOHOSTPKG)_NAME) variable is empty when there is
only an host variant for the package and no target variant for it.
Therefore, instead of using this $($(NOHOSTPKG)_NAME) variable, we now
use a new $(RAWNAME) variable, which is always the name of the package
without the host- prefix, even for host packages.
Thanks to Yann E. Morin for providing the tip on using patsubst
instead of subst.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package')
-rw-r--r-- | package/Makefile.package.in | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/package/Makefile.package.in b/package/Makefile.package.in index f79359a58..8b5657b2d 100644 --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -251,23 +251,21 @@ $(BUILD_DIR)/%/.stamp_extracted: # Patch # -# The NOHOSTPKG variable is the uppercased package name, without the -# HOST_ prefix, even for host packages. This allows to find the -# patches in the package directory, because $($(NOHOSTPKG)_NAME) -# expands to the package directory name. -# -$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $($(NOHOSTPKG)_NAME)-$($(PKG)_VERSION) +# The RAWNAME variable is the lowercased package name, which allows to +# find the package directory (typically package/<pkgname>) and the +# prefix of the patches +$(BUILD_DIR)/%/.stamp_patched: NAMEVER = $(RAWNAME)-$($(PKG)_VERSION) $(BUILD_DIR)/%/.stamp_patched: - @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)") + @$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)") $(if $($(PKG)_PATCH),toolchain/patch-kernel.sh $(@D) $(DL_DIR) $($(PKG)_PATCH)) $(Q)( \ - if test -d $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME); then \ - if test "$(wildcard $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER)*.patch*)"; then \ - toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \ + if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \ + if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \ + toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \ else \ - toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME) $($(NOHOSTPKG)_NAME)\*.patch $($(NOHOSTPKG)_NAME)\*.patch.$(ARCH) || exit 1; \ - if test -d $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER); then \ - toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(NOHOSTPKG)_NAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \ + toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(RAWNAME)\*.patch $(RAWNAME)\*.patch.$(ARCH) || exit 1; \ + if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER); then \ + toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \ fi; \ fi; \ fi; \ @@ -515,7 +513,7 @@ $$($(2)_TARGET_INSTALL_HOST): PKG=$(2) $$($(2)_TARGET_BUILD): PKG=$(2) $$($(2)_TARGET_CONFIGURE): PKG=$(2) $$($(2)_TARGET_PATCH): PKG=$(2) -$$($(2)_TARGET_PATCH): NOHOSTPKG=$(3) +$$($(2)_TARGET_PATCH): RAWNAME=$(patsubst host-%,%,$(1)) $$($(2)_TARGET_EXTRACT): PKG=$(2) $$($(2)_TARGET_SOURCE): PKG=$(2) $$($(2)_TARGET_UNINSTALL): PKG=$(2) |