How to define dynamic list of packages

Hello,

I'm creating a package for tesseract (Open Source OCR Engine). However, this software contains a lot of "data files", one for each language.

In the AUR repository, this is handled with only one package (https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/tesseract-data), which create a package for each language.

Is possible to do something like this with the OpenWrt build system? Creating a separated package for each language would be a nightmare....

BR

package/firmware/ipq-wifi/Makefile is one example of a (semi-)dynamically generated package that probably does much of what you need, installing a specific file based on which "variant" is requested.

1 Like

Thnks, will check

Hello,

Here is the Makefile of tesseract that I'm working on: https://github.com/vk496/packages/blob/2639aaedfa44cbba905b8328ff9b7d8d3ec0b1ad/utils/tesseract/Makefile

Is there a way to avoid calling each time the generate-tesseract-data-package?

I tried to replace all that calls with a simple $(foreach PACKAGE,$(ALLTESSERACTPACKAGES),$(eval $(call generate-tesseract-data-package,$(PACKAGE)))), but the make menuconfig throws error:

ERROR: please fix package/utils/tesseract/Makefile - see logs/package/utils/tesseract/dump.txt for details
Collecting package info: done
tmp/.config-package.in:33096:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"

With the following log:

$ cat logs/package/utils/tesseract/dump.txt 

Package: tesseract
Submenu: Tesseract
Version: 4.0.0-1
Depends: +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread +libleptonica +libpthread +libstdcpp
Conflicts: 
Menu-Depends: 
Provides: 
Section: utils
Category: Utilities
Repository: base
Title: Tesseract Open Source OCR Engine
Maintainer: ValentĂ­n Kivachuk <vk18496@gmail.com>
Source: tesseract-ocr-4.0.0.tar.xz
License: Apache-2.0
LicenseFiles: LICENSE
Type: ipkg
Description: Tesseract Open Source OCR Engine
http://tesseract-ocr.googlecode.com/
ValentĂ­n Kivachuk <vk18496@gmail.com>
@@

Package: tesseract-data-afr
Version: 4.0.0-1
Depends: +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread 
Conflicts: 
Menu-Depends: 
Provides: 
Section: opt
Category: Extra packages
Repository: base
Title: 
Maintainer: ValentĂ­n Kivachuk <vk18496@gmail.com>
Source: tesseract-ocr-4.0.0.tar.xz
License: Apache-2.0
LicenseFiles: LICENSE
Type: ipkg
Description: 
ValentĂ­n Kivachuk <vk18496@gmail.com>
@@

Makefile:110: *** Package/tesseract-data-afr is missing the TITLE field.  Stop.

Thnks in advice.

BR