[Buildroot] [PATCH 2 of 2] infra: remove usage of pkgparentdir in favor of pkgdir

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Nov 12 08:56:37 UTC 2013


On Tue, Nov 12, 2013 at 12:15 AM, Arnout Vandecappelle <arnout at mind.be> wrote:
> On 11/11/13 12:53, Thomas De Schampheleire wrote:
>>
>> As Arnout suggested, pkgparentdir is no longer really needed. Its usage
>> can
>> be replaced with pkgdir. This patch makes that change, and removes the
>> definition of pkgparentdir.
>>
>> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
>>
>> ---
>> Note: as a consequence of this change, the definition of FOO_DIR_PREFIX
>> slightly changed. I could have renamed the variable, but FOO_DIR was
>> already
>> taken, and it's still more or less a prefix.
>
>
>  I think it's a better idea to choose a new name - if only to help people
> who are using this variable in custom packages. Or better yet, remove it
> completely - it's anyway not used anymore.

The only remaining place is in the foo-patch block, to get the
location of patches for that package.
That is outside the inner-generic-package, so we cannot use $(4)
anymore. How do you propose to solve that?

>
>
>
>>
>>   package/pkg-autotools.mk |   6 +++---
>>   package/pkg-cmake.mk     |   6 +++---
>>   package/pkg-generic.mk   |  10 +++++-----
>>   package/pkg-utils.mk     |   1 -
>>   4 files changed, 11 insertions(+), 12 deletions(-)
>>
>> diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
>> --- a/package/pkg-autotools.mk
>> +++ b/package/pkg-autotools.mk
>> @@ -48,7 +48,7 @@ endef
>>   #             for host packages
>>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>>   #             for host packages
>> -#  argument 4 is the package directory prefix
>> +#  argument 4 is the package directory
>>   #  argument 5 is the type (target or host)
>>
>> ################################################################################
>>
>> @@ -311,5 +311,5 @@ endef
>>   # autotools-package -- the target generator macro for autotools packages
>>
>> ################################################################################
>>
>> -autotools-package = $(call inner-autotools-package,$(call pkgname),$(call
>> UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call
>> pkgparentdir),target)
>> -host-autotools-package = $(call inner-autotools-package,host-$(call
>> pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call
>> pkgname)),$(call pkgparentdir),host)
>> +autotools-package = $(call inner-autotools-package,$(call pkgname),$(call
>> UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call
>> pkgdir),target)
>> +host-autotools-package = $(call inner-autotools-package,host-$(call
>> pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call
>> pkgname)),$(call pkgdir),host)
>> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
>> --- a/package/pkg-cmake.mk
>> +++ b/package/pkg-cmake.mk
>> @@ -31,7 +31,7 @@
>>   #             for host packages
>>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>>   #             for host packages
>> -#  argument 4 is the package directory prefix
>> +#  argument 4 is the package directory
>>   #  argument 5 is the type (target or host)
>>
>> ################################################################################
>>
>> @@ -179,8 +179,8 @@ endef
>>   # cmake-package -- the target generator macro for CMake packages
>>
>> ################################################################################
>>
>> -cmake-package = $(call inner-cmake-package,$(call pkgname),$(call
>> UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call
>> pkgparentdir),target)
>> -host-cmake-package = $(call inner-cmake-package,host-$(call
>> pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call
>> pkgname)),$(call pkgparentdir),host)
>> +cmake-package = $(call inner-cmake-package,$(call pkgname),$(call
>> UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call
>> pkgdir),target)
>> +host-cmake-package = $(call inner-cmake-package,host-$(call
>> pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call
>> pkgname)),$(call pkgdir),host)
>>
>>
>> ################################################################################
>>   # Generation of the CMake toolchain file
>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>> --- a/package/pkg-generic.mk
>> +++ b/package/pkg-generic.mk
>> @@ -89,7 +89,7 @@ endif
>>   # 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: PATCH_BASE_DIRS =
>> $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call
>> qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
>> +$(BUILD_DIR)/%/.stamp_patched: PATCH_BASE_DIRS = $($(PKG)_DIR_PREFIX)
>> $(call qstrip,$(BR2_GLOBAL_PATCH_DIR))/$(RAWNAME)
>>   $(BUILD_DIR)/%/.stamp_patched:
>>         @$(call MESSAGE,"Patching")
>>         $(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
>> @@ -197,7 +197,7 @@ endif
>>   #             for host packages
>>   #  argument 3 is the uppercase package name, without the HOST_ prefix
>>   #             for host packages
>> -#  argument 4 is the package directory prefix
>> +#  argument 4 is the package directory
>>   #  argument 5 is the type (target or host)
>>
>> ################################################################################
>>
>> @@ -475,7 +475,7 @@ endif
>>   # kernel case, the bootloaders case, and the normal packages case.
>>   ifeq ($(1),linux)
>>   $(2)_KCONFIG_VAR = BR2_LINUX_KERNEL
>> -else ifeq ($(4),boot/)
>> +else ifneq ($(filter boot/%,$(4)),)
>
>
>  Since this is the only place where $(4) is used, we could use $(pkgdir)
> directly and drop the 4th parameter. (I just tested and it seems to work.)

If we can find a solution for the patching commands, then it's
probably possible...

Best regards,
Thomas


More information about the buildroot mailing list