package/opkg-utils: add opkg-utils as target pkg

Supports a use case of building container rootfs images where a matching
target version of the tools is required for repackaging of a installer
archive.

binutils binaries are needed for 'ar'; binutils does not work on nios2,
but busybox does, and so we can have 'ar' on nios2 with busybox.

A few other compressors can be used besides gzip, but the default in the
scripts is gzip, so we only ensure this one is enabled. Users who want
other compressors will have to enable them in their configurations.

Note: the order of 'select' is not strictly alphabetical: all packages
provided by busybox applets have been grouped together at the top, with
packages never provided by busybox applets together at the end.

Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
[yann.morin.1998@free.fr:
  - only select full-blown packages if busybox is not enabled
  - select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS, instead of 'depends on'
  - allow on nios2 when busybox is enabled
  - add binutils binaries on target (for 'ar')
  - drop _DEPENDENCIES: they all are only runtime-dpeendencies
  - add comment when python(2) is enabled
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Ryan Barnett 2021-03-12 14:05:33 -06:00 committed by Yann E. MORIN
parent 3efc5a250c
commit b9bf1c6535
3 changed files with 41 additions and 0 deletions

View File

@ -2339,6 +2339,7 @@ comment "See the manual: "
comment "http://buildroot.org/manual.html#faq-no-binary-packages"
comment "-------------------------------------------------------"
source "package/opkg/Config.in"
source "package/opkg-utils/Config.in"
source "package/rpm/Config.in"
endmenu

View File

@ -0,0 +1,34 @@
config BR2_PACKAGE_OPKG_UTILS
bool "opkg-utils"
depends on !BR2_nios2 || BR2_PACKAGE_BUSYBOX # binutils
depends on BR2_USE_MMU # bash, python3
depends on BR2_USE_WCHAR # python3
depends on BR2_TOOLCHAIN_HAS_THREADS # python3 <- libffi
depends on !BR2_STATIC_LIBS # python3
depends on !BR2_PACKAGE_PYTHON # python3
select BR2_PACKAGE_BINUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_BINUTILS_TARGET if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_COREUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_DIFFUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_FINDUTILS if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_GREP if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_GZIP if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_SED if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_TAR if !BR2_PACKAGE_BUSYBOX # runtime
select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash
select BR2_PACKAGE_BASH # runtime
select BR2_PACKAGE_PYTHON3 # runtime
help
Helper scripts for use with the opkg package manager.
https://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/
comment "opkg-utils needs a toolchain w/ wchar, threads, dynamic library"
depends on !BR2_nios2 || BR2_PACKAGE_BUSYBOX
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
comment "opkg-utils needs python3"
depends on !BR2_nios2 || BR2_PACKAGE_BUSYBOX
depends on BR2_USE_MMU
depends on BR2_PACKAGE_PYTHON

View File

@ -16,9 +16,15 @@ HOST_OPKG_UTILS_DEPENDENCIES = \
host-lz4 \
host-xz
# Nothing to build; only scripts to install.
define OPKG_UTILS_INSTALL_CMDS
$(MAKE) -C $(@D) PREFIX=$(TARGET_DIR) install-utils
endef
# Nothing to build; only scripts to install.
define HOST_OPKG_UTILS_INSTALL_CMDS
$(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install-utils
endef
$(eval $(generic-package))
$(eval $(host-generic-package))